You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ch...@apache.org on 2017/09/09 07:59:13 UTC

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

Repository: hbase
Updated Branches:
  refs/heads/master d782ae820 -> 64fe24e68


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/64fe24e6
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/64fe24e6
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/64fe24e6

Branch: refs/heads/master
Commit: 64fe24e687a7255f0d2867625b62c6ba7737c5d5
Parents: d782ae8
Author: Chia-Ping Tsai <ch...@gmail.com>
Authored: Sat Sep 9 04:39:57 2017 +0800
Committer: Chia-Ping Tsai <ch...@gmail.com>
Committed: Sat Sep 9 15:51:32 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/64fe24e6/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;