|
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 |
|
@@ -397,7 +390,6 @@ private ServerName findServerWithSameHostnamePortWithLock(final ServerName serve |
397 | 390 | void recordNewServerWithLock(final ServerName serverName, final ServerMetrics sl) { |
398 | 391 | LOG.info("Registering regionserver=" + serverName); |
399 | 392 | this.onlineServers.put(serverName, sl); |
400 | | - this.rsAdmins.remove(serverName); |
401 | 393 | } |
402 | 394 |
|
403 | 395 | public RegionStoreSequenceIds getLastFlushedSequenceId(byte[] encodedRegionName) { |
@@ -599,7 +591,6 @@ public synchronized void moveFromOnlineToDeadServers(final ServerName sn) { |
599 | 591 | LOG.trace("Expiration of {} but server not online", sn); |
600 | 592 | } |
601 | 593 | } |
602 | | - this.rsAdmins.remove(sn); |
603 | 594 | } |
604 | 595 |
|
605 | 596 | /* |
@@ -711,18 +702,13 @@ public static void closeRegionSilentlyAndWait(ClusterConnection connection, Serv |
711 | 702 | * @throws RetriesExhaustedException wrapping a ConnectException if failed |
712 | 703 | */ |
713 | 704 | public AdminService.BlockingInterface getRsAdmin(final ServerName sn) throws IOException { |
714 | | - AdminService.BlockingInterface admin = this.rsAdmins.get(sn); |
715 | | - if (admin == null) { |
716 | | - LOG.debug("New admin connection to " + sn.toString()); |
717 | | - if (sn.equals(master.getServerName()) && master instanceof HRegionServer) { |
718 | | - // A master is also a region server now, see HBASE-10569 for details |
719 | | - admin = ((HRegionServer) master).getRSRpcServices(); |
720 | | - } else { |
721 | | - admin = this.connection.getAdmin(sn); |
722 | | - } |
723 | | - this.rsAdmins.put(sn, admin); |
| 705 | + LOG.debug("New admin connection to {}", sn); |
| 706 | + if (sn.equals(master.getServerName()) && master instanceof HRegionServer) { |
| 707 | + // A master is also a region server now, see HBASE-10569 for details |
| 708 | + return ((HRegionServer) master).getRSRpcServices(); |
| 709 | + } else { |
| 710 | + return this.connection.getAdmin(sn); |
724 | 711 | } |
725 | | - return admin; |
726 | 712 | } |
727 | 713 |
|
728 | 714 | /** |
|
0 commit comments