Skip to content

Commit

Permalink
HBASE-22633 remove redundant substring call with append for ZKReplica…
Browse files Browse the repository at this point in the history
…tionQueueStorage

Signed-off-by: Sakthi <[email protected]>
Signed-off-by: Duo Zhang <[email protected]>
  • Loading branch information
virajjasani authored and petersomogyi committed Jun 28, 2019
1 parent b20044c commit 0c8dc5d
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,10 @@ String getSerialReplicationRegionPeerNode(String encodedRegionName, String peerI
"Invalid encoded region name: " + encodedRegionName + ", length should be 32.");
}
return new StringBuilder(regionsZNode).append(ZNodePaths.ZNODE_PATH_SEPARATOR)
.append(encodedRegionName.substring(0, 2)).append(ZNodePaths.ZNODE_PATH_SEPARATOR)
.append(encodedRegionName.substring(2, 4)).append(ZNodePaths.ZNODE_PATH_SEPARATOR)
.append(encodedRegionName.substring(4)).append("-").append(peerId).toString();
.append(encodedRegionName, 0, 2).append(ZNodePaths.ZNODE_PATH_SEPARATOR)
.append(encodedRegionName, 2, 4).append(ZNodePaths.ZNODE_PATH_SEPARATOR)
.append(encodedRegionName, 4, encodedRegionName.length()).append("-").append(peerId)
.toString();
}

@Override
Expand Down

0 comments on commit 0c8dc5d

Please sign in to comment.