@Override
  public void start() {
    synchronized (lock) {
      switch (state) {
        case INIT:
          schedulerService.scheduleAtFixedRate(new Runnable() {
            @Override
            public void run() {
              updateSample();
            }
          }, pollingIntervalMillis, pollingIntervalMillis, TimeUnit.MILLISECONDS);

          state = State.RUNNING;
          break;

        case RUNNING:
          // start is idempotent
          return;

        case STOPPED:
          throw new IllegalStateException("PollingScanDiskSpaceMonitor was stopped and cannot be restarted.");
      }
    }
  }
Creates a new disk space monitor that uses a periodic polling mechanism.

@param watchPaths the set of paths to watch
@param pollingIntervalMillis the polling interval in milliseconds
samza-core/src/main/java/org/apache/samza/container/disk/PollingScanDiskSpaceMonitor.java