Ejemplo n.º 1
0
  @VisibleForTesting
  protected void restartZooKeeper(InstanceState currentInstanceState) throws Exception {
    if (currentInstanceState != null) {
      currentInstanceState.updateTimestampMs();
    }
    if (!exhibitor.getControlPanelValues().isSet(ControlPanelTypes.RESTARTS)) {
      exhibitor
          .getLog()
          .add(ActivityLog.Type.INFO, "Restart of ZooKeeper skipped due to control panel setting");
      return;
    }

    exhibitor.getActivityQueue().add(QueueGroups.MAIN, new KillRunningInstance(exhibitor, true));
  }
Ejemplo n.º 2
0
  public MonitorRunningInstance(Exhibitor exhibitor) {
    this.exhibitor = exhibitor;
    Activity activity =
        new Activity() {
          @Override
          public void completed(boolean wasSuccessful) {
            // NOP
          }

          @Override
          public Boolean call() throws Exception {
            doWork();
            return true;
          }
        };

    repeatingActivity =
        new RepeatingActivity(
            exhibitor.getLog(),
            exhibitor.getActivityQueue(),
            QueueGroups.MAIN,
            activity,
            exhibitor.getConfigManager().getConfig().getInt(IntConfigs.CHECK_MS));
  }