-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
HDFS-17496. DataNode supports more fine-grained dataset lock based on blockid. #7280
base: trunk
Are you sure you want to change the base?
Conversation
@Hexiaoqiao @kokon191 @slfan1989 Sir, have updated. We can discuss the new implementation here, thanks a lot. |
💔 -1 overall
This message was automatically generated. |
c95ba06
to
fc61ca4
Compare
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
@Hexiaoqiao Thanks, Sir. have rebuilded this PR and all checks were passed. |
*/ | ||
public static String idToBlockDirSuffixName(long blockId) { | ||
int d1 = (int) ((blockId >> 16) & 0x1F); | ||
int d2 = (int) ((blockId >> 8) & 0x1F); |
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 do we explain the operation blockId >> 16
and blockId >> 8
here? Do you mean the same way with idToBlockDir
? If that, I think it is better to use the common method to implement it.
+ public static String idToBlockDirSuffix(long blockId) {
+ int d1 = (int) ((blockId >> 16) & 0x1F);
+ int d2 = (int) ((blockId >> 8) & 0x1F);
+ return DataStorage.BLOCK_SUBDIR_PREFIX + d1 + SEP +
+ DataStorage.BLOCK_SUBDIR_PREFIX + d2;
+ }
+
/**
* Get the directory where a finalized block with this ID should be stored.
* Do not attempt to create the directory.
@@ -120,10 +127,7 @@ public static boolean dirNoFilesRecursive(
* @return
*/
public static File idToBlockDir(File root, long blockId) {
- int d1 = (int) ((blockId >> 16) & 0x1F);
- int d2 = (int) ((blockId >> 8) & 0x1F);
- String path = DataStorage.BLOCK_SUBDIR_PREFIX + d1 + SEP +
- DataStorage.BLOCK_SUBDIR_PREFIX + d2;
+ String path = idToBlockDirSuffix(blockId);
return new File(root, 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.
@Hexiaoqiao yes, blockId >> 16
and blockId >> 8
are the the same way with idToBlockDir
.
Have refactor those methods and make literal 0x1F
to be a static final field in DatanodeUtil.
Thanks a lot for your suggestions.
*/ | ||
String blockIdToSubLock(long blockid); | ||
|
||
List<String> getAllSubLockName(); |
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.
Name
-> Names
...s-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DatanodeUtil.java
Outdated
Show resolved
Hide resolved
...s-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DatanodeUtil.java
Outdated
Show resolved
Hide resolved
...ject/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/DataNodeLockManager.java
Show resolved
Hide resolved
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
@aajisaka Sir, could you please help me solve this problem? Thanks. |
5e370fc
to
413a9bd
Compare
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
@Hexiaoqiao @slfan1989 @ayushtkn @aajisaka Sir, we meet build problems here. PTAL, thanks a lot. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.0.1:javadoc-no-fork (default-cli) on project hadoop-hdfs: An error has occurred in Javadoc report generation:
[ERROR] Exit code: 1 - javadoc: warning - The code being documented uses modules but the packages defined in https://docs.oracle.com/javase/8/docs/api/ are in the unnamed module. |
💔 -1 overall
This message was automatically generated. |
Description of PR
More detailed infomation please refer to #6764
Major differences from origin are below:
1、 Remove class ModDataSetSubLockStrategy and add a new class DataNodeLayoutSubLockStrategy
2、Add util methods in DatanodeUtil.
3、Add javadoc for method DatanodeUtil#idToBlockDir.