private void destroy() { this.atomicnumber.destroy(); }
/** * Destroy hazelcast shared timggestamp counter with full id, if it's local then remove the map entry * * @param id of the caller context */ public static void removeTimestampWithFullId(String id) { if(log.isDebugEnabled()) { log.info("REMOVING TIMESTAMP WITH FULL ID " + id); } HazelcastInstance hazelcastInstance = getHazelcastInstance(); if(hazelcastInstance != null) { hazelcastInstance.getAtomicLong(id).destroy(); } else { timestamps.remove(id); } }
/** * Destroy hazelcast global counter, if it's local then remove the map entry * * @param id of the caller context */ public static void removeCounter(String id) { if(log.isDebugEnabled()) { log.debug("REMOVING COUNTER WITH ID " + id); } id = ThrottleConstants.THROTTLE_SHARED_COUNTER_KEY + id; HazelcastInstance hazelcastInstance = getHazelcastInstance(); if(hazelcastInstance != null) { hazelcastInstance.getAtomicLong(id).destroy(); } else { counters.remove(id); } }
@Teardown public void teardown() throws Exception { for (IQueue queue : queues) { queue.destroy(); } totalCounter.destroy(); }
/** * Destroy hazelcast shared timggestamp counter, if it's local then remove the map entry * * @param id of the caller context */ public static void removeTimestamp(String id) { if(log.isDebugEnabled()) { log.debug("REMOVING TIMESTAMP WITH ID " + id); } String key = ThrottleConstants.THROTTLE_TIMESTAMP_KEY + id; HazelcastInstance hazelcastInstance = getHazelcastInstance(); if(hazelcastInstance != null) { hazelcastInstance.getAtomicLong(key).destroy(); } else { timestamps.remove(key); } }
@Override public void destroy() { synchronized (this) { blockGenerator.destroy(); LOCAL.set(this, -1); RESIDUE.set(this, BLOCK_SIZE); } } }
@Override public void destroy() { synchronized (this) { blockGenerator.destroy(); LOCAL.set(this, -1); RESIDUE.set(this, BLOCK_SIZE); } } }
@Teardown(global = true) public void teardown() throws Exception { executedCounter.destroy(); expectedExecutedCounter.destroy(); for (IExecutorService executor : executors) { executor.shutdownNow(); if (!executor.awaitTermination(120, TimeUnit.SECONDS)) { log.severe("Time out while waiting for shutdown of executor: " + executor.getId()); } executor.destroy(); } }
@Teardown(global = true) public void teardown() throws Exception { executedCounter.destroy(); expectedExecutedCounter.destroy(); for (IExecutorService executor : executors) { executor.shutdownNow(); if (!executor.awaitTermination(120, TimeUnit.SECONDS)) { logger.severe("Time out while waiting for shutdown of executor: " + executor.getName()); } executor.destroy(); } } }