hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chia7...@apache.org
Subject hbase git commit: HBASE-18783 Declare the builder of ClusterStatus as IA.Private, and remove the Writables from ClusterStatus
Date Sat, 09 Sep 2017 07:59:28 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-2 6970c1e9e -> 26b009f1d


HBASE-18783 Declare the builder of ClusterStatus as IA.Private, and remove the Writables from
ClusterStatus


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/26b009f1
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/26b009f1
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/26b009f1

Branch: refs/heads/branch-2
Commit: 26b009f1d101ab3a73d6e262d911ee0d177a0055
Parents: 6970c1e
Author: Chia-Ping Tsai <chia7712@gmail.com>
Authored: Sat Sep 9 04:39:57 2017 +0800
Committer: Chia-Ping Tsai <chia7712@gmail.com>
Committed: Sat Sep 9 15:55:21 2017 +0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/ClusterStatus.java  | 29 ++++++++------------
 1 file changed, 12 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/26b009f1/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java
index d12ad0d..c116bb4 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java
@@ -27,11 +27,9 @@ import java.util.Map;
 
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.master.RegionState;
-import org.apache.hadoop.io.VersionedWritable;
 
 import com.google.common.base.Objects;
 
-
 /**
  * Status information on the HBase cluster.
  * <p>
@@ -70,17 +68,9 @@ import com.google.common.base.Objects;
  * </pre>
  */
 @InterfaceAudience.Public
-public class ClusterStatus extends VersionedWritable {
-  /**
-   * Version for object serialization.  Incremented for changes in serialized
-   * representation.
-   * <dl>
-   *   <dt>0</dt> <dd>Initial version</dd>
-   *   <dt>1</dt> <dd>Added cluster ID</dd>
-   *   <dt>2</dt> <dd>Added Map of ServerName to ServerLoad</dd>
-   *   <dt>3</dt> <dd>Added master and backupMasters</dd>
-   * </dl>
-   */
+public class ClusterStatus {
+
+  // TODO: remove this in 3.0
   private static final byte VERSION = 2;
 
   private String hbaseVersion;
@@ -209,8 +199,7 @@ public class ClusterStatus extends VersionedWritable {
     }
     ClusterStatus other = (ClusterStatus) o;
     //TODO Override the equals() methods in ServerLoad.
-    return (getVersion() == other.getVersion()) &&
-      Objects.equal(getHBaseVersion(), other.getHBaseVersion()) &&
+    return Objects.equal(getHBaseVersion(), other.getHBaseVersion()) &&
       Objects.equal(this.liveServers, other.liveServers) &&
       getDeadServerNames().containsAll(other.getDeadServerNames()) &&
       Arrays.equals(getMasterCoprocessors(), other.getMasterCoprocessors()) &&
@@ -222,11 +211,16 @@ public class ClusterStatus extends VersionedWritable {
    * @see java.lang.Object#hashCode()
    */
   public int hashCode() {
-    return VERSION + Objects.hashCode(hbaseVersion, liveServers, deadServers,
+    return Objects.hashCode(hbaseVersion, liveServers, deadServers,
       master, backupMasters);
   }
 
-  /** @return the object version number */
+  /**
+   *
+   * @return the object version number
+   * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
+   */
+  @Deprecated
   public byte getVersion() {
     return VERSION;
   }
@@ -369,6 +363,7 @@ public class ClusterStatus extends VersionedWritable {
   /**
    * Builder for construct a ClusterStatus.
    */
+  @InterfaceAudience.Private
   public static class Builder {
     private String hbaseVersion = null;
     private Map<ServerName, ServerLoad> liveServers = null;


Mime
View raw message