/** * Removes atomic stamped from cache. * * @param name Atomic stamped name. * @param grpName Group name. * @throws IgniteCheckedException If removing failed. */ final void removeAtomicStamped(final String name, final String grpName) throws IgniteCheckedException { removeDataStructure(null, name, grpName, ATOMIC_STAMPED, null); }
/** * Removes sequence from cache. * * @param name Sequence name. * @param grpName Group name. * @throws IgniteCheckedException If removing failed. */ final void removeSequence(final String name, final String grpName) throws IgniteCheckedException { removeDataStructure(null, name, grpName, ATOMIC_SEQ, null); }
/** * Removes semaphore from cache. * * @param name Name of the semaphore. * @param grpName Group name. * @throws IgniteCheckedException If operation failed. */ public void removeSemaphore(final String name, final String grpName) throws IgniteCheckedException { removeDataStructure(new IgnitePredicateX<AtomicDataStructureValue>() { @Override public boolean applyx(AtomicDataStructureValue val) throws IgniteCheckedException { assert val != null && val instanceof GridCacheSemaphoreState; GridCacheSemaphoreState semVal = (GridCacheSemaphoreState) val; if (semVal.getCount() < 0) throw new IgniteCheckedException("Failed to remove semaphore with blocked threads. "); return true; } }, name, grpName, SEMAPHORE, null); }
/** * Removes reentrant lock from cache. * * @param name Name of the reentrant lock. * @param grpName Group name. * @param broken Flag indicating the reentrant lock is broken and should be removed unconditionally. * @throws IgniteCheckedException If operation failed. */ public void removeReentrantLock(final String name, final String grpName, final boolean broken) throws IgniteCheckedException { removeDataStructure(new IgnitePredicateX<AtomicDataStructureValue>() { @Override public boolean applyx(AtomicDataStructureValue val) throws IgniteCheckedException { assert val != null && val instanceof GridCacheLockState; GridCacheLockState lockVal = (GridCacheLockState) val; if (lockVal.get() > 0 && !broken) throw new IgniteCheckedException("Failed to remove reentrant lock with blocked threads. "); return true; } }, name, grpName, REENTRANT_LOCK, null); }
/** * Removes count down latch from cache. * * @param name Name of the latch. * @param grpName Cache group name. * @throws IgniteCheckedException If operation failed. */ public void removeCountDownLatch(final String name, final String grpName) throws IgniteCheckedException { removeDataStructure(new IgnitePredicateX<AtomicDataStructureValue>() { @Override public boolean applyx(AtomicDataStructureValue val) throws IgniteCheckedException { assert val != null && val instanceof GridCacheCountDownLatchValue; GridCacheCountDownLatchValue latchVal = (GridCacheCountDownLatchValue) val; if (latchVal.get() > 0) { throw new IgniteCheckedException("Failed to remove count down latch " + "with non-zero count: " + latchVal.get()); } return true; } }, name, grpName, COUNT_DOWN_LATCH, null); }
/** * Removes atomic reference from cache. * * @param name Atomic reference name. * @param grpName Group name. * @throws IgniteCheckedException If removing failed. */ final void removeAtomicReference(final String name, @Nullable final String grpName) throws IgniteCheckedException { removeDataStructure(null, name, grpName, ATOMIC_REF, null); }
/** * Removes atomic long from cache. * * @param name Atomic long name. * @param grpName Group name. * @throws IgniteCheckedException If removing failed. */ final void removeAtomicLong(final String name, @Nullable final String grpName) throws IgniteCheckedException { removeDataStructure(null, name, grpName, ATOMIC_LONG, null); }
/** * @param name Queue name. * @param cctx Queue cache context. * @throws IgniteCheckedException If failed. */ public void removeQueue(final String name, final GridCacheContext cctx) throws IgniteCheckedException { assert name != null; assert cctx != null; CIX1<GridCacheQueueHeader> afterRmv = new CIX1<GridCacheQueueHeader>() { @Override public void applyx(GridCacheQueueHeader hdr) throws IgniteCheckedException { hdr = (GridCacheQueueHeader) cctx.cache().withNoRetries().getAndRemove(new GridCacheQueueHeaderKey(name)); if (hdr == null || hdr.empty()) return; GridCacheQueueAdapter.removeKeys(cctx.cache(), hdr.id(), name, hdr.collocated(), hdr.head(), hdr.tail(), 0); } }; removeDataStructure(null, name, cctx.group().name(), QUEUE, afterRmv); }
/** * @param name Set name. * @param cctx Set cache context. * @throws IgniteCheckedException If failed. */ public void removeSet(final String name, final GridCacheContext cctx) throws IgniteCheckedException { assert name != null; assert cctx != null; CIX1<GridCacheSetHeader> afterRmv = new CIX1<GridCacheSetHeader>() { @Override public void applyx(GridCacheSetHeader hdr) throws IgniteCheckedException { hdr = (GridCacheSetHeader) cctx.cache().withNoRetries().getAndRemove(new GridCacheSetHeaderKey(name)); if (hdr != null) cctx.dataStructures().removeSetData(hdr.id(), hdr.separated()); } }; removeDataStructure(null, name, cctx.group().name(), SET, afterRmv); }
/** * Removes atomic stamped from cache. * * @param name Atomic stamped name. * @param grpName Group name. * @throws IgniteCheckedException If removing failed. */ final void removeAtomicStamped(final String name, final String grpName) throws IgniteCheckedException { removeDataStructure(null, name, grpName, ATOMIC_STAMPED, null); }
/** * Removes sequence from cache. * * @param name Sequence name. * @param grpName Group name. * @throws IgniteCheckedException If removing failed. */ final void removeSequence(final String name, final String grpName) throws IgniteCheckedException { removeDataStructure(null, name, grpName, ATOMIC_SEQ, null); }
/** * Removes semaphore from cache. * * @param name Name of the semaphore. * @param grpName Group name. * @throws IgniteCheckedException If operation failed. */ public void removeSemaphore(final String name, final String grpName) throws IgniteCheckedException { removeDataStructure(new IgnitePredicateX<AtomicDataStructureValue>() { @Override public boolean applyx(AtomicDataStructureValue val) throws IgniteCheckedException { assert val != null && val instanceof GridCacheSemaphoreState; GridCacheSemaphoreState semVal = (GridCacheSemaphoreState) val; if (semVal.getCount() < 0) throw new IgniteCheckedException("Failed to remove semaphore with blocked threads. "); return true; } }, name, grpName, SEMAPHORE, null); }
/** * Removes reentrant lock from cache. * * @param name Name of the reentrant lock. * @param grpName Group name. * @param broken Flag indicating the reentrant lock is broken and should be removed unconditionally. * @throws IgniteCheckedException If operation failed. */ public void removeReentrantLock(final String name, final String grpName, final boolean broken) throws IgniteCheckedException { removeDataStructure(new IgnitePredicateX<AtomicDataStructureValue>() { @Override public boolean applyx(AtomicDataStructureValue val) throws IgniteCheckedException { assert val != null && val instanceof GridCacheLockState; GridCacheLockState lockVal = (GridCacheLockState) val; if (lockVal.get() > 0 && !broken) throw new IgniteCheckedException("Failed to remove reentrant lock with blocked threads. "); return true; } }, name, grpName, REENTRANT_LOCK, null); }
/** * Removes count down latch from cache. * * @param name Name of the latch. * @param grpName Cache group name. * @throws IgniteCheckedException If operation failed. */ public void removeCountDownLatch(final String name, final String grpName) throws IgniteCheckedException { removeDataStructure(new IgnitePredicateX<AtomicDataStructureValue>() { @Override public boolean applyx(AtomicDataStructureValue val) throws IgniteCheckedException { assert val != null && val instanceof GridCacheCountDownLatchValue; GridCacheCountDownLatchValue latchVal = (GridCacheCountDownLatchValue) val; if (latchVal.get() > 0) { throw new IgniteCheckedException("Failed to remove count down latch " + "with non-zero count: " + latchVal.get()); } return true; } }, name, grpName, COUNT_DOWN_LATCH, null); }
/** * Removes atomic long from cache. * * @param name Atomic long name. * @param grpName Group name. * @throws IgniteCheckedException If removing failed. */ final void removeAtomicLong(final String name, @Nullable final String grpName) throws IgniteCheckedException { removeDataStructure(null, name, grpName, ATOMIC_LONG, null); }
/** * Removes atomic reference from cache. * * @param name Atomic reference name. * @param grpName Group name. * @throws IgniteCheckedException If removing failed. */ final void removeAtomicReference(final String name, @Nullable final String grpName) throws IgniteCheckedException { removeDataStructure(null, name, grpName, ATOMIC_REF, null); }
/** * @param name Queue name. * @param cctx Queue cache context. * @throws IgniteCheckedException If failed. */ public void removeQueue(final String name, final GridCacheContext cctx) throws IgniteCheckedException { assert name != null; assert cctx != null; CIX1<GridCacheQueueHeader> afterRmv = new CIX1<GridCacheQueueHeader>() { @Override public void applyx(GridCacheQueueHeader hdr) throws IgniteCheckedException { hdr = (GridCacheQueueHeader) cctx.cache().withNoRetries().getAndRemove(new GridCacheQueueHeaderKey(name)); if (hdr == null || hdr.empty()) return; GridCacheQueueAdapter.removeKeys(cctx.cache(), hdr.id(), name, hdr.collocated(), hdr.head(), hdr.tail(), 0); } }; removeDataStructure(null, name, cctx.group().name(), QUEUE, afterRmv); }
/** * @param name Set name. * @param cctx Set cache context. * @throws IgniteCheckedException If failed. */ public void removeSet(final String name, final GridCacheContext cctx) throws IgniteCheckedException { assert name != null; assert cctx != null; CIX1<GridCacheSetHeader> afterRmv = new CIX1<GridCacheSetHeader>() { @Override public void applyx(GridCacheSetHeader hdr) throws IgniteCheckedException { hdr = (GridCacheSetHeader) cctx.cache().withNoRetries().getAndRemove(new GridCacheSetHeaderKey(name)); if (hdr != null) cctx.dataStructures().removeSetData(hdr.id(), hdr.separated()); } }; removeDataStructure(null, name, cctx.group().name(), SET, afterRmv); }