|
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.HashSet; |
28 | 27 | import java.util.List; |
29 | 28 | import java.util.Map; |
@@ -124,12 +123,6 @@ public class ServerManager { |
124 | 123 | private final ConcurrentNavigableMap<ServerName, ServerMetrics> onlineServers = |
125 | 124 | new ConcurrentSkipListMap<>(); |
126 | 125 |
|
127 | | - /** |
128 | | - * Map of admin interfaces per registered regionserver; these interfaces we use to control |
129 | | - * regionservers out on the cluster |
130 | | - */ |
131 | | - private final Map<ServerName, AdminService.BlockingInterface> rsAdmins = new HashMap<>(); |
132 | | - |
133 | 126 | /** List of region servers that should not get any more new regions. */ |
134 | 127 | private final ArrayList<ServerName> drainingServers = new ArrayList<>(); |
135 | 128 |
|
@@ -402,7 +395,6 @@ public ServerName findServerWithSameHostnamePortWithLock(final ServerName server |
402 | 395 | void recordNewServerWithLock(final ServerName serverName, final ServerMetrics sl) { |
403 | 396 | LOG.info("Registering regionserver=" + serverName); |
404 | 397 | this.onlineServers.put(serverName, sl); |
405 | | - this.rsAdmins.remove(serverName); |
406 | 398 | } |
407 | 399 |
|
408 | 400 | public RegionStoreSequenceIds getLastFlushedSequenceId(byte[] encodedRegionName) { |
@@ -604,7 +596,6 @@ public synchronized void moveFromOnlineToDeadServers(final ServerName sn) { |
604 | 596 | LOG.trace("Expiration of {} but server not online", sn); |
605 | 597 | } |
606 | 598 | } |
607 | | - this.rsAdmins.remove(sn); |
608 | 599 | } |
609 | 600 |
|
610 | 601 | /* |
@@ -716,18 +707,13 @@ public static void closeRegionSilentlyAndWait(ClusterConnection connection, Serv |
716 | 707 | * @throws RetriesExhaustedException wrapping a ConnectException if failed |
717 | 708 | */ |
718 | 709 | public AdminService.BlockingInterface getRsAdmin(final ServerName sn) throws IOException { |
719 | | - AdminService.BlockingInterface admin = this.rsAdmins.get(sn); |
720 | | - if (admin == null) { |
721 | | - LOG.debug("New admin connection to " + sn.toString()); |
722 | | - if (sn.equals(master.getServerName()) && master instanceof HRegionServer) { |
723 | | - // A master is also a region server now, see HBASE-10569 for details |
724 | | - admin = ((HRegionServer) master).getRSRpcServices(); |
725 | | - } else { |
726 | | - admin = this.connection.getAdmin(sn); |
727 | | - } |
728 | | - this.rsAdmins.put(sn, admin); |
| 710 | + LOG.debug("New admin connection to {}", sn); |
| 711 | + if (sn.equals(master.getServerName()) && master instanceof HRegionServer) { |
| 712 | + // A master is also a region server now, see HBASE-10569 for details |
| 713 | + return ((HRegionServer) master).getRSRpcServices(); |
| 714 | + } else { |
| 715 | + return this.connection.getAdmin(sn); |
729 | 716 | } |
730 | | - return admin; |
731 | 717 | } |
732 | 718 |
|
733 | 719 | /** |
|
0 commit comments