-
Notifications
You must be signed in to change notification settings - Fork 527
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: now we support hadoop sdk #2807
Conversation
cicheck |
e3b73c8
to
f7f55e2
Compare
cicheck |
60c01b6
to
13ba40f
Compare
@@ -1086,6 +1098,11 @@ CURVEFS_ERROR FuseClient::FuseOpSetXattr(fuse_req_t req, fuse_ino_t ino, | |||
VLOG(1) << "FuseOpSetXattr ino: " << ino << ", name: " << name | |||
<< ", size = " << size | |||
<< ", strvalue: " << strvalue; | |||
|
|||
if (option_.fileSystemOption.disableXAttr && !IsSpecialXAttr(name)) { |
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.
The speciacl xattrs should not allowed to set by general user.
cicheck |
1 similar comment
cicheck |
cicheck |
1 similar comment
cicheck |
cicheck |
2 similar comments
cicheck |
cicheck |
b31fb56
to
1f8b2f6
Compare
cicheck |
|
||
import org.apache.hadoop.fs.CommonConfigurationKeys; | ||
|
||
public class CurveFSConfigKeys extends CommonConfigurationKeys {} |
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.
where the class CurveFSConfigKeys
used?
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.
where the class
CurveFSConfigKeys
used?
Fixed, i had delete it.
fileHandle = fh; | ||
closed = false; | ||
curve = curvefs; | ||
buffer = new byte[1<<21]; |
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.
How to determine buffer size?
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.
How to determine buffer size?
It's a const tradeoff :)
curvefs/src/client/fuse_client.cpp
Outdated
*realSize += strlen(XATTRRSUBDIRS) + 1; | ||
*realSize += strlen(XATTRRENTRIES) + 1; | ||
*realSize += strlen(XATTRRFBYTES) + 1; | ||
*realSize += strlen(XATTR_DIR_RFILES) + 1; |
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.
listxattr also need check option_.fileSystemOption.disableXAttr
const std::string& name, | ||
uint16_t mode, | ||
EntryOut* entryOut) { | ||
auto ctx = NewFuseContext(); |
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.
Is it possible to use FuseContext as a variable instead of creating a new one every time?
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.
Is it possible to use FuseContext as a variable instead of creating a new one every time?
No, because we should get the latest uid
and gid
which can modified on fly.
cicheck |
cicheck |
1 similar comment
cicheck |
cicheck |
2 similar comments
cicheck |
cicheck |
it's too hard to review such a huge pr with 4 commit. over 100,000 lines changed. |
bool yes = lru_->Get(key, &value); | ||
if (!yes) { | ||
return false; | ||
} else if (value.expire < Now()) { |
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.
expired item should be removed from lru cache.
seems no periodical task to clean up expired items in lru cache also.
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.
expired item should be removed from lru cache. seems no periodical task to clean up expired items in lru cache also.
Add todo for this.
return s; | ||
} | ||
|
||
bool HasPrefix(const std::string& str, const std::string& prefix) { |
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.
#include "absl/strings/match.h"
absl::StartsWith()
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.
#include "absl/strings/match.h" absl::StartsWith()
Fixed.
return str.rfind(prefix, 0) == 0; | ||
} | ||
|
||
std::vector<std::string> Split(const std::string& 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.
why wrap it?
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.
why wrap it?
In order to:
- Form a unified namespace, like you can find all string related function in
strings
namespace. - One header include all util functions: you can find all functions once you include the
utils.h
header file and if you useabsl
library, you should find the function in which header and include it.
It is more easy to use.
|
||
} // namespace strings | ||
|
||
namespace filepath { |
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.
use butil::FilePath?
seems many utils can reuse util in butil or absl
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.
use butil::FilePath? seems many utils can reuse util in butil or absl
ditto
return DoMkDir(path, mode); | ||
} | ||
|
||
CURVEFS_ERROR VFS::MkDirs(const std::string& path, uint16_t mode) { |
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.
logic is wrong, cannot handle case below
touch a
mkdir -p a
expect return: File Exist
actual return: OK
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.
logic is wrong, cannot handle case below
touch a mkdir -p a
expect return: File Exist actual return: OK
Fixed.
return CURVEFS_ERROR::OK; | ||
} | ||
|
||
CURVEFS_ERROR VFS::Lookup(const std::string& path, |
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.
careful about stack overflow
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.
careful about stack overflow
Yep.
Agree! |
8aee77a
to
8ffe333
Compare
cicheck |
Signed-off-by: Wine93 <[email protected]>
Signed-off-by: Wine93 <[email protected]>
Signed-off-by: Wine93 <[email protected]>
cicheck |
Signed-off-by: Wine93 <[email protected]>
cicheck |
4 similar comments
cicheck |
cicheck |
cicheck |
cicheck |
No description provided.