ivandika3 commented on code in PR #5666:
URL: https://github.com/apache/ozone/pull/5666#discussion_r1417561402
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMBlockProtocolServer.java:
##########
@@ -198,6 +201,13 @@ public List<AllocatedBlock> allocateBlock(
.allocateBlock(size, replicationConfig, owner, excludeList);
if (block != null) {
blocks.add(block);
+ // Sort the datanodes if client machine is specified
+ if (StringUtils.isNotEmpty(clientMachine)) {
+ List<String> uuidList = HddsUtils.toNodeUuid(
+ block.getPipeline().getNodes());
+ block.getPipeline().setNodesInOrder(
+ sortDatanodes(uuidList, clientMachine));
Review Comment:
Thank you for the review. I have updated it accordingly.
I also added a server-side test in `TestSCMBlockProtocolServer` to test
allocate block when client machine is specified.
--
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]