当前位置: 首页>>代码示例>>Java>>正文


Java MutatorOperation类代码示例

本文整理汇总了Java中net.spy.memcached.ops.MutatorOperation的典型用法代码示例。如果您正苦于以下问题:Java MutatorOperation类的具体用法?Java MutatorOperation怎么用?Java MutatorOperation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MutatorOperation类属于net.spy.memcached.ops包,在下文中一共展示了MutatorOperation类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getOperationName

import net.spy.memcached.ops.MutatorOperation; //导入依赖的package包/类
public static <T extends Operation> String getOperationName(T operation) {

      //TODO optimize. Convert multiple if/else to switch or map.get()
      String op;
      if (operation instanceof StoreOperation) {
        op = ((StoreOperation) operation).getStoreType().name();
      } else if (operation instanceof ConcatenationOperation) {
        op = ((ConcatenationOperation) operation).getStoreType().name();
      } else if (operation instanceof GetsOperation) {
        op = "get";
      } else if (operation instanceof GetOperation) {
        op = "get";
      } else if (operation instanceof GetAndTouchOperation) {
        op = "gat";
      } else if (operation instanceof MutatorOperation) {
        op = ((MutatorOperation) operation).getType().name();
      } else {
        op = Operations.getOperationName(operation.getClass());
      }
      return op;
    }
 
开发者ID:ApptuitAI,项目名称:JInsight,代码行数:22,代码来源:SpymemcachedRuleHelper.java

示例2: testMutatorOperationIncrCloning

import net.spy.memcached.ops.MutatorOperation; //导入依赖的package包/类
@Override
public void testMutatorOperationIncrCloning() {
	int exp = 823862;
	long def = 28775;
	int by = 7735;
	MutatorOperation op = ofact.mutate(Mutator.incr, TEST_KEY, by, def,
			exp, genericCallback);

	MutatorOperation op2 = cloneOne(MutatorOperation.class, op);
	assertKey(op2);
	assertEquals(-1, op2.getExpiration());
	assertEquals(-1, op2.getDefault());
	assertEquals(by, op2.getBy());
	assertSame(Mutator.incr, op2.getType());
	assertCallback(op2);
}
 
开发者ID:naver,项目名称:arcus-java-client,代码行数:17,代码来源:OperationFactoryTest.java

示例3: testMutatorOperationDecrCloning

import net.spy.memcached.ops.MutatorOperation; //导入依赖的package包/类
@Override
public void testMutatorOperationDecrCloning() {
	int exp = 823862;
	long def = 28775;
	int by = 7735;
	MutatorOperation op = ofact.mutate(Mutator.decr, TEST_KEY, by, def,
			exp, genericCallback);

	MutatorOperation op2 = cloneOne(MutatorOperation.class, op);
	assertKey(op2);
	assertEquals(-1, op2.getExpiration());
	assertEquals(-1, op2.getDefault());
	assertEquals(by, op2.getBy());
	assertSame(Mutator.decr, op2.getType());
	assertCallback(op2);
}
 
开发者ID:naver,项目名称:arcus-java-client,代码行数:17,代码来源:OperationFactoryTest.java

示例4: testMutatorOperationIncrCloning

import net.spy.memcached.ops.MutatorOperation; //导入依赖的package包/类
public void testMutatorOperationIncrCloning() {
	int exp = 823862;
	long def = 28775;
	int by = 7735;
	MutatorOperation op = ofact.mutate(Mutator.incr, TEST_KEY, by, def,
			exp, genericCallback);

	MutatorOperation op2 = cloneOne(MutatorOperation.class, op);
	assertKey(op2);
	assertEquals(exp, op2.getExpiration());
	assertEquals(def, op2.getDefault());
	assertEquals(by, op2.getBy());
	assertSame(Mutator.incr, op2.getType());
	assertCallback(op2);
}
 
开发者ID:naver,项目名称:arcus-java-client,代码行数:16,代码来源:OperationFactoryTestBase.java

示例5: testMutatorOperationDecrCloning

import net.spy.memcached.ops.MutatorOperation; //导入依赖的package包/类
public void testMutatorOperationDecrCloning() {
	int exp = 823862;
	long def = 28775;
	int by = 7735;
	MutatorOperation op = ofact.mutate(Mutator.decr, TEST_KEY, by, def,
			exp, genericCallback);

	MutatorOperation op2 = cloneOne(MutatorOperation.class, op);
	assertKey(op2);
	assertEquals(exp, op2.getExpiration());
	assertEquals(def, op2.getDefault());
	assertEquals(by, op2.getBy());
	assertSame(Mutator.decr, op2.getType());
	assertCallback(op2);
}
 
开发者ID:naver,项目名称:arcus-java-client,代码行数:16,代码来源:OperationFactoryTestBase.java

示例6: mutate

import net.spy.memcached.ops.MutatorOperation; //导入依赖的package包/类
public MutatorOperation mutate(Mutator m, String key, long by, long def,
    int exp, OperationCallback cb) {
  return new MutatorOperationImpl(m, key, by, def, exp, cb);
}
 
开发者ID:Alachisoft,项目名称:TayzGrid,代码行数:5,代码来源:BinaryOperationFactory.java

示例7: mutate

import net.spy.memcached.ops.MutatorOperation; //导入依赖的package包/类
public MutatorOperation mutate(Mutator m, String key, long by, long exp,
    int def, OperationCallback cb) {
  return new MutatorOperationImpl(m, key, by, cb);
}
 
开发者ID:Alachisoft,项目名称:TayzGrid,代码行数:5,代码来源:AsciiOperationFactory.java

示例8: mutate

import net.spy.memcached.ops.MutatorOperation; //导入依赖的package包/类
public MutatorOperation mutate(Mutator m, String key, int by,
		long def, int exp, OperationCallback cb) {
	return new MutatorOperationImpl(m, key, by, def, exp, cb);
}
 
开发者ID:naver,项目名称:arcus-java-client,代码行数:5,代码来源:BinaryOperationFactory.java

示例9: mutate

import net.spy.memcached.ops.MutatorOperation; //导入依赖的package包/类
/**
 * Create a mutator operation.
 *
 * @param m the mutator type
 * @param key the mutatee key
 * @param by the amount to increment or decrement
 * @param def the default value
 * @param exp expiration in case we need to default (0 if no default)
 * @param cb the status callback
 * @return the new mutator operation
 */
MutatorOperation mutate(Mutator m, String key, long by, long def, int exp,
    OperationCallback cb);
 
开发者ID:Alachisoft,项目名称:TayzGrid,代码行数:14,代码来源:OperationFactory.java

示例10: mutate

import net.spy.memcached.ops.MutatorOperation; //导入依赖的package包/类
/**
 * Create a mutator operation.
 *
 * @param m the mutator type
 * @param key the mutatee key
 * @param by the amount to increment or decrement
 * @param def the default value
 * @param exp expiration in case we need to default (0 if no default)
 * @param cb the status callback
 * @return the new mutator operation
 */
MutatorOperation mutate(Mutator m, String key, int by,
		long def, int exp, OperationCallback cb);
 
开发者ID:naver,项目名称:arcus-java-client,代码行数:14,代码来源:OperationFactory.java


注:本文中的net.spy.memcached.ops.MutatorOperation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。