@Test public void testAdd(){ addCommandSupplier = new Supplier<Command<?>>() { @Override public Command<?> get() { return addCommand; } }; Assert.assertFalse(addCommand.isBeginExecute()); defaultKeeperStateController.addKeeper(new KeeperTransMeta(getClusterId(), getShardId(), new KeeperMeta())); sleep(50); Assert.assertTrue(addCommand.isBeginExecute()); }
@Override public void addKeeper(KeeperTransMeta keeperTransMeta) { logger.info("[addKeeper]{}", keeperTransMeta); KeeperContainerService keeperContainerService = getKeeperContainerService(keeperTransMeta); shardExecutor.execute(new Pair<>(keeperTransMeta.getClusterId(), keeperTransMeta.getShardId()), createAddKeeperCommand(keeperContainerService, keeperTransMeta, scheduled, addKeeperSuccessTimeoutMilli)); }
DefaultKeeperStateController extends AbstractLifecycle implements KeeperStateController, TopElement { @Override public void addKeeper(KeeperTransMeta keeperTransMeta) { logger.info("[addKeeper]{}", keeperTransMeta); KeeperContainerService keeperContainerService = getKeeperContainerService(keeperTransMeta); shardExecutor.execute(new Pair<>(keeperTransMeta.getClusterId(), keeperTransMeta.getShardId()), createAddKeeperCommand(keeperContainerService, keeperTransMeta, scheduled, addKeeperSuccessTimeoutMilli)); } }
DefaultKeeperStateController extends AbstractLifecycle implements KeeperStateController, TopElement { @Override public void addKeeper(KeeperTransMeta keeperTransMeta) { logger.info("[addKeeper]{}", keeperTransMeta); KeeperContainerService keeperContainerService = getKeeperContainerService(keeperTransMeta); shardExecutor.execute(new Pair<>(keeperTransMeta.getClusterId(), keeperTransMeta.getShardId()), createAddKeeperCommand(keeperContainerService, keeperTransMeta, scheduled, addKeeperSuccessTimeoutMilli)); }  }
DefaultKeeperStateController extends AbstractLifecycle implements KeeperStateController, TopElement { @Override public void addKeeper(KeeperTransMeta keeperTransMeta) { logger.info("[addKeeper]{}", keeperTransMeta); KeeperContainerService keeperContainerService = getKeeperContainerService(keeperTransMeta); shardExecutor.execute(new Pair<>(keeperTransMeta.getClusterId(), keeperTransMeta.getShardId()), createAddKeeperCommand(keeperContainerService, keeperTransMeta, scheduled, addKeeperSuccessTimeoutMilli)); }  @Override void addKeeper(KeeperTransMeta keeperTransMeta); @Override void removeKeeper(KeeperTransMeta keeperTransMeta); void setExecutors(ExecutorService executors); }
DefaultKeeperStateController extends AbstractLifecycle implements KeeperStateController, TopElement { @Override public void addKeeper(KeeperTransMeta keeperTransMeta) { logger.info("[addKeeper]{}", keeperTransMeta); KeeperContainerService keeperContainerService = getKeeperContainerService(keeperTransMeta); shardExecutor.execute(new Pair<>(keeperTransMeta.getClusterId(), keeperTransMeta.getShardId()), createAddKeeperCommand(keeperContainerService, keeperTransMeta, scheduled, addKeeperSuccessTimeoutMilli)); }  @Override void addKeeper(KeeperTransMeta keeperTransMeta); @Override void removeKeeper(KeeperTransMeta keeperTransMeta); void setExecutors(ExecutorService executors);  }