Package net.spy.memcached.ops
Class BaseOperationFactory
- java.lang.Object
-
- net.spy.memcached.ops.BaseOperationFactory
-
- All Implemented Interfaces:
OperationFactory
- Direct Known Subclasses:
AsciiOperationFactory
,BinaryOperationFactory
public abstract class BaseOperationFactory extends java.lang.Object implements OperationFactory
Base class for operation factories.There is little common code between OperationFactory implementations, but some exists, and is complicated and likely to cause problems.
-
-
Constructor Summary
Constructors Constructor Description BaseOperationFactory()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.util.Collection<Operation>
clone(KeyedOperation op)
Clone an operation.protected abstract java.util.Collection<? extends Operation>
cloneGet(KeyedOperation op)
private java.lang.String
first(java.util.Collection<java.lang.String> keys)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.spy.memcached.OperationFactory
cas, cat, delete, delete, flush, get, get, getAndTouch, getl, gets, keyStats, mutate, noop, observe, replicaGet, replicaGets, saslAuth, saslMechs, saslStep, stats, store, tapAck, tapBackfill, tapCustom, tapDump, touch, unlock, version
-
-
-
-
Method Detail
-
first
private java.lang.String first(java.util.Collection<java.lang.String> keys)
-
clone
public java.util.Collection<Operation> clone(KeyedOperation op)
Description copied from interface:OperationFactory
Clone an operation.This is used for requeueing operations after a server is found to be down.
Note that it returns more than one operation because a multi-get could potentially need to be played against a large number of underlying servers. In this case, there's a separate operation for each, and callback façade to reassemble them. It is left up to the operation pipeline to perform whatever optimization is required to turn these back into multi-gets.
- Specified by:
clone
in interfaceOperationFactory
- Parameters:
op
- the operation to clone- Returns:
- a new operation for each key in the original operation
-
cloneGet
protected abstract java.util.Collection<? extends Operation> cloneGet(KeyedOperation op)
-
-