@Nullable @Override public Object call() throws Exception { cache.replace("key", null); return null; } }, NullPointerException.class, A.NULL_MSG_PREFIX);
@Nullable @Override public Object call() throws Exception { cache.replace(null, 1); return null; } }, NullPointerException.class, A.NULL_MSG_PREFIX);
@Nullable @Override public Object call() throws Exception { cache.replace("key", null); return null; } }, NullPointerException.class, A.NULL_MSG_PREFIX);
@Nullable @Override public Object call() throws Exception { cache.replace(null, 1); return null; } }, NullPointerException.class, A.NULL_MSG_PREFIX);
@Nullable @Override public Object call() throws Exception { cache.replace(null, 1, 2); return null; } }, NullPointerException.class, A.NULL_MSG_PREFIX);
@Nullable @Override public Object call() throws Exception { cache.replace("key", null, 2); return null; } }, NullPointerException.class, A.NULL_MSG_PREFIX);
@Nullable @Override public Object call() throws Exception { cache.replace("key", null, 2); return null; } }, NullPointerException.class, A.NULL_MSG_PREFIX);
@Nullable @Override public Object call() throws Exception { cache.replace("key", 1, null); return null; } }, NullPointerException.class, A.NULL_MSG_PREFIX);
/** {@inheritDoc} */ @Override public Boolean call() throws Exception { return cache().replace(key, oldVal, newVal); } }
/** {@inheritDoc} */ @Override public Boolean call() throws Exception { return cache().replace(key, val); } }
@Override public void apply(Connection conn) { Person p = new Person(); p.id = 1; p.firstName = "Luke"; p.lastName = "Maxwell"; personCache().replace(1, p); } }, null);
@Override public void apply(Connection conn) { Person p = new Person(); p.id = 1; p.firstName = "Luke"; p.lastName = "Maxwell"; personCache().replace(1, p); } }, afterReadUpdateAndRollback);
@Override public void apply(Connection conn) { Person p = new Person(); p.id = 1; p.firstName = "Luke"; p.lastName = "Maxwell"; personCache().replace(1, p); } }, afterReadUpdate);
/** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public ClientResponse process(ClientConnectionContext ctx) { boolean res = cache(ctx).replace(key(), val(), newVal); return new ClientBooleanResponse(requestId(), res); } }
/** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public ClientResponse process(ClientConnectionContext ctx) { boolean res = cache(ctx).replace(key(), val()); return new ClientBooleanResponse(requestId(), res); } }
/** */ @Test public void testReplace1() { checkOperation(() -> cache.replace(1, 1, 1)); }
/** */ @Test public void testReplace2() { checkOperation(() -> cache.replace(1, 1)); }
@Override public Void call() throws Exception { IgniteCache<Object, Object> cache = node1.cache(DEFAULT_CACHE_NAME); try (Transaction tx = node1.transactions().txStart()) { l1.await(); cache.replace(key.get(), "dummy val2"); tx.commit(); } return null; } }, "tx-2"));
/** * @throws Exception In case of error. */ @Test public void testPeek() throws Exception { Ignite ignite = primaryIgnite("key"); IgniteCache<String, Integer> cache = ignite.cache(DEFAULT_CACHE_NAME); assert peek(cache, "key") == null; cache.put("key", 1); cache.replace("key", 2); assertEquals(2, peek(cache, "key").intValue()); }
/** * @throws Exception In case of error. */ @Test public void testPeek() throws Exception { Ignite ignite = primaryIgnite("key"); IgniteCache<String, Integer> cache = ignite.cache(cacheName()); assertNull(cache.localPeek("key")); cache.put("key", 1); cache.replace("key", 2); assertEquals(2, cache.localPeek("key").intValue()); }