public Transcoder<Object> getDefaultCollectionTranscoder() { return new CollectionTranscoder(); }
int flags = 0; if (o instanceof String) { b = encodeString((String) o); } else if (o instanceof Long) { b = tu.encodeLong((Long) o); flags |= SPECIAL_BYTEARRAY; } else { b = serialize(o); flags |= SERIALIZED; return new CachedData(flags, b, getMaxSize());
int flags = d.getFlags() & SPECIAL_MASK; if ((d.getFlags() & SERIALIZED) != 0 && data != null) { rv = deserialize(data); } else if (flags != 0 && data != null) { switch (flags) { break; default: getLogger().warn("Undecodeable with flags %x", flags); rv = decodeString(data);
@Override public CollectionFuture<Boolean> asyncSopCreate(String key, ElementValueType type, CollectionAttributes attributes) { int flag = CollectionTranscoder.examineFlags(type); boolean noreply = false; CollectionCreate setCreate = new SetCreate(flag, attributes.getExpireTime(), attributes.getMaxCount(), attributes.getReadable(), noreply); return asyncCollectionCreate(key, setCreate); }
@Override public CollectionFuture<Boolean> asyncMopCreate(String key, ElementValueType type, CollectionAttributes attributes) { int flag = CollectionTranscoder.examineFlags(type); boolean noreply = false; CollectionCreate mapCreate = new MapCreate(flag, attributes.getExpireTime(), attributes.getMaxCount(), attributes.getReadable(), noreply); return asyncCollectionCreate(key, mapCreate); }
@Override public CollectionFuture<Boolean> asyncBopCreate(String key, ElementValueType valueType, CollectionAttributes attributes) { int flag = CollectionTranscoder.examineFlags(valueType); boolean noreply = false; CollectionCreate bTreeCreate = new BTreeCreate(flag, attributes.getExpireTime(), attributes.getMaxCount(), attributes.getOverflowAction(), attributes.getReadable(), noreply); return asyncCollectionCreate(key, bTreeCreate); }
/** * Create an Arcus client for the given memcached server addresses. * * @param cf connection factory to configure connections for this client * @param addrs socket addresses for the memcached servers * @throws IOException if connections cannot be established */ public ArcusClient(ConnectionFactory cf, List<InetSocketAddress> addrs) throws IOException { super(cf, addrs); bulkService = new BulkService(cf.getBulkServiceLoopLimit(), cf.getBulkServiceThreadCount(), cf.getBulkServiceSingleOpTimeout()); collectionTranscoder = new CollectionTranscoder(); smgetKeyChunkSize = cf.getDefaultMaxSMGetKeyChunkSize(); registerMbean(); }
@Override public CollectionFuture<Boolean> asyncLopCreate(String key, ElementValueType type, CollectionAttributes attributes) { int flag = CollectionTranscoder.examineFlags(type); boolean noreply = false; CollectionCreate listCreate = new ListCreate(flag, attributes.getExpireTime(), attributes.getMaxCount(), attributes.getOverflowAction(), attributes.getReadable(), noreply); return asyncCollectionCreate(key, listCreate); }