本文整理汇总了Java中net.spy.memcached.ops.ConcatenationType类的典型用法代码示例。如果您正苦于以下问题:Java ConcatenationType类的具体用法?Java ConcatenationType怎么用?Java ConcatenationType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConcatenationType类属于net.spy.memcached.ops包,在下文中一共展示了ConcatenationType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cmdMap
import net.spy.memcached.ops.ConcatenationType; //导入依赖的package包/类
private static byte cmdMap(ConcatenationType t) {
byte rv;
switch (t) {
case append:
rv = APPEND;
break;
case prepend:
rv = PREPEND;
break;
default:
rv = DUMMY_OPCODE;
}
// Check fall-through.
assert rv != DUMMY_OPCODE : "Unhandled store type: " + t;
return rv;
}
示例2: asyncCat
import net.spy.memcached.ops.ConcatenationType; //导入依赖的package包/类
private <T> Future<Boolean> asyncCat(
ConcatenationType catType, long cas, String key,
T value, Transcoder<T> tc) {
CachedData co=tc.encode(value);
final CountDownLatch latch=new CountDownLatch(1);
final OperationFuture<Boolean> rv=new OperationFuture<Boolean>(latch,
operationTimeout);
Operation op=opFact.cat(catType, cas, key, co.getData(),
new OperationCallback() {
public void receivedStatus(OperationStatus val) {
rv.set(val.isSuccess());
}
public void complete() {
latch.countDown();
}});
rv.setOperation(op);
addOp(key, op);
return rv;
}
示例3: ConcatenationOperationImpl
import net.spy.memcached.ops.ConcatenationType; //导入依赖的package包/类
public ConcatenationOperationImpl(ConcatenationType t, String k, byte[] d,
long c, OperationCallback cb) {
super(cmdMap(t), generateOpaque(), k, cb);
data = d;
cas = c;
catType = t;
}
示例4: cmdMap
import net.spy.memcached.ops.ConcatenationType; //导入依赖的package包/类
private static int cmdMap(ConcatenationType t) {
int rv=-1;
switch(t) {
case append: rv=APPEND; break;
case prepend: rv=PREPEND; break;
}
// Check fall-through.
assert rv != -1 : "Unhandled store type: " + t;
return rv;
}
示例5: ConcatenationOperationImpl
import net.spy.memcached.ops.ConcatenationType; //导入依赖的package包/类
public ConcatenationOperationImpl(ConcatenationType t, String k,
byte[] d, long c, OperationCallback cb) {
super(cmdMap(t), generateOpaque(), cb);
key=k;
data=d;
cas=c;
catType=t;
}
示例6: ConcatenationOperationImpl
import net.spy.memcached.ops.ConcatenationType; //导入依赖的package包/类
public ConcatenationOperationImpl(ConcatenationType t, String k,
byte[] d, OperationCallback cb) {
super(t.name(), k, 0, 0, d, cb);
concatType = t;
if (t == ConcatenationType.append)
setAPIType(APIType.APPEND);
else if (t == ConcatenationType.prepend)
setAPIType(APIType.PREPEND);
}
示例7: testConcatenationOperationAppendCloning
import net.spy.memcached.ops.ConcatenationType; //导入依赖的package包/类
public void testConcatenationOperationAppendCloning() {
long casId = 82757248;
ConcatenationOperation op = ofact.cat(ConcatenationType.append, casId,
TEST_KEY, testData, genericCallback);
ConcatenationOperation op2 = cloneOne(
ConcatenationOperation.class, op);
assertKey(op2);
assertSame(ConcatenationType.append, op2.getStoreType());
assertCallback(op2);
}
示例8: testConcatenationOperationPrependCloning
import net.spy.memcached.ops.ConcatenationType; //导入依赖的package包/类
public void testConcatenationOperationPrependCloning() {
long casId = 82757248;
ConcatenationOperation op = ofact.cat(ConcatenationType.prepend, casId,
TEST_KEY, testData, genericCallback);
ConcatenationOperation op2 = cloneOne(
ConcatenationOperation.class, op);
assertKey(op2);
assertSame(ConcatenationType.prepend, op2.getStoreType());
assertCallback(op2);
}
示例9: cat
import net.spy.memcached.ops.ConcatenationType; //导入依赖的package包/类
public ConcatenationOperation cat(ConcatenationType catType, long casId,
String key, byte[] data, OperationCallback cb) {
return new ConcatenationOperationImpl(catType, key, data, casId, cb);
}
示例10: getStoreType
import net.spy.memcached.ops.ConcatenationType; //导入依赖的package包/类
public ConcatenationType getStoreType() {
return catType;
}
示例11: cat
import net.spy.memcached.ops.ConcatenationType; //导入依赖的package包/类
public ConcatenationOperation cat(ConcatenationType catType, long casId,
String key, byte[] data, OperationCallback cb) {
return new ConcatenationOperationImpl(catType, key, data, cb);
}
示例12: ConcatenationOperationImpl
import net.spy.memcached.ops.ConcatenationType; //导入依赖的package包/类
public ConcatenationOperationImpl(ConcatenationType t, String k, byte[] d,
OperationCallback cb) {
super(t.name(), k, 0, 0, d, cb);
concatType = t;
}
示例13: getStoreType
import net.spy.memcached.ops.ConcatenationType; //导入依赖的package包/类
public ConcatenationType getStoreType() {
return concatType;
}
示例14: cat
import net.spy.memcached.ops.ConcatenationType; //导入依赖的package包/类
public ConcatenationOperation cat(ConcatenationType catType, long casId,
String key, byte[] data, OperationCallback cb) {
return new ConcatenationOperationImpl(catType, key, data, casId, cb);
}
示例15: getStoreType
import net.spy.memcached.ops.ConcatenationType; //导入依赖的package包/类
public ConcatenationType getStoreType() {
return catType;
}