public int getMaxToClaim(int nodeCount) {
       synchronized (cluster.allWorkUnits) {
           final int total = cluster.allWorkUnits.size();
           if (total <= 1) {
               return total;
           }
           return (int) Math.ceil(total / (double) nodeCount);
       }
   }
public int getMaxToClaim ( int nodeCount ) { synchronized ( cluster . allWorkUnits ) { final int total = cluster . allWorkUnits . size ( ) ; if ( total <= 1 ) { return total ; } return ( int ) Math . ceil ( total / ( double ) nodeCount ) ; } }
Determines the maximum number of work units the policy should attempt to claim.