@Override public boolean replace(K key, V value, ExpiryPolicy expiryPolicy) { try { Future<Boolean> future = replaceAsyncInternal(key, null, value, expiryPolicy, false, false, true); return future.get(); } catch (Throwable e) { throw rethrowAllowedTypeFirst(e, CacheException.class); } }
@Override public boolean putIfAbsent(K key, V value, ExpiryPolicy expiryPolicy) { try { Future<Boolean> future = putIfAbsentAsyncInternal(key, value, expiryPolicy, true); return future.get(); } catch (Throwable e) { throw rethrowAllowedTypeFirst(e, CacheException.class); } }
@Override public boolean replace(K key, V value, ExpiryPolicy expiryPolicy) { try { Future<Boolean> future = replaceAsyncInternal(key, null, value, expiryPolicy, false, false, true); return future.get(); } catch (Throwable e) { throw rethrowAllowedTypeFirst(e, CacheException.class); } }
@Override public V getAndReplace(K key, V value, ExpiryPolicy expiryPolicy) { try { Future<V> future = replaceAsyncInternal(key, null, value, expiryPolicy, false, true, true); return future.get(); } catch (Throwable e) { throw rethrowAllowedTypeFirst(e, CacheException.class); } }
@Override public V get(K key, ExpiryPolicy expiryPolicy) { try { Future<V> future = getAsync(key, expiryPolicy); return future.get(); } catch (Throwable e) { throw rethrowAllowedTypeFirst(e, CacheException.class); } }
@Override public boolean replace(K key, V oldValue, V newValue, ExpiryPolicy expiryPolicy) { try { Future<Boolean> future = replaceAsyncInternal(key, oldValue, newValue, expiryPolicy, true, false, true); return future.get(); } catch (Throwable e) { throw rethrowAllowedTypeFirst(e, CacheException.class); } }
@Override public V getAndReplace(K key, V value, ExpiryPolicy expiryPolicy) { try { Future<V> future = replaceAsyncInternal(key, null, value, expiryPolicy, false, true, true); return future.get(); } catch (Throwable e) { throw rethrowAllowedTypeFirst(e, CacheException.class); } }
@Override public boolean putIfAbsent(K key, V value, ExpiryPolicy expiryPolicy) { try { Future<Boolean> future = putIfAbsentAsyncInternal(key, value, expiryPolicy, true); return future.get(); } catch (Throwable e) { throw rethrowAllowedTypeFirst(e, CacheException.class); } }
@Override public boolean remove(K key) { try { InternalCompletableFuture<Boolean> future = removeAsyncInternal(key, null, false, false, true); return future.get(); } catch (Throwable e) { throw rethrowAllowedTypeFirst(e, CacheException.class); } }
@Override public boolean remove(K key) { try { InternalCompletableFuture<Boolean> future = removeAsyncInternal(key, null, false, false, true); return future.get(); } catch (Throwable e) { throw rethrowAllowedTypeFirst(e, CacheException.class); } }
@Override public V getAndRemove(K key) { try { InternalCompletableFuture<V> future = removeAsyncInternal(key, null, false, true, true); return future.get(); } catch (Throwable e) { throw rethrowAllowedTypeFirst(e, CacheException.class); } }
@Override public void put(K key, V value, ExpiryPolicy expiryPolicy) { try { InternalCompletableFuture<Object> future = putAsyncInternal(key, value, expiryPolicy, false, true); future.get(); } catch (Throwable e) { throw rethrowAllowedTypeFirst(e, CacheException.class); } }
@Override public boolean remove(K key, V oldValue) { try { InternalCompletableFuture<Boolean> future = removeAsyncInternal(key, oldValue, true, false, true); return future.get(); } catch (Throwable e) { throw rethrowAllowedTypeFirst(e, CacheException.class); } }
@Override public void put(K key, V value, ExpiryPolicy expiryPolicy) { try { InternalCompletableFuture<Object> future = putAsyncInternal(key, value, expiryPolicy, false, true); future.get(); } catch (Throwable e) { throw rethrowAllowedTypeFirst(e, CacheException.class); } }
@Override public V getAndPut(K key, V value, ExpiryPolicy expiryPolicy) { try { InternalCompletableFuture<V> future = putAsyncInternal(key, value, expiryPolicy, true, true); return future.get(); } catch (Throwable e) { throw rethrowAllowedTypeFirst(e, CacheException.class); } }
@Override public V getAndRemove(K key) { try { InternalCompletableFuture<V> future = removeAsyncInternal(key, null, false, true, true); return future.get(); } catch (Throwable e) { throw rethrowAllowedTypeFirst(e, CacheException.class); } }
@Override public V getAndPut(K key, V value, ExpiryPolicy expiryPolicy) { try { InternalCompletableFuture<V> future = putAsyncInternal(key, value, expiryPolicy, true, true); return future.get(); } catch (Throwable e) { throw rethrowAllowedTypeFirst(e, CacheException.class); } }
protected void clearInternal() { ClientMessage request = CacheClearCodec.encodeRequest(nameWithPrefix); try { invoke(request); if (statisticsEnabled) { statsHandler.getStatistics().setLastUpdateTime(System.currentTimeMillis()); // we don't support count stats of removing all entries } } catch (Throwable t) { throw rethrowAllowedTypeFirst(t, CacheException.class); } }
@Override public int size() { ensureOpen(); try { ClientMessage request = CacheSizeCodec.encodeRequest(nameWithPrefix); ClientMessage resultMessage = invoke(request); return CacheSizeCodec.decodeResponse(resultMessage).response; } catch (Throwable t) { throw rethrowAllowedTypeFirst(t, CacheException.class); } }
@Override public int size() { ensureOpen(); try { ClientMessage request = CacheSizeCodec.encodeRequest(nameWithPrefix); ClientMessage resultMessage = invoke(request); return CacheSizeCodec.decodeResponse(resultMessage).response; } catch (Throwable t) { throw rethrowAllowedTypeFirst(t, CacheException.class); } }