-
Notifications
You must be signed in to change notification settings - Fork 526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
curvefs/client: add feature of warmup #1793
Conversation
94bdd7b
to
c570cbd
Compare
should not pull in boost for simple problem |
d696e7c
to
11ae6bc
Compare
recheck |
7228204
to
457d5d0
Compare
8953e23
to
6ae1335
Compare
std::string pDelimiter = "\n"; | ||
char* pToken = nullptr; | ||
char* pSave = nullptr; | ||
pToken = strtok_r(const_cast<char*>(file.c_str()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicate code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it
GetTaskFetchPool().Enqueue(task); | ||
} | ||
|
||
void FuseS3Client::travelChunk(fuse_ino_t ino, S3ChunkInfoList chunkInfo, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this function for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
travel and download all objs belong to the chunk. and i have commnted.
} | ||
|
||
void FuseS3Client::WarmUpAllObjs( | ||
const std::list<std::pair<std::string, uint64_t>> &prefetchObjs) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These logics are very similar to FileCacheManager::PrefetchS3Objs, try to merge as much as possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
year, there are many similars, and i have added todo.
curvefs/src/client/fuse_s3_client.h
Outdated
@@ -92,6 +101,18 @@ class FuseS3Client : public FuseClient { | |||
private: | |||
// s3 adaptor | |||
std::shared_ptr<S3ClientAdaptor> s3Adaptor_; | |||
|
|||
Thread bgFetchThread_; | |||
std::atomic<bool> bgFetchStop_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not define private members and functions together; use a new class to manage them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it
}; | ||
|
||
TEST_F(TestFuseS3Client, warmUp_dentryNotexist) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make a note for the test scene
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it
recheck |
Code still needs to be optimized |
Signed-off-by: hzwuhongsong hzwuhongsong@corp.netease.com
Issue Number: #1802
Problem Summary:
Added warmup function, then we can warmup the file to local cache directory before we need it.