@Override
  public void setWorkFactor(double workFactor) {
    if (workFactor < MIN_WORK_FACTOR) {
      throw new IllegalArgumentException("Work factor must be >= " + MIN_WORK_FACTOR);
    }
    if (workFactor > MAX_WORK_FACTOR) {
      throw new IllegalArgumentException("Work factor must be <= " + MAX_WORK_FACTOR);
    }

    workToIdleFactor = (1.0 - workFactor) / workFactor;
  }
Executes the given command on the current thread. If throttling is enabled (the work factor
is less than 1.0) this command may optionally insert a delay before returning to satisfy the
requested work factor.
<p>
This method will not operate correctly if used by more than one thread.

@param command the work to execute
samza-core/src/main/java/org/apache/samza/util/ThrottlingExecutor.java