private synchronized void adjustBlockTotals(int deltaSafe, int deltaTotal) { if (!shouldIncrementallyTrackBlocks) { return; } assert haEnabled; if (LOG.isDebugEnabled()) { LOG.debug("Adjusting block totals from " + blockSafe + "/" + blockTotal + " to " + (blockSafe + deltaSafe) + "/" + (blockTotal + deltaTotal)); } assert blockSafe + deltaSafe >= 0 : "Can't reduce blockSafe " + blockSafe + " by " + deltaSafe + ": would be negative"; assert blockTotal + deltaTotal >= 0 : "Can't reduce blockTotal " + blockTotal + " by " + deltaTotal + ": would be negative"; blockSafe += deltaSafe; setBlockTotal(blockTotal + deltaTotal); } }
private synchronized void adjustBlockTotals(int deltaSafe, int deltaTotal) { if (!shouldIncrementallyTrackBlocks) { return; } assert haEnabled; if (LOG.isDebugEnabled()) { LOG.debug("Adjusting block totals from " + blockSafe + "/" + blockTotal + " to " + (blockSafe + deltaSafe) + "/" + (blockTotal + deltaTotal)); } assert blockSafe + deltaSafe >= 0 : "Can't reduce blockSafe " + blockSafe + " by " + deltaSafe + ": would be negative"; assert blockTotal + deltaTotal >= 0 : "Can't reduce blockTotal " + blockTotal + " by " + deltaTotal + ": would be negative"; blockSafe += deltaSafe; setBlockTotal(blockTotal + deltaTotal); } }
/** * Set the total number of blocks in the system. */ void setBlockTotal() { if (safeMode == null) return; safeMode.setBlockTotal(blocksMap.size()); }