@Test public void testReportBadSink() { ServerName serverNameA = mock(ServerName.class); ServerName serverNameB = mock(ServerName.class); when(replicationPeers.getRegionServersOfConnectedPeer(PEER_CLUSTER_ID)).thenReturn( Lists.newArrayList(serverNameA, serverNameB)); sinkManager.chooseSinks(); assertEquals(1, sinkManager.getSinks().size()); SinkPeer sinkPeer = new SinkPeer(serverNameA, mock(AdminService.BlockingInterface.class)); sinkManager.reportBadSink(sinkPeer); assertEquals(1, sinkManager.getSinks().size()); }
public void reportBadSink(SinkPeer sinkPeer) { ServerName serverName = sinkPeer.getServerName(); int badReportCount = (badReportCounts.containsKey(serverName) ? badReportCounts.get(serverName) : 0) + 1; badReportCounts.put(serverName, badReportCount); if (badReportCount > badSinkThreshold) { this.sinks.remove(serverName); if (sinks.isEmpty()) { chooseSinks(); } } }
ReplicationSinkManager { public void reportBadSink(SinkPeer sinkPeer) { ServerName serverName = sinkPeer.getServerName(); int badReportCount = (badReportCounts.containsKey(serverName) ? badReportCounts.get(serverName) : 0) + 1; badReportCounts.put(serverName, badReportCount); if (badReportCount > badSinkThreshold) { this.sinks.remove(serverName); if (sinks.isEmpty()) { chooseSinks(); } } } }
ReplicationSinkManager { public void reportBadSink(SinkPeer sinkPeer) { ServerName serverName = sinkPeer.getServerName(); int badReportCount = (badReportCounts.containsKey(serverName) ? badReportCounts.get(serverName) : 0) + 1; badReportCounts.put(serverName, badReportCount); if (badReportCount > badSinkThreshold) { this.sinks.remove(serverName); if (sinks.isEmpty()) { chooseSinks(); } } } ReplicationSinkManager(HConnection conn, String peerClusterId,
      ReplicationPeers replicationPeers, Configuration conf); }
ReplicationSinkManager { public void reportBadSink(SinkPeer sinkPeer) { ServerName serverName = sinkPeer.getServerName(); int badReportCount = (badReportCounts.containsKey(serverName) ? badReportCounts.get(serverName) : 0) + 1; badReportCounts.put(serverName, badReportCount); if (badReportCount > badSinkThreshold) { this.sinks.remove(serverName); if (sinks.isEmpty()) { chooseSinks(); } } } ReplicationSinkManager(HConnection conn, String peerClusterId,
      ReplicationPeers replicationPeers, Configuration conf); SinkPeer getReplicationSink(); void reportBadSink(SinkPeer sinkPeer); }
ReplicationSinkManager { public void reportBadSink(SinkPeer sinkPeer) { ServerName serverName = sinkPeer.getServerName(); int badReportCount = (badReportCounts.containsKey(serverName) ? badReportCounts.get(serverName) : 0) + 1; badReportCounts.put(serverName, badReportCount); if (badReportCount > badSinkThreshold) { this.sinks.remove(serverName); if (sinks.isEmpty()) { chooseSinks(); } } } ReplicationSinkManager(HConnection conn, String peerClusterId,
      ReplicationPeers replicationPeers, Configuration conf); SinkPeer getReplicationSink(); void reportBadSink(SinkPeer sinkPeer);  }