/** * Construct a CacheMap over the given MemcachedClient. * * @param c the client * @param expiration the expiration to set for keys written to the cache * @param prefix a prefix used to make keys in this map unique */ public CacheMap(MemcachedClientIF c, int expiration, String prefix) { super(c, expiration, prefix, c.getTranscoder()); }
/** * Construct a CacheMap over the given MemcachedClient. * * @param c the client * @param expiration the expiration to set for keys written to the cache * @param prefix a prefix used to make keys in this map unique */ public CacheMap(MemcachedClientIF c, int expiration, String prefix) { super(c, expiration, prefix, c.getTranscoder()); }
/** * Construct a CacheMap over the given MemcachedClient. * * @param c the client * @param expiration the expiration to set for keys written to the cache * @param prefix a prefix used to make keys in this map unique */ public CacheMap(MemcachedClientIF c, int expiration, String prefix) { super(c, expiration, prefix, c.getTranscoder()); }
/** * Construct a CacheMap over the given MemcachedClient. * * @param c the client * @param expiration the expiration to set for keys written to the cache * @param prefix a prefix used to make keys in this map unique */ public CacheMap(MemcachedClientIF c, int expiration, String prefix) { super(c, expiration, prefix, c.getTranscoder()); }
/** * Construct a CacheMap over the given MemcachedClient. * * @param c the client * @param expiration the expiration to set for keys written to the cache * @param prefix a prefix used to make keys in this map unique */ public CacheMap(MemcachedClientIF c, int expiration, String prefix) { super(c, expiration, prefix, c.getTranscoder()); }
/** * Construct a CacheMap over the given MemcachedClient. * * @param c the client * @param expiration the expiration to set for keys written to the cache * @param prefix a prefix used to make keys in this map unique */ public CacheMap(MemcachedClientIF c, int expiration, String prefix) { super(c, expiration, prefix, c.getTranscoder()); }
@Override public CacheTranscoder getTranscoder() { return new TranscoderWrapper(memcachedClient.getTranscoder()); }
@Override public CacheTranscoder getTranscoder() { return new TranscoderWrapper(memcachedClient.getTranscoder()); }
@Override public ComposableFuture<Map<K, V>> getBulkAsync(final Iterable<? extends K> keys) { final List<String> stringKeys = new ArrayList<>(); final Map<String, K> keysMap = new HashMap<>(); try { for (final K key : keys) { final String stringKey = keyTranslator.translateKey(key); stringKeys.add(stringKey); keysMap.put(stringKey, key); } return SpyFutureHelper.fromBulkGet(() -> { @SuppressWarnings("unchecked") final Transcoder<V> transcoder = (Transcoder<V>) spyClient.getTranscoder(); return spyClient.asyncGetBulk(stringKeys, transcoder); }, keysMap); } catch (final Exception e) { return fromError(e); } }
@Override public ComposableFuture<V> getAsync(final K key) { return SpyFutureHelper.fromGet(() -> { @SuppressWarnings("unchecked") final Transcoder<V> transcoder = (Transcoder<V>) spyClient.getTranscoder(); return spyClient.asyncGet(keyTranslator.translateKey(key), transcoder); }); }
final ComposableFuture<CASValue<V>> getFutureValue = SpyFutureHelper.fromCASValue(() -> { @SuppressWarnings("unchecked") final Transcoder<V> transcoder = (Transcoder<V>) spyClient.getTranscoder(); return spyClient.asyncGets(cacheKey, transcoder); });