HBASE-22633 remove redundant substring call with append for ZKReplicationQueueStorage

Signed-off-by: Sakthi <sakthivel.azhaku@gmail.com>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
Viraj Jasani 2019-06-28 18:32:30 +05:30 committed by Peter Somogyi
parent 30ccac5108
commit e153f58937
1 changed files with 4 additions and 3 deletions

View File

@ -165,9 +165,10 @@ class ZKReplicationQueueStorage extends ZKReplicationStorageBase
"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