/** * @param ver DHT atomic update future version. */ public void finishDhtAtomicUpdate(GridCacheVersion ver) { assert dhtAtomicUpdCnt != null; dhtAtomicUpdCnt.decrementAndGet(dhtAtomicUpdateIndex(ver)); }
/** * Removes an existing <code>CacheClientProxy</code> from the list of known client proxies * * @param proxy The <code>CacheClientProxy</code> to remove */ protected void removeClientProxy(CacheClientProxy proxy) { // this._logger.info(String.format("%s", "removing client proxy " + proxy, new // Exception("stack trace"))); ClientProxyMembershipID client = proxy.getProxyID(); this._clientProxies.remove(client); this._connectionListener.queueRemoved(); this.getCache().cleanupForClient(this, client); if (!(proxy.clientConflation == Handshake.CONFLATION_ON)) { ClientHealthMonitor chm = ClientHealthMonitor.getInstance(); if (chm != null) { chm.numOfClientsPerVersion.decrementAndGet(proxy.getVersion().ordinal()); } } }
/** * @param ver DHT atomic update future version. */ public void finishDhtAtomicUpdate(GridCacheVersion ver) { assert dhtAtomicUpdCnt != null; dhtAtomicUpdCnt.decrementAndGet(dhtAtomicUpdateIndex(ver)); }
@Override public void nextTuple() { // 睡眠一段时间后再产生一个数据 Utils.sleep(100); // 随机选择一个句子 int index = random.nextInt(sentences.length); int count = arr.decrementAndGet(index); if (count >= 0) { String sentence = sentences[index]; // 将句子写入kafka kafkaTemplate.send(topic, sentence); } }
/** * Schedules the task to be applied to the page replacement policy. * * @param task the pending operation * @return if the draining of the buffers can be delayed */ boolean schedule(Task task) { int index = bufferIndex(); int buffered = bufferLengths.incrementAndGet(index); if (task.isWrite()) { buffers[index].add(task); drainStatus.set(REQUIRED); return false; } // A buffer may discard a read task if its length exceeds a tolerance // level if (buffered <= MAXIMUM_BUFFER_SIZE) { buffers[index].add(task); return (buffered <= BUFFER_THRESHOLD); } else { // not optimized for fail-safe scenario bufferLengths.decrementAndGet(index); return false; } }
/** * Schedules the task to be applied to the page replacement policy. * * @param task the pending operation * @return if the draining of the buffers can be delayed */ private boolean schedule(Task task) { int index = bufferIndex(); int buffered = bufferLengths.incrementAndGet(index); if (task.isWrite()) { buffers[index].add(task); drainStatus.set(DrainStatus.REQUIRED); return false; } // A buffer may discard a read task if its length exceeds a tolerance level if (buffered <= MAXIMUM_BUFFER_SIZE) { buffers[index].add(task); return (buffered <= BUFFER_THRESHOLD); } else { // not optimized for fail-safe scenario bufferLengths.decrementAndGet(index); return false; } }
/** * Schedules the task to be applied to the page replacement policy. * * @param task the pending operation * @return if the draining of the buffers can be delayed */ private boolean schedule(Task task) { int index = bufferIndex(); int buffered = bufferLengths.incrementAndGet(index); if (task.isWrite()) { buffers[index].add(task); drainStatus.set(REQUIRED); return false; } // A buffer may discard a read task if its length exceeds a tolerance level if (buffered <= MAXIMUM_BUFFER_SIZE) { buffers[index].add(task); return (buffered <= BUFFER_THRESHOLD); } else { // not optimized for fail-safe scenario bufferLengths.decrementAndGet(index); return false; } }
/** * Schedules the task to be applied to the page replacement policy. * * @param task the pending operation * @return if the draining of the buffers can be delayed */ boolean schedule(Task task) { int index = bufferIndex(); int buffered = bufferLengths.incrementAndGet(index); if (task.isWrite()) { buffers[index].add(task); drainStatus.set(REQUIRED); return false; } // A buffer may discard a read task if its length exceeds a tolerance level if (buffered <= MAXIMUM_BUFFER_SIZE) { buffers[index].add(task); return (buffered <= BUFFER_THRESHOLD); } else { // not optimized for fail-safe scenario bufferLengths.decrementAndGet(index); return false; } }
/** * Schedules the task to be applied to the page replacement policy. * * @param task * the pending operation * @return if the draining of the buffers can be delayed */ boolean schedule(Task task) { int index = bufferIndex(); int buffered = bufferLengths.incrementAndGet(index); if (task.isWrite()) { buffers[index].add(task); drainStatus.set(REQUIRED); return false; } // A buffer may discard a read task if its length exceeds a tolerance // level if (buffered <= MAXIMUM_BUFFER_SIZE) { buffers[index].add(task); return (buffered <= BUFFER_THRESHOLD); } else { // not optimized for fail-safe scenario bufferLengths.decrementAndGet(index); return false; } }
/** * Schedules the task to be applied to the page replacement policy. * * @param task the pending operation * @return if the draining of the buffers can be delayed */ private boolean schedule(Task task) { int index = bufferIndex(); int buffered = bufferLengths.incrementAndGet(index); if (task.isWrite()) { buffers[index].add(task); drainStatus.set(DrainStatus.REQUIRED); return false; } // A buffer may discard a read task if its length exceeds a tolerance // level if (buffered <= MAXIMUM_BUFFER_SIZE) { buffers[index].add(task); return (buffered <= BUFFER_THRESHOLD); } else { // not optimized for fail-safe scenario bufferLengths.decrementAndGet(index); return false; } }
/** * Removes an existing <code>CacheClientProxy</code> from the list of known * client proxies * * @param proxy * The <code>CacheClientProxy</code> to remove */ protected void removeClientProxy(CacheClientProxy proxy) { // this._logger.info(LocalizedStrings.DEBUG, "removing client proxy " + proxy, new Exception("stack trace")); ClientProxyMembershipID client = proxy.getProxyID(); this._clientProxies.remove(client); this._connectionListener.queueRemoved(); ((GemFireCacheImpl)this.getCache()).cleanupForClient(this, client); if (!(proxy.clientConflation == HandShake.CONFLATION_ON)) { ClientHealthMonitor chm = ClientHealthMonitor.getInstance(); if (chm != null) { chm.numOfClientsPerVersion .decrementAndGet(proxy.getVersion().ordinal()); } } }
/** * Removes an existing <code>CacheClientProxy</code> from the list of known * client proxies * * @param proxy * The <code>CacheClientProxy</code> to remove */ protected void removeClientProxy(CacheClientProxy proxy) { // this._logger.info(LocalizedStrings.DEBUG, "removing client proxy " + proxy, new Exception("stack trace")); ClientProxyMembershipID client = proxy.getProxyID(); this._clientProxies.remove(client); this._connectionListener.queueRemoved(); ((GemFireCacheImpl)this.getCache()).cleanupForClient(this, client); if (!(proxy.clientConflation == HandShake.CONFLATION_ON)) { ClientHealthMonitor chm = ClientHealthMonitor.getInstance(); if (chm != null) { chm.numOfClientsPerVersion .decrementAndGet(proxy.getVersion().ordinal()); } } }