/** * Get the number of roles we are short of. * nodes released are ignored. * @return the positive or negative number of roles to add/release. * 0 means "do nothing". */ public long getDelta() { long inuse = getActualAndRequested(); long delta = desired.get() - inuse; if (delta < 0) { //if we are releasing, remove the number that are already released. delta += releasing.get(); //but never switch to a positive delta = Math.min(delta, 0); } return delta; }
/** * Get the number of roles we are short of. * nodes released are ignored. * @return the positive or negative number of roles to add/release. * 0 means "do nothing". */ public long getDelta() { long inuse = getActualAndRequested(); long delta = desired.get() - inuse; if (delta < 0) { //if we are releasing, remove the number that are already released. delta += releasing.get(); //but never switch to a positive delta = Math.min(delta, 0); } return delta; }