adoroszlai commented on code in PR #11617:
URL: https://github.com/apache/ozone/pull/11617#discussion_r4625347777
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMBlockProtocolServer.java:
##########
@@ -235,12 +238,15 @@ public List<AllocatedBlock> allocateBlock(
num, size, excludeList);
}
try {
+ final Node client = getClientNode(clientMachine);
+ final DatanodeDetails localDatanode = preferClientLocalPipeline &&
client instanceof DatanodeDetails
+ ? (DatanodeDetails) client : null;
for (int i = 0; i < num; i++) {
- AllocatedBlock block = scm.getScmBlockManager()
- .allocateBlock(size, replicationConfig, owner, excludeList);
+ AllocatedBlock block = localDatanode == null
+ ? scm.getScmBlockManager().allocateBlock(size, replicationConfig,
owner, excludeList)
+ : scm.getScmBlockManager().allocateBlock(size, replicationConfig,
owner, excludeList, localDatanode);
Review Comment:
This can call `allocateBlock(size, replicationConfig, owner, excludeList,
localDatanode)` unconditionally, since passing `null` is the same as:
https://github.com/apache/ozone/blob/9ae9896c501c8fadeb675bfe82a78e9ab8f0517d/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/BlockManagerImpl.java#L151
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/ScmConfig.java:
##########
@@ -102,6 +102,17 @@ public class ScmConfig extends ReconfigurableConfig {
)
private String ecPipelineChoosePolicyName;
+ @Config(key = "hdds.scm.block.allocation.prefer.client.local",
Review Comment:
Why do we need a config?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]