|
23 | 23 | import java.net.InetAddress; |
24 | 24 | import java.util.ArrayList; |
25 | 25 | import java.util.Collections; |
26 | | -import java.util.HashMap; |
27 | 26 | import java.util.List; |
28 | 27 | import java.util.Map; |
29 | 28 | import java.util.Map.Entry; |
|
44 | 43 | import org.apache.hadoop.hbase.YouAreDeadException; |
45 | 44 | import org.apache.hadoop.hbase.client.ClusterConnection; |
46 | 45 | import org.apache.hadoop.hbase.client.RegionInfo; |
| 46 | +import org.apache.hadoop.hbase.client.RetriesExhaustedException; |
47 | 47 | import org.apache.hadoop.hbase.ipc.HBaseRpcController; |
48 | 48 | import org.apache.hadoop.hbase.ipc.RemoteWithExtrasException; |
49 | 49 | import org.apache.hadoop.hbase.ipc.RpcControllerFactory; |
@@ -123,12 +123,6 @@ public class ServerManager { |
123 | 123 | private final ConcurrentNavigableMap<ServerName, ServerMetrics> onlineServers = |
124 | 124 | new ConcurrentSkipListMap<>(); |
125 | 125 |
|
126 | | - /** |
127 | | - * Map of admin interfaces per registered regionserver; these interfaces we use to control |
128 | | - * regionservers out on the cluster |
129 | | - */ |
130 | | - private final Map<ServerName, AdminService.BlockingInterface> rsAdmins = new HashMap<>(); |
131 | | - |
132 | 126 | /** List of region servers that should not get any more new regions. */ |
133 | 127 | private final ArrayList<ServerName> drainingServers = new ArrayList<>(); |
134 | 128 |
|
@@ -393,7 +387,6 @@ private ServerName findServerWithSameHostnamePortWithLock(final ServerName serve |
393 | 387 | void recordNewServerWithLock(final ServerName serverName, final ServerMetrics sl) { |
394 | 388 | LOG.info("Registering regionserver=" + serverName); |
395 | 389 | this.onlineServers.put(serverName, sl); |
396 | | - this.rsAdmins.remove(serverName); |
397 | 390 | } |
398 | 391 |
|
399 | 392 | public RegionStoreSequenceIds getLastFlushedSequenceId(byte[] encodedRegionName) { |
@@ -595,7 +588,6 @@ public synchronized void moveFromOnlineToDeadServers(final ServerName sn) { |
595 | 588 | LOG.trace("Expiration of {} but server not online", sn); |
596 | 589 | } |
597 | 590 | } |
598 | | - this.rsAdmins.remove(sn); |
599 | 591 | } |
600 | 592 |
|
601 | 593 | /* |
@@ -707,18 +699,13 @@ public static void closeRegionSilentlyAndWait(ClusterConnection connection, Serv |
707 | 699 | * @throws RetriesExhaustedException wrapping a ConnectException if failed |
708 | 700 | */ |
709 | 701 | public AdminService.BlockingInterface getRsAdmin(final ServerName sn) throws IOException { |
710 | | - AdminService.BlockingInterface admin = this.rsAdmins.get(sn); |
711 | | - if (admin == null) { |
712 | | - LOG.debug("New admin connection to " + sn.toString()); |
713 | | - if (sn.equals(master.getServerName()) && master instanceof HRegionServer) { |
714 | | - // A master is also a region server now, see HBASE-10569 for details |
715 | | - admin = ((HRegionServer) master).getRSRpcServices(); |
716 | | - } else { |
717 | | - admin = this.connection.getAdmin(sn); |
718 | | - } |
719 | | - this.rsAdmins.put(sn, admin); |
| 702 | + LOG.debug("New admin connection to {}", sn); |
| 703 | + if (sn.equals(master.getServerName()) && master instanceof HRegionServer) { |
| 704 | + // A master is also a region server now, see HBASE-10569 for details |
| 705 | + return ((HRegionServer) master).getRSRpcServices(); |
| 706 | + } else { |
| 707 | + return this.connection.getAdmin(sn); |
720 | 708 | } |
721 | | - return admin; |
722 | 709 | } |
723 | 710 |
|
724 | 711 | /** |
|
0 commit comments