private synchronized void changeInstances ( String flowletId , int newInstanceCount , int oldInstanceCount ) throws Exception { instanceUpdater . update ( flowletId , newInstanceCount , oldInstanceCount ) ; }
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 .