Skip to content
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

Merged
merged 4 commits into from
Oct 24, 2023
Merged

Conversation

Wine93
Copy link
Contributor

@Wine93 Wine93 commented Oct 16, 2023

No description provided.

@Wine93 Wine93 changed the title Sdk/hadoop curvefs/client: now we support hadoop sdk Oct 16, 2023
@Wine93
Copy link
Contributor Author

Wine93 commented Oct 16, 2023

cicheck

@Wine93 Wine93 force-pushed the sdk/hadoop branch 4 times, most recently from e3b73c8 to f7f55e2 Compare October 17, 2023 02:18
@Wine93
Copy link
Contributor Author

Wine93 commented Oct 17, 2023

cicheck

@Wine93 Wine93 force-pushed the sdk/hadoop branch 2 times, most recently from 60c01b6 to 13ba40f Compare October 17, 2023 08:12
@@ -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)) {
Copy link
Contributor

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.

@YunhuiChen
Copy link
Contributor

cicheck

1 similar comment
@YunhuiChen
Copy link
Contributor

cicheck

@YunhuiChen YunhuiChen closed this Oct 18, 2023
@YunhuiChen YunhuiChen reopened this Oct 18, 2023
@YunhuiChen
Copy link
Contributor

cicheck

1 similar comment
@YunhuiChen
Copy link
Contributor

cicheck

@YunhuiChen YunhuiChen closed this Oct 18, 2023
@YunhuiChen YunhuiChen reopened this Oct 18, 2023
@YunhuiChen
Copy link
Contributor

cicheck

2 similar comments
@YunhuiChen
Copy link
Contributor

cicheck

@YunhuiChen
Copy link
Contributor

cicheck

@Wine93 Wine93 force-pushed the sdk/hadoop branch 2 times, most recently from b31fb56 to 1f8b2f6 Compare October 18, 2023 12:38
@YunhuiChen
Copy link
Contributor

cicheck


import org.apache.hadoop.fs.CommonConfigurationKeys;

public class CurveFSConfigKeys extends CommonConfigurationKeys {}
Copy link
Contributor

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?

Copy link
Contributor Author

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];
Copy link
Contributor

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?

Copy link
Contributor Author

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 :)

*realSize += strlen(XATTRRSUBDIRS) + 1;
*realSize += strlen(XATTRRENTRIES) + 1;
*realSize += strlen(XATTRRFBYTES) + 1;
*realSize += strlen(XATTR_DIR_RFILES) + 1;
Copy link
Contributor

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();
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@Wine93
Copy link
Contributor Author

Wine93 commented Oct 19, 2023

cicheck

@Wine93 Wine93 closed this Oct 19, 2023
@Wine93
Copy link
Contributor Author

Wine93 commented Oct 19, 2023

cicheck

1 similar comment
@Wine93
Copy link
Contributor Author

Wine93 commented Oct 19, 2023

cicheck

@Wine93
Copy link
Contributor Author

Wine93 commented Oct 19, 2023

cicheck

2 similar comments
@Wine93
Copy link
Contributor Author

Wine93 commented Oct 19, 2023

cicheck

@Wine93
Copy link
Contributor Author

Wine93 commented Oct 19, 2023

cicheck

@h0hmj
Copy link
Contributor

h0hmj commented Oct 20, 2023

it's too hard to review such a huge pr with 4 commit. over 100,000 lines changed.
need more clear statement about what changed (add/delete) to guide review.

curvefs/sdk/java/native/BUILD Show resolved Hide resolved
util/playground.sh Show resolved Hide resolved
curvefs/src/client/fuse_client.cpp Outdated Show resolved Hide resolved
curvefs/src/client/sdk_helper.cpp Outdated Show resolved Hide resolved
bool yes = lru_->Get(key, &value);
if (!yes) {
return false;
} else if (value.expire < Now()) {
Copy link
Contributor

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.

Copy link
Contributor Author

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) {
Copy link
Contributor

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()

Copy link
Contributor Author

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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why wrap it?

Copy link
Contributor Author

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:

  1. Form a unified namespace, like you can find all string related function in strings namespace.
  2. One header include all util functions: you can find all functions once you include the utils.h header file and if you use absl library, you should find the function in which header and include it.

It is more easy to use.


} // namespace strings

namespace filepath {
Copy link
Contributor

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

Copy link
Contributor Author

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) {
Copy link
Contributor

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

Copy link
Contributor Author

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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

careful about stack overflow

Copy link
Contributor Author

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.

@Wine93
Copy link
Contributor Author

Wine93 commented Oct 23, 2023

it's too hard to review such a huge pr with 4 commit. over 100,000 lines changed. need more clear statement about what changed (add/delete) to guide review.

Agree!

@Wine93 Wine93 force-pushed the sdk/hadoop branch 2 times, most recently from 8aee77a to 8ffe333 Compare October 23, 2023 11:24
@Wine93
Copy link
Contributor Author

Wine93 commented Oct 23, 2023

cicheck

@Wine93 Wine93 closed this Oct 24, 2023
@Wine93 Wine93 reopened this Oct 24, 2023
Signed-off-by: Wine93 <wine93.info@gmail.com>
Signed-off-by: Wine93 <wine93.info@gmail.com>
Signed-off-by: Wine93 <wine93.info@gmail.com>
@Wine93
Copy link
Contributor Author

Wine93 commented Oct 24, 2023

cicheck

Signed-off-by: Wine93 <wine93.info@gmail.com>
@Wine93
Copy link
Contributor Author

Wine93 commented Oct 24, 2023

cicheck

4 similar comments
@Wine93
Copy link
Contributor Author

Wine93 commented Oct 24, 2023

cicheck

@Wine93
Copy link
Contributor Author

Wine93 commented Oct 24, 2023

cicheck

@Wine93
Copy link
Contributor Author

Wine93 commented Oct 24, 2023

cicheck

@Wine93
Copy link
Contributor Author

Wine93 commented Oct 24, 2023

cicheck

@Wine93 Wine93 merged commit d616bd3 into opencurve:master Oct 24, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants