Skip to content

curvefs/client: now we support hadoop sdk#2807

Merged
Wine93 merged 4 commits intoopencurve:masterfrom
Wine93:sdk/hadoop
Oct 24, 2023
Merged

curvefs/client: now we support hadoop sdk#2807
Wine93 merged 4 commits intoopencurve:masterfrom
Wine93:sdk/hadoop

Conversation

@Wine93
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
<< ", size = " << size
<< ", strvalue: " << strvalue;

if (option_.fileSystemOption.disableXAttr && !IsSpecialXAttr(name)) {
Copy link
Copy Markdown
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
Copy Markdown
Contributor

cicheck

1 similar comment
@YunhuiChen
Copy link
Copy Markdown
Contributor

cicheck

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

cicheck

1 similar comment
@YunhuiChen
Copy link
Copy Markdown
Contributor

cicheck

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

cicheck

2 similar comments
@YunhuiChen
Copy link
Copy Markdown
Contributor

cicheck

@YunhuiChen
Copy link
Copy Markdown
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
Copy Markdown
Contributor

cicheck


import org.apache.hadoop.fs.CommonConfigurationKeys;

public class CurveFSConfigKeys extends CommonConfigurationKeys {}
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 :)

Comment thread 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;
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

Wine93 commented Oct 19, 2023

cicheck

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

Wine93 commented Oct 19, 2023

cicheck

1 similar comment
@Wine93
Copy link
Copy Markdown
Contributor Author

Wine93 commented Oct 19, 2023

cicheck

@Wine93
Copy link
Copy Markdown
Contributor Author

Wine93 commented Oct 19, 2023

cicheck

2 similar comments
@Wine93
Copy link
Copy Markdown
Contributor Author

Wine93 commented Oct 19, 2023

cicheck

@Wine93
Copy link
Copy Markdown
Contributor Author

Wine93 commented Oct 19, 2023

cicheck

@h0hmj
Copy link
Copy Markdown
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.

Comment thread curvefs/sdk/java/native/BUILD
Comment thread util/playground.sh
Comment thread curvefs/src/client/fuse_client.cpp Outdated
Comment thread curvefs/src/client/sdk_helper.cpp Outdated
bool yes = lru_->Get(key, &value);
if (!yes) {
return false;
} else if (value.expire < Now()) {
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

Wine93 commented Oct 24, 2023

cicheck

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

Wine93 commented Oct 24, 2023

cicheck

4 similar comments
@Wine93
Copy link
Copy Markdown
Contributor Author

Wine93 commented Oct 24, 2023

cicheck

@Wine93
Copy link
Copy Markdown
Contributor Author

Wine93 commented Oct 24, 2023

cicheck

@Wine93
Copy link
Copy Markdown
Contributor Author

Wine93 commented Oct 24, 2023

cicheck

@Wine93
Copy link
Copy Markdown
Contributor Author

Wine93 commented Oct 24, 2023

cicheck

@Wine93 Wine93 merged commit d616bd3 into opencurve:master Oct 24, 2023
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.

4 participants