@Deprecated public <T> Future<Boolean> add(String key, int exp, T value, final Transcoder<T> tc, EVCacheLatch latch) throws Exception { final CachedData cd; if (value instanceof CachedData) { cd = (CachedData) value; } else { if(tc == null) { cd = getTranscoder().encode(value); } else { cd = tc.encode(value); } } return _add(key, exp, cd, latch); }
@Deprecated public <T> Future<Boolean> add(String key, int exp, T value, Transcoder<T> tc) throws Exception { final CachedData cd; if (value instanceof CachedData) { cd = (CachedData) value; } else { if(tc == null) { cd = getTranscoder().encode(value); } else { cd = tc.encode(value); } } return _add(key, exp, cd, null); }
@Deprecated public <T> Future<Boolean> replace(String key, T value, int timeToLive, EVCacheLatch evcacheLatch) throws Exception { final CachedData cd; if (value instanceof CachedData) { cd = (CachedData) value; } else { cd = getTranscoder().encode(value); } return _replace(key, cd, timeToLive, evcacheLatch); }
@Deprecated public <T> Future<Boolean> add(String key, int exp, T value) throws Exception { final CachedData cd; if (value instanceof CachedData) { cd = (CachedData) value; } else { cd = getTranscoder().encode(value); } return _add(key, exp, cd, null); }
@Deprecated public <T> Future<Boolean> set(String key, T value, int timeToLive, EVCacheLatch evcacheLatch) throws Exception { final CachedData cd; if (value instanceof CachedData) { cd = (CachedData) value; } else { cd = getTranscoder().encode(value); } return _set(key, cd, timeToLive, evcacheLatch); }
@Override public <T> Future<Boolean> set(String key, int exp, T o, Transcoder<T> tc) theMap.put(key, tc.encode(o));
clients[i].incr(canonicalKey, 0, currentValue, timeToLive); } else if (vals[i] != currentValue) { if(cd == null) cd = clients[i].getTranscoder().encode(canonicalKey); if (log.isDebugEnabled()) log.debug("INCR : APP " + _appName + "; Zone " + clients[i].getZone() + " had a value of " + vals[i] + " so setting it to current value = " + currentValue + " for key : " + key);
clients[i].decr(canonicalKey, 0, currentValue, timeToLive); } else if (vals[i] != currentValue) { if(cd == null) cd = clients[i].getTranscoder().encode(canonicalKey); if (log.isDebugEnabled()) log.debug("DECR : APP " + _appName + "; Zone " + clients[i].getZone() + " had a value of " + vals[i]
co = (CachedData) value; } else { co = tc.encode(value);
/** * {@inheritDoc} */ public CachedData encode( final Object object ) { final CachedData result = _delegate.encode( object ); _statistics.register( StatsType.CACHED_DATA_SIZE, result.getData().length ); return result; }
@Override public boolean isMarshallable(Object o) throws Exception { try { transcoder.encode(o); return true; } catch (Throwable t) { return false; } }
@Override public CachedData encode(V v) { ByteArrayDataOutput out = ByteStreams.newDataOutput(); try { valueSerializer.write(v, out); return identityTranscoder.encode(out.toByteArray()); } catch (IOException e) { throw new RuntimeException(e); } }
@Override public CachedObject encode(final Object o) { CachedData cachedData = transcoder.encode(o); return new CachedObjectImpl(cachedData.getFlags(), cachedData.getData()); } }
@Override public CachedObject encode(final Object o) { CachedData cachedData = transcoder.encode(o); return new CachedObjectImpl(cachedData.getFlags(), cachedData.getData()); } }
@Override public CachedData encode(T object) { final CachedData encodedCachedData = wrappedTranscoder.encode(object); final byte[] encodedBytes = encodedCachedData.getData(); if (encodedBytes.length < compressionThresholdByteLength) { return encodedCachedData; } final byte[] compressed = compressor.compress(encodedBytes); final int flags = encodedCachedData.getFlags() | compressionFlag; return new CachedData(flags, compressed, getMaxSize()); }