/** * @param ver DHT atomic update future version. * @return Amount of active DHT atomic updates. */ public int startDhtAtomicUpdate(GridCacheVersion ver) { assert dhtAtomicUpdCnt != null; return dhtAtomicUpdCnt.incrementAndGet(dhtAtomicUpdateIndex(ver)); }
@Override public void recordTime(long startNanoTime, long endNanoTime) { if (startNanoTime > endNanoTime) { return; } hasRecord = true; int elapsedTime = (int) ((endNanoTime - startNanoTime) / 1000000); if (elapsedTime < timingArr.length() - 1) { timingArr.incrementAndGet(elapsedTime); } else { timingArr.incrementAndGet(timingArr.length() - 1); } }
@Override public void recordTime(long startNanoTime, long endNanoTime) { if (startNanoTime > endNanoTime) { return; } hasRecord = true; int elapsedTime = (int) ((endNanoTime - startNanoTime) / 1000000); if (elapsedTime < timingArr.length()) { timingArr.incrementAndGet(elapsedTime); return; } AtomicInteger count = timingMap.get(elapsedTime); if (count != null) { count.incrementAndGet(); return; } AtomicInteger oldCounter = timingMap.putIfAbsent(elapsedTime, new AtomicInteger(1)); if (oldCounter != null) { oldCounter.incrementAndGet(); } }
void stepped(int chunk) { assert (_trainer != null) == _key.home(); if( _trainer != null ) _trainer._counts.incrementAndGet(chunk); else { for( ;; ) { Integer n = _counters.get(chunk); if( n == null ) { if( _counters.putIfAbsent(chunk, 1) == null ) break; } else { if( _counters.replace(chunk, n, n + 1) ) break; } } } }
@VisibleForTesting void hit(long timestamp) { long numTimeUnits = timestamp / _timeBucketWidthMs; int index = (int) (numTimeUnits % BUCKET_COUNT); if (_bucketStartTime.get(index) == numTimeUnits) { _bucketHitCount.incrementAndGet(index); } else { synchronized (_bucketStartTime) { if (_bucketStartTime.get(index) != numTimeUnits) { _bucketHitCount.set(index, 1); _bucketStartTime.set(index, numTimeUnits); } else { _bucketHitCount.incrementAndGet(index); } } } }
/** * Adds a new <code>CacheClientProxy</code> to the list of known client proxies * * @param proxy The <code>CacheClientProxy</code> to add */ protected void addClientProxy(CacheClientProxy proxy) throws IOException { // this._logger.info(String.format("%s", "adding client proxy " + proxy)); getCache(); // ensure cache reference is up to date so firstclient state is correct this._clientProxies.put(proxy.getProxyID(), proxy); // Remove this proxy from the init proxy list. removeClientInitProxy(proxy); this._connectionListener.queueAdded(proxy.getProxyID()); if (!(proxy.clientConflation == Handshake.CONFLATION_ON)) { // Delta not supported with conflation ON ClientHealthMonitor chm = ClientHealthMonitor.getInstance(); /* * #41788 - If the client connection init starts while cache/member is shutting down, * ClientHealthMonitor.getInstance() might return null. */ if (chm != null) { chm.numOfClientsPerVersion.incrementAndGet(proxy.getVersion().ordinal()); } } this.timedOutDurableClientProxies.remove(proxy.getProxyID()); }
final void exportTriangle(int u, int v, int w) { triangles.incrementAndGet(u); triangles.incrementAndGet(v); triangles.incrementAndGet(w); onTriangle(); }
final void exportTriangle(int u, int v, int w) { triangles.incrementAndGet(u); triangles.incrementAndGet(v); triangles.incrementAndGet(w); onTriangle(); }
/** * @param ver DHT atomic update future version. * @return Amount of active DHT atomic updates. */ public int startDhtAtomicUpdate(GridCacheVersion ver) { assert dhtAtomicUpdCnt != null; return dhtAtomicUpdCnt.incrementAndGet(dhtAtomicUpdateIndex(ver)); }
public boolean remove(int index, Object item, boolean updateHead) { boolean result = elements.compareAndSet(index, item, REMOVED_ELEMENT); if (result && updateHead) indexes.incrementAndGet(headOffset); return result; }
public boolean remove(int index, Object item, boolean updateHead) { boolean result = elements.compareAndSet(index, item, REMOVED_ELEMENT); if (result && updateHead) indexes.incrementAndGet(headOffset); return result; }
public boolean remove(int index, Object item, boolean updateHead) { boolean result = elements.compareAndSet(index, item, REMOVED_ELEMENT); if (result && updateHead) indexes.incrementAndGet(headOffset); return result; }
public boolean remove(int index, Object item, boolean updateHead) { boolean result = elements.compareAndSet(index, item, REMOVED_ELEMENT); if (result && updateHead) indexes.incrementAndGet(headOffset); return result; }
public boolean store(int index, E item) { boolean result = elements.compareAndSet(index, null, item); if (result) indexes.incrementAndGet(tailOffset); return result; }
public boolean store(int index, E item) { boolean result = elements.compareAndSet(index, null, item); if (result) indexes.incrementAndGet(tailOffset); return result; }
public boolean store(int index, E item) { boolean result = elements.compareAndSet(index, null, item); if (result) indexes.incrementAndGet(tailOffset); return result; }
public boolean remove(int index, Object item, boolean updateHead) { boolean result = elements.compareAndSet(index, item, REMOVED_ELEMENT); if (result && updateHead) indexes.incrementAndGet(headOffset); return result; }
public boolean store(int index, E item) { boolean result = elements.compareAndSet(index, null, item); if (result) indexes.incrementAndGet(tailOffset); return result; }
private int localSeq(String name) { int hash = localHashIndex(name); int num = localSeqs.incrementAndGet(hash); if (num > 50000000) { localSeqs.weakCompareAndSet(hash, num, ThreadLocalRandom.current().nextInt(100)); } return num; }
public void inc_lock_stack_size_usage(int i) { if (STATS_ENABLED) { if (i >= lockStackSize.length()) i = lockStackSize.length() - 1; lockStackSize.incrementAndGet(i); } }