@Override public boolean replace(K key, V oldValue, V newValue) { return map.replace(key, oldValue, newValue); }
@Override public V replace(K key, V newValue) { return map.replace(key, newValue); }
@Override public boolean replace(K key, V oldValue, V newValue) { return map.replace(key, oldValue, newValue); }
@Override public V replace(K key, V value) { return map.replace(key, value); }
@Override public V replace(K key, V newValue) { return map.replace(key, newValue); }
@Override public boolean replace(K key, V oldValue, V newValue) { return map.replace(key, oldValue, newValue); }
@Override public Object replace(String mapName, String key, Object value) { return hazelcast.getMap(mapName).replace(key, value); }
@Override public Object replace(String mapName, String key, Object value) { return hazelcast.getMap(mapName).replace(key, value); }
@Override public boolean replace(String key, String oldValue, String newValue) { Assert.notNull(key, "'key' must not be null."); Assert.notNull(oldValue, "'oldValue' must not be null."); Assert.notNull(newValue, "'newValue' must not be null."); return this.map.replace(key, oldValue, newValue); }
public void run() { IMap map = hazelcast.getMap("myMap"); map.replace(random.nextInt(SIZE), new Customer(random.nextInt(100), String.valueOf(random.nextInt(10000)))); } }, 4);
public void run() { IMap map = hazelcast.getMap("myMap"); map.replace(random.nextInt(SIZE), new Customer(random.nextInt(100), String.valueOf(random.nextInt(10000))), new Customer(random.nextInt(100), String.valueOf(random.nextInt(10000)))); } }, 5);
@Override public boolean replace(@Nonnull K key, @Nonnull V oldValue, @Nonnull V newValue) { return map.replace(checkNotNull(key, "key"), wrap(checkNotNull(oldValue, "oldValue")), wrap(checkNotNull(newValue, "newValue"))); }
/** * UPDATE an object in your cache (the whole object will be replaced) */ private void update(Object oid, Exchange exchange) { Object body = exchange.getIn().getBody(); this.cache.lock(oid); this.cache.replace(oid, body); this.cache.unlock(oid); }
/** * Replaces the entry for given id with a specific value in the body, only if currently mapped to a given value */ private void update(Object oid, Object ovalue, Exchange exchange) { Object body = exchange.getIn().getBody(); this.cache.lock(oid); this.cache.replace(oid, ovalue, body); this.cache.unlock(oid); }
@Override public void update(Session session) throws UnknownSessionException { log.debug("Updating a session identified by[{}]", session.getId()); map.replace(session.getId(), session); }
@Override public boolean confirm(String key) { repo.lock(key); try { return repo.replace(key, false, true); } finally { repo.unlock(key); } }
protected void handleMapReplace(String[] args) { println(getMap().replace(args[1], args[2])); }
protected void handleMapReplace(String[] args) { println(getMap().replace(args[1], args[2])); }
protected void handleMapReplace(String[] args) { println(getMap().replace(args[1], args[2])); }
@TimeStep public void timeStep(ThreadState state) throws Exception { Integer key = state.randomInt(keyCount); long incrementValue = state.randomInt(100); for (; ; ) { Long current = map.get(key); Long update = current + incrementValue; if (map.replace(key, current, update)) { state.increment(key, incrementValue); break; } } }