@Test public void testForAdjust() { adjuster.work(); Mockito.verify(peerMasterAdjustJobFactory, Mockito.times(1)).buildPeerMasterAdjustJob(clusterId, shardId); Mockito.verify(peerMasterAdjustExecutor, Mockito.times(1)).execute(Pair.of(clusterId, shardId), job); }
@Override protected void work() { if (!config.shouldCorrectPeerMasterPeriodically()) return; PeerMasterAdjustJob adjustJob = peerMasterAdjustJobFactory.buildPeerMasterAdjustJob(clusterId, shardId); if (null != adjustJob) peerMasterAdjustExecutor.execute(Pair.of(clusterId, shardId), adjustJob); }
DefaultPeerMasterStateAdjuster extends AbstractClusterShardPeriodicTask implements PeerMasterStateAdjuster { @Override protected void work() { if (!config.shouldCorrectPeerMasterPeriodically()) return; PeerMasterAdjustJob adjustJob = peerMasterAdjustJobFactory.buildPeerMasterAdjustJob(clusterId, shardId); if (null != adjustJob) peerMasterAdjustExecutor.execute(Pair.of(clusterId, shardId), adjustJob); } }
DefaultPeerMasterStateAdjuster extends AbstractClusterShardPeriodicTask implements PeerMasterStateAdjuster { @Override protected void work() { if (!config.shouldCorrectPeerMasterPeriodically()) return; PeerMasterAdjustJob adjustJob = peerMasterAdjustJobFactory.buildPeerMasterAdjustJob(clusterId, shardId); if (null != adjustJob) peerMasterAdjustExecutor.execute(Pair.of(clusterId, shardId), adjustJob); } DefaultPeerMasterStateAdjuster(String clusterId, String shardId, DcMetaCache dcMetaCache, CurrentMetaManager currentMetaManager,
                                          MetaServerConfig config, PeerMasterAdjustJobFactory peerMasterAdjustJobFactory,
                                          KeyedOneThreadTaskExecutor<Pair<String, String> > peerMasterAdjustExecutor,
                                          ScheduledExecutorService scheduled);  DefaultPeerMasterStateAdjuster(String clusterId, String shardId, DcMetaCache dcMetaCache, CurrentMetaManager currentMetaManager,
                                          MetaServerConfig config, PeerMasterAdjustJobFactory peerMasterAdjustJobFactory,
                                          KeyedOneThreadTaskExecutor<Pair<String, String> > peerMasterAdjustExecutor,
                                          ScheduledExecutorService scheduled, int adjustIntervalSeconds); }
DefaultPeerMasterStateAdjuster extends AbstractClusterShardPeriodicTask implements PeerMasterStateAdjuster { @Override protected void work() { if (!config.shouldCorrectPeerMasterPeriodically()) return; PeerMasterAdjustJob adjustJob = peerMasterAdjustJobFactory.buildPeerMasterAdjustJob(clusterId, shardId); if (null != adjustJob) peerMasterAdjustExecutor.execute(Pair.of(clusterId, shardId), adjustJob); } DefaultPeerMasterStateAdjuster(String clusterId, String shardId, DcMetaCache dcMetaCache, CurrentMetaManager currentMetaManager,
                                          MetaServerConfig config, PeerMasterAdjustJobFactory peerMasterAdjustJobFactory,
                                          KeyedOneThreadTaskExecutor<Pair<String, String> > peerMasterAdjustExecutor,
                                          ScheduledExecutorService scheduled);  DefaultPeerMasterStateAdjuster(String clusterId, String shardId, DcMetaCache dcMetaCache, CurrentMetaManager currentMetaManager,
                                          MetaServerConfig config, PeerMasterAdjustJobFactory peerMasterAdjustJobFactory,
                                          KeyedOneThreadTaskExecutor<Pair<String, String> > peerMasterAdjustExecutor,
                                          ScheduledExecutorService scheduled, int adjustIntervalSeconds);  }
DefaultPeerMasterStateAdjuster extends AbstractClusterShardPeriodicTask implements PeerMasterStateAdjuster { @Override protected void work() { if (!config.shouldCorrectPeerMasterPeriodically()) return; PeerMasterAdjustJob adjustJob = peerMasterAdjustJobFactory.buildPeerMasterAdjustJob(clusterId, shardId); if (null != adjustJob) peerMasterAdjustExecutor.execute(Pair.of(clusterId, shardId), adjustJob); } DefaultPeerMasterStateAdjuster(String clusterId, String shardId, DcMetaCache dcMetaCache, CurrentMetaManager currentMetaManager,
                                          MetaServerConfig config, PeerMasterAdjustJobFactory peerMasterAdjustJobFactory,
                                          KeyedOneThreadTaskExecutor<Pair<String, String> > peerMasterAdjustExecutor,
                                          ScheduledExecutorService scheduled);  DefaultPeerMasterStateAdjuster(String clusterId, String shardId, DcMetaCache dcMetaCache, CurrentMetaManager currentMetaManager,
                                          MetaServerConfig config, PeerMasterAdjustJobFactory peerMasterAdjustJobFactory,
                                          KeyedOneThreadTaskExecutor<Pair<String, String> > peerMasterAdjustExecutor,
                                          ScheduledExecutorService scheduled, int adjustIntervalSeconds);  static final int DEFAULT_PEER_MASTER_ADJUST_INTERVAL_SECONDS; }