You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ps...@apache.org on 2019/06/28 13:08:49 UTC

[hbase] branch branch-2.1 updated: HBASE-22633 remove redundant substring call with append for ZKReplicationQueueStorage

This is an automated email from the ASF dual-hosted git repository.

psomogyi pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 085ea6f  HBASE-22633 remove redundant substring call with append for ZKReplicationQueueStorage
085ea6f is described below

commit 085ea6f219ab25552f393e9b3dadc9cec9d69bb3
Author: Viraj Jasani <vi...@gmail.com>
AuthorDate: Fri Jun 28 18:32:30 2019 +0530

    HBASE-22633 remove redundant substring call with append for ZKReplicationQueueStorage
    
    Signed-off-by: Sakthi <sa...@gmail.com>
    Signed-off-by: Duo Zhang <zh...@apache.org>
---
 .../apache/hadoop/hbase/replication/ZKReplicationQueueStorage.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ZKReplicationQueueStorage.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ZKReplicationQueueStorage.java
index 3854753..6f1f5a3 100644
--- a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ZKReplicationQueueStorage.java
+++ b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ZKReplicationQueueStorage.java
@@ -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