code: private synchronized void changeInstances(String flowletId, int newInstanceCount, int oldInstanceCount)
      throws Exception {
      instanceUpdater.update(flowletId, newInstanceCount, oldInstanceCount);
    }
docs: Change the number of instances of the running flowlet. Notice that this method needs to be
  synchronized as change of instances involves multiple steps that need to be completed all at once.
  @param flowletId Name of the flowlet.
  @param newInstanceCount New instance count.
  @param oldInstanceCount Old instance count.
  @throws java.util.concurrent.ExecutionException
  @throws InterruptedException