/** {@inheritDoc} */ @Override public long get() { checkRemoved(); try { GridCacheAtomicLongValue val = cacheView.get(key); if (val == null) throw new IgniteException("Failed to find atomic long: " + name); return val.get(); } catch (IgniteCheckedException e) { throw U.convertException(e); } }
/** {@inheritDoc} */ @Override public Long process(MutableEntry<GridCacheInternalKey, GridCacheAtomicLongValue> e, Object... args) { GridCacheAtomicLongValue val = e.getValue(); if (val == null) throw new EntryProcessorException("Failed to find atomic long: " + e.getKey().name()); long curVal = val.get(); e.setValue(new GridCacheAtomicLongValue(newVal)); return curVal; }
/** {@inheritDoc} */ @Override public Long process(MutableEntry<GridCacheInternalKey, GridCacheAtomicLongValue> e, Object... args) { GridCacheAtomicLongValue val = e.getValue(); if (val == null) throw new EntryProcessorException("Failed to find atomic long: " + e.getKey().name()); long newVal = val.get() + delta; e.setValue(new GridCacheAtomicLongValue(newVal)); return newVal; }
/** {@inheritDoc} */ @Override public Long process(MutableEntry<GridCacheInternalKey, GridCacheAtomicLongValue> e, Object... args) { GridCacheAtomicLongValue val = e.getValue(); if (val == null) throw new EntryProcessorException("Failed to find atomic long: " + e.getKey().name()); long newVal = val.get() + 1; e.setValue(new GridCacheAtomicLongValue(newVal)); return newVal; }
/** {@inheritDoc} */ @Override public Long process(MutableEntry<GridCacheInternalKey, GridCacheAtomicLongValue> e, Object... args) { GridCacheAtomicLongValue val = e.getValue(); if (val == null) throw new EntryProcessorException("Failed to find atomic long: " + e.getKey().name()); long newVal = val.get() - 1; e.setValue(new GridCacheAtomicLongValue(newVal)); return newVal; }
/** {@inheritDoc} */ @Override public Long process(MutableEntry<GridCacheInternalKey, GridCacheAtomicLongValue> e, Object... args) { GridCacheAtomicLongValue val = e.getValue(); if (val == null) throw new EntryProcessorException("Failed to find atomic long: " + e.getKey().name()); long curVal = val.get(); e.setValue(new GridCacheAtomicLongValue(curVal + delta)); return curVal; }
/** {@inheritDoc} */ @Override public Long process(MutableEntry<GridCacheInternalKey, GridCacheAtomicLongValue> e, Object... args) { GridCacheAtomicLongValue val = e.getValue(); if (val == null) throw new EntryProcessorException("Failed to find atomic long: " + e.getKey().name()); long curVal = val.get(); if (curVal == expVal) e.setValue(new GridCacheAtomicLongValue(newVal)); return curVal; }
/** {@inheritDoc} */ @Override public Long process(MutableEntry<GridCacheInternalKey, GridCacheAtomicLongValue> e, Object... args) { GridCacheAtomicLongValue val = e.getValue(); if (val == null) throw new EntryProcessorException("Failed to find atomic long: " + e.getKey().name()); long ret = val.get(); e.setValue(new GridCacheAtomicLongValue(ret + 1)); return ret; }
/** {@inheritDoc} */ @Override public Long process(MutableEntry<GridCacheInternalKey, GridCacheAtomicLongValue> e, Object... args) { GridCacheAtomicLongValue val = e.getValue(); if (val == null) throw new EntryProcessorException("Failed to find atomic long: " + e.getKey().name()); long ret = val.get(); e.setValue(new GridCacheAtomicLongValue(ret - 1)); return ret; }
/** * Test {@link GridCacheInternalKey}/{@link GridCacheAtomicLongValue}. * @param name Name. * @throws Exception If failed. */ private void checkCustom(String name) throws Exception { for (int i = INIT_GRID_NUM; i < 20; i++) { startGrid(i); assert PARTITIONED == grid(i).cache(DEFAULT_CACHE_NAME).getConfiguration(CacheConfiguration.class).getCacheMode(); try (Transaction tx = grid(i).transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) { GridCacheInternalKey key = new GridCacheInternalKeyImpl(name, "testGroup"); GridCacheAtomicLongValue atomicVal = ((GridCacheAtomicLongValue) grid(i).cache(DEFAULT_CACHE_NAME).get(key)); assertNotNull(atomicVal); assertEquals("Custom check failed for node: " + i, (long) i, atomicVal.get()); atomicVal.set(i + 1); grid(i).cache(DEFAULT_CACHE_NAME).put(key, atomicVal); tx.commit(); } stopGrid(i); } }
/** {@inheritDoc} */ @Override public long get() { checkRemoved(); try { GridCacheAtomicLongValue val = cacheView.get(key); if (val == null) throw new IgniteException("Failed to find atomic long: " + name); return val.get(); } catch (IgniteCheckedException e) { throw U.convertException(e); } }
/** {@inheritDoc} */ @Override public Long process(MutableEntry<GridCacheInternalKey, GridCacheAtomicLongValue> e, Object... args) { GridCacheAtomicLongValue val = e.getValue(); if (val == null) throw new EntryProcessorException("Failed to find atomic long: " + e.getKey().name()); long ret = val.get(); e.setValue(new GridCacheAtomicLongValue(ret + 1)); return ret; }
/** {@inheritDoc} */ @Override public Long process(MutableEntry<GridCacheInternalKey, GridCacheAtomicLongValue> e, Object... args) { GridCacheAtomicLongValue val = e.getValue(); if (val == null) throw new EntryProcessorException("Failed to find atomic long: " + e.getKey().name()); long newVal = val.get() - 1; e.setValue(new GridCacheAtomicLongValue(newVal)); return newVal; }
/** {@inheritDoc} */ @Override public Long process(MutableEntry<GridCacheInternalKey, GridCacheAtomicLongValue> e, Object... args) { GridCacheAtomicLongValue val = e.getValue(); if (val == null) throw new EntryProcessorException("Failed to find atomic long: " + e.getKey().name()); long curVal = val.get(); e.setValue(new GridCacheAtomicLongValue(newVal)); return curVal; }
/** {@inheritDoc} */ @Override public Long process(MutableEntry<GridCacheInternalKey, GridCacheAtomicLongValue> e, Object... args) { GridCacheAtomicLongValue val = e.getValue(); if (val == null) throw new EntryProcessorException("Failed to find atomic long: " + e.getKey().name()); long newVal = val.get() + 1; e.setValue(new GridCacheAtomicLongValue(newVal)); return newVal; }
/** {@inheritDoc} */ @Override public Long process(MutableEntry<GridCacheInternalKey, GridCacheAtomicLongValue> e, Object... args) { GridCacheAtomicLongValue val = e.getValue(); if (val == null) throw new EntryProcessorException("Failed to find atomic long: " + e.getKey().name()); long newVal = val.get() + delta; e.setValue(new GridCacheAtomicLongValue(newVal)); return newVal; }
/** {@inheritDoc} */ @Override public Long process(MutableEntry<GridCacheInternalKey, GridCacheAtomicLongValue> e, Object... args) { GridCacheAtomicLongValue val = e.getValue(); if (val == null) throw new EntryProcessorException("Failed to find atomic long: " + e.getKey().name()); long curVal = val.get(); e.setValue(new GridCacheAtomicLongValue(curVal + delta)); return curVal; }
/** {@inheritDoc} */ @Override public Long process(MutableEntry<GridCacheInternalKey, GridCacheAtomicLongValue> e, Object... args) { GridCacheAtomicLongValue val = e.getValue(); if (val == null) throw new EntryProcessorException("Failed to find atomic long: " + e.getKey().name()); long curVal = val.get(); if (curVal == expVal) e.setValue(new GridCacheAtomicLongValue(newVal)); return curVal; }
/** {@inheritDoc} */ @Override public Long process(MutableEntry<GridCacheInternalKey, GridCacheAtomicLongValue> e, Object... args) { GridCacheAtomicLongValue val = e.getValue(); if (val == null) throw new EntryProcessorException("Failed to find atomic long: " + e.getKey().name()); long ret = val.get(); e.setValue(new GridCacheAtomicLongValue(ret - 1)); return ret; }