當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。