public void removeConnection() { numActiveConnections.decrement(); }
private void unregisterPendingPreemption(String host) { writeLock.lock(); try { pendingPreemptions.decrementAndGet(); if (metrics != null) { metrics.decrPendingPreemptionTasksCount(); } MutableInt val = pendingPreemptionsPerHost.get(host); Preconditions.checkNotNull(val); val.decrement(); // Not bothering with removing the entry. There's a limited number of hosts, and a good // chance that the entry will make it back in when the AM is used for a long duration. } finally { writeLock.unlock(); } }
waitingFor.decrement(); waitingForMonitor.notifyAll();
@Override public FileList answer(InvocationOnMock invocation) throws Throwable { FileList fileList = new FileList(); fileList.setFiles(ImmutableList.of(file)); if (i.intValue() > 0) { fileList.setNextPageToken("token"); i.decrement(); } return fileList; } });
@Override public UnsampledReport answer(InvocationOnMock invocation) throws Throwable { countDown.decrement(); if (countDown.intValue() == 0) { UnsampledReport response = new UnsampledReport(); DriveDownloadDetails details = new DriveDownloadDetails(); details.setDocumentId(EXPECTED_FILE_ID); response.setStatus(status.name()) .setDownloadType(DOWNLOAD_TYPE_GOOGLE_DRIVE) .setDriveDownloadDetails(details); return response; } else if (throwException) { throw new RuntimeException("Dummy exception."); } return new UnsampledReport(); } });
private void unregisterPendingPreemption(String host) { writeLock.lock(); try { pendingPreemptions.decrementAndGet(); if (metrics != null) { metrics.decrPendingPreemptionTasksCount(); } MutableInt val = pendingPreemptionsPerHost.get(host); Preconditions.checkNotNull(val); val.decrement(); // Not bothering with removing the entry. There's a limited number of hosts, and a good // chance that the entry will make it back in when the AM is used for a long duration. } finally { writeLock.unlock(); } }
filterNumber.decrement();
filterNumber.decrement();
waitingFor.decrement(); waitingForMonitor.notifyAll();
case INITIALIZED: synchronized (waitingForMonitor) { waitingFor.decrement(); waitingForMonitor.notifyAll();
waitingFor.decrement(); waitingForMonitor.notifyAll();
@Override public void run() { //let the players update smoother int remainingUpdates = getNextUpdates(); for (Map.Entry<Player, MutableInt> entry : queue.entrySet()) { Player player = entry.getKey(); MutableInt remainingTicks = entry.getValue(); if (remainingTicks.intValue() == 0) { if (remainingUpdates != 0) { //Smoother refreshing; limit the updates plugin.getScoreboardManager().onUpdate(player); remainingTicks.setValue(20 * Settings.getInterval()); remainingUpdates--; } } else { remainingTicks.decrement(); } } nextGlobalUpdate--; if (nextGlobalUpdate == 0) { nextGlobalUpdate = 20 * Settings.getInterval(); //update globals plugin.getReplaceManager().updateGlobals(); } }
/** * Decrement a count value for a named key * * @param resourceKey the key to count against * @param allowNegative <tt>true</tt> to allow negative values otherwise zero will be the floor * @return the newly-decremented value (negative, if allowed) */ public static final int decrementCount(Object resourceKey, boolean allowNegative) { MutableInt counter = (MutableInt) AlfrescoTransactionSupport.getResource(resourceKey); if (counter == null) { counter = new MutableInt(0); AlfrescoTransactionSupport.bindResource(resourceKey, counter); } if (counter.intValue() > 0 || allowNegative) { counter.decrement(); } return counter.intValue(); }
/** * Decrement a count value for a named key * * @param resourceKey the key to count against * @param allowNegative <tt>true</tt> to allow negative values otherwise zero will be the floor * @return the newly-decremented value (negative, if allowed) */ public static final int decrementCount(Object resourceKey, boolean allowNegative) { MutableInt counter = (MutableInt) AlfrescoTransactionSupport.getResource(resourceKey); if (counter == null) { counter = new MutableInt(0); AlfrescoTransactionSupport.bindResource(resourceKey, counter); } if (counter.intValue() > 0 || allowNegative) { counter.decrement(); } return counter.intValue(); }