diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerName.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerName.java
deleted file mode 100644
index eb9d00bfc94..00000000000
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerName.java
+++ /dev/null
@@ -1,402 +0,0 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hadoop.hbase;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Pattern;
-
-import org.apache.hadoop.hbase.classification.InterfaceAudience;
-import org.apache.hadoop.hbase.classification.InterfaceStability;
-import org.apache.hadoop.hbase.exceptions.DeserializationException;
-import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
-import org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos;
-import org.apache.hadoop.hbase.util.Addressing;
-import org.apache.hadoop.hbase.util.Bytes;
-
-import com.google.common.net.InetAddresses;
-import com.google.protobuf.InvalidProtocolBufferException;
-
-/**
- * Instance of an HBase ServerName.
- * A server name is used uniquely identifying a server instance in a cluster and is made
- * of the combination of hostname, port, and startcode. The startcode distingushes restarted
- * servers on same hostname and port (startcode is usually timestamp of server startup). The
- * {@link #toString()} format of ServerName is safe to use in the filesystem and as znode name
- * up in ZooKeeper. Its format is:
- * <hostname> '{@link #SERVERNAME_SEPARATOR}' <port> '{@link #SERVERNAME_SEPARATOR}' <startcode>
.
- * For example, if hostname is www.example.org
, port is 1234
,
- * and the startcode for the regionserver is 1212121212
, then
- * the {@link #toString()} would be www.example.org,1234,1212121212
.
- *
- *
You can obtain a versioned serialized form of this class by calling - * {@link #getVersionedBytes()}. To deserialize, call {@link #parseVersionedServerName(byte[])} - * - *
Immutable.
- */
-@InterfaceAudience.Public
-@InterfaceStability.Evolving
-public class ServerName implements Comparable<hostname> ',' <port> ',' <startcode>
- */
- static String getServerName(String hostName, int port, long startcode) {
- final StringBuilder name = new StringBuilder(hostName.length() + 1 + 5 + 1 + 13);
- name.append(hostName);
- name.append(SERVERNAME_SEPARATOR);
- name.append(port);
- name.append(SERVERNAME_SEPARATOR);
- name.append(startcode);
- return name.toString();
- }
-
- /**
- * @param hostAndPort String in form of <hostname> ':' <port>
- * @param startcode
- * @return Server name made of the concatenation of hostname, port and
- * startcode formatted as <hostname> ',' <port> ',' <startcode>
- */
- public static String getServerName(final String hostAndPort,
- final long startcode) {
- int index = hostAndPort.indexOf(":");
- if (index <= 0) throw new IllegalArgumentException("Expected servername
- */
- public static long getServerStartcodeFromServerName(final String serverName) {
- int index = serverName.lastIndexOf(SERVERNAME_SEPARATOR);
- return Long.parseLong(serverName.substring(index + 1));
- }
-
- /**
- * Utility method to excise the start code from a server name
- * @param inServerName full server name
- * @return server name less its start code
- */
- public static String getServerNameLessStartCode(String inServerName) {
- if (inServerName != null && inServerName.length() > 0) {
- int index = inServerName.lastIndexOf(SERVERNAME_SEPARATOR);
- if (index > 0) {
- return inServerName.substring(0, index);
- }
- }
- return inServerName;
- }
-
- @Override
- public int compareTo(ServerName other) {
- int compare = this.getHostname().compareToIgnoreCase(other.getHostname());
- if (compare != 0) return compare;
- compare = this.getPort() - other.getPort();
- if (compare != 0) return compare;
- return (int)(this.getStartcode() - other.getStartcode());
- }
-
- @Override
- public int hashCode() {
- return getServerName().hashCode();
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null) return false;
- if (!(o instanceof ServerName)) return false;
- return this.compareTo((ServerName)o) == 0;
- }
-
- /**
- * @param left
- * @param right
- * @return True if other
has same hostname and port.
- */
- public static boolean isSameHostnameAndPort(final ServerName left,
- final ServerName right) {
- if (left == null) return false;
- if (right == null) return false;
- return left.getHostname().equals(right.getHostname()) &&
- left.getPort() == right.getPort();
- }
-
- /**
- * Use this method instantiating a {@link ServerName} from bytes
- * gotten from a call to {@link #getVersionedBytes()}. Will take care of the
- * case where bytes were written by an earlier version of hbase.
- * @param versionedBytes Pass bytes gotten from a call to {@link #getVersionedBytes()}
- * @return A ServerName instance.
- * @see #getVersionedBytes()
- */
- public static ServerName parseVersionedServerName(final byte [] versionedBytes) {
- // Version is a short.
- short version = Bytes.toShort(versionedBytes);
- if (version == VERSION) {
- int length = versionedBytes.length - Bytes.SIZEOF_SHORT;
- return valueOf(Bytes.toString(versionedBytes, Bytes.SIZEOF_SHORT, length));
- }
- // Presume the bytes were written with an old version of hbase and that the
- // bytes are actually a String of the form "'data
is null else converts passed data
- * to a ServerName instance.
- * @throws DeserializationException
- */
- public static ServerName parseFrom(final byte [] data) throws DeserializationException {
- if (data == null || data.length <= 0) return null;
- if (ProtobufUtil.isPBMagicPrefix(data)) {
- int prefixLen = ProtobufUtil.lengthOfPBMagic();
- try {
- ZooKeeperProtos.Master rss =
- ZooKeeperProtos.Master.PARSER.parseFrom(data, prefixLen, data.length - prefixLen);
- org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName sn = rss.getMaster();
- return valueOf(sn.getHostName(), sn.getPort(), sn.getStartCode());
- } catch (InvalidProtocolBufferException e) {
- // A failed parse of the znode is pretty catastrophic. Rather than loop
- // retrying hoping the bad bytes will changes, and rather than change
- // the signature on this method to add an IOE which will send ripples all
- // over the code base, throw a RuntimeException. This should "never" happen.
- // Fail fast if it does.
- throw new DeserializationException(e);
- }
- }
- // The str returned could be old style -- pre hbase-1502 -- which was
- // hostname and port seperated by a colon rather than hostname, port and
- // startcode delimited by a ','.
- String str = Bytes.toString(data);
- int index = str.indexOf(ServerName.SERVERNAME_SEPARATOR);
- if (index != -1) {
- // Presume its ServerName serialized with versioned bytes.
- return ServerName.parseVersionedServerName(data);
- }
- // Presume it a hostname:port format.
- String hostname = Addressing.parseHostname(str);
- int port = Addressing.parsePort(str);
- return valueOf(hostname, port, -1L);
- }
-}
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/DeserializationException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/DeserializationException.java
deleted file mode 100644
index 0ce0219831c..00000000000
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/DeserializationException.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hadoop.hbase.exceptions;
-
-import org.apache.hadoop.hbase.classification.InterfaceAudience;
-
-/**
- * Failed deserialization.
- */
-@InterfaceAudience.Private
-@SuppressWarnings("serial")
-public class DeserializationException extends HBaseException {
- public DeserializationException() {
- super();
- }
-
- public DeserializationException(final String message) {
- super(message);
- }
-
- public DeserializationException(final String message, final Throwable t) {
- super(message, t);
- }
-
- public DeserializationException(final Throwable t) {
- super(t);
- }
-}
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/HBaseException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/HBaseException.java
deleted file mode 100644
index fe0d7d70b8e..00000000000
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/HBaseException.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hadoop.hbase.exceptions;
-
-import org.apache.hadoop.hbase.classification.InterfaceAudience;
-
-/**
- * Base checked exception in HBase.
- * @see HBASE-5796
- */
-@SuppressWarnings("serial")
-@InterfaceAudience.Private
-public class HBaseException extends Exception {
- public HBaseException() {
- super();
- }
-
- public HBaseException(final String message) {
- super(message);
- }
-
- public HBaseException(final String message, final Throwable t) {
- super(message, t);
- }
-
- public HBaseException(final Throwable t) {
- super(t);
- }
-}