kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdcry...@apache.org
Subject kudu git commit: KUDU-2058. Fix LocatedTablet string comparisons
Date Tue, 25 Jul 2017 21:39:19 GMT
Repository: kudu
Updated Branches:
  refs/heads/master be8e3c22b -> 0fe3a288d


KUDU-2058. Fix LocatedTablet string comparisons

Fixed LocatedTablet string comparison with enum comparison.

Change-Id: If1926f84a79fed80ab5e72fa0fbf4aa450906643
Reviewed-on: http://gerrit.cloudera.org:8080/7500
Tested-by: Kudu Jenkins
Reviewed-by: Jean-Daniel Cryans <jdcryans@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/0fe3a288
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/0fe3a288
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/0fe3a288

Branch: refs/heads/master
Commit: 0fe3a288d63a1b49cc615ec1346fcaef7a17b7c7
Parents: be8e3c2
Author: SriSaiKumar-Inspur <srisaikumarr@gmail.com>
Authored: Sat Jul 22 09:00:18 2017 -0700
Committer: Jean-Daniel Cryans <jdcryans@apache.org>
Committed: Tue Jul 25 21:39:03 2017 +0000

----------------------------------------------------------------------
 .../src/main/java/org/apache/kudu/client/LocatedTablet.java    | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/0fe3a288/java/kudu-client/src/main/java/org/apache/kudu/client/LocatedTablet.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/main/java/org/apache/kudu/client/LocatedTablet.java b/java/kudu-client/src/main/java/org/apache/kudu/client/LocatedTablet.java
index 60c9ec4..d56129b 100644
--- a/java/kudu-client/src/main/java/org/apache/kudu/client/LocatedTablet.java
+++ b/java/kudu-client/src/main/java/org/apache/kudu/client/LocatedTablet.java
@@ -87,7 +87,7 @@ public class LocatedTablet {
    */
   private Replica getOneOfRoleOrNull(Role role) {
     for (Replica r : replicas) {
-      if (r.getRole() == role.toString()) {
+      if (r.getRoleAsEnum().equals(role)) {
         return r;
       }
     }
@@ -125,6 +125,10 @@ public class LocatedTablet {
       return pb.getTsInfo().getRpcAddressesList().get(0).getPort();
     }
 
+    public Role getRoleAsEnum() {
+      return pb.getRole();
+    }
+
     public String getRole() {
       return pb.getRole().toString();
     }


Mime
View raw message