Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/main/java/net/spy/memcached/OperationFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public interface OperationFactory {
* @param cb the callback that will contain the result
* @return a new GetAndTouchOperation
*/
GetOperation getAndTouch(String key, int expiration, GetOperation.Callback cb);
GetOperation getAndTouch(String key, long expiration, GetOperation.Callback cb);

/**
* Gets (with CAS support) the key and resets its timeout.
Expand All @@ -170,7 +170,7 @@ public interface OperationFactory {
* @param cb the callback that will contain the result
* @return a new GetsAndTouchOperation
*/
GetsOperation getsAndTouch(String key, int expiration, GetsOperation.Callback cb);
GetsOperation getsAndTouch(String key, long expiration, GetsOperation.Callback cb);

/**
* Create a mutator operation.
Expand All @@ -184,7 +184,7 @@ public interface OperationFactory {
* @return the new mutator operation
*/
MutatorOperation mutate(Mutator m, String key, int by,
long def, int exp, OperationCallback cb);
long def, long exp, OperationCallback cb);

/**
* Get a new StatsOperation.
Expand All @@ -206,7 +206,7 @@ MutatorOperation mutate(Mutator m, String key, int by,
* @param cb the status callback
* @return the new store operation
*/
StoreOperation store(StoreType storeType, String key, int flags, int exp,
StoreOperation store(StoreType storeType, String key, int flags, long exp,
byte[] data, OperationCallback cb);

/**
Expand All @@ -217,7 +217,7 @@ StoreOperation store(StoreType storeType, String key, int flags, int exp,
* @param cb the status callback
* @return the new touch operation
*/
TouchOperation touch(String key, int expiration, OperationCallback cb);
TouchOperation touch(String key, long expiration, OperationCallback cb);

/**
* Get a concatenation operation.
Expand All @@ -244,7 +244,7 @@ ConcatenationOperation cat(ConcatenationType catType, long casId,
* @return the new store operation
*/
CASOperation cas(StoreType t, String key, long casId, int flags,
int exp, byte[] data, OperationCallback cb);
long exp, byte[] data, OperationCallback cb);

/**
* Create a new version operation.
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/net/spy/memcached/collection/Attributes.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@

public class Attributes extends SpyObject {
public static final Integer DEFAULT_FLAGS = 0;
public static final Integer DEFAULT_EXPIRETIME = 0;
public static final Long DEFAULT_EXPIRETIME = 0L;

protected Integer flags;
protected Integer expireTime;
protected Long expireTime;
protected CollectionType type;

private String str;

public Attributes() {
}

public Attributes(Integer expireTime) {
public Attributes(long expireTime) {
this.expireTime = expireTime;
}

Expand Down Expand Up @@ -79,7 +79,7 @@ public void setAttribute(String attribute) {
if ("flags".equals(name)) {
flags = Integer.parseInt(value);
} else if ("expiretime".equals(name)) {
expireTime = Integer.parseInt(value);
expireTime = Long.parseLong(value);
} else if ("type".equals(name)) {
type = CollectionType.find(value);
}
Expand All @@ -89,15 +89,15 @@ public void setAttribute(String attribute) {
}
}

public void setExpireTime(Integer expireTime) {
public void setExpireTime(long expireTime) {
this.expireTime = expireTime;
}

public Integer getFlags() {
return flags;
}

public Integer getExpireTime() {
public Long getExpireTime() {
return expireTime;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class BTreeCreate extends CollectionCreate {

private static final String COMMAND = "bop create";

public BTreeCreate(int flags, Integer expTime, Long maxCount,
public BTreeCreate(int flags, Long expTime, Long maxCount,
CollectionOverflowAction overflowAction, Boolean readable, boolean noreply) {
super(CollectionType.btree, flags, expTime, maxCount, overflowAction, readable, noreply);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class CollectionAttributes extends Attributes {
public CollectionAttributes() {
}

public CollectionAttributes(Integer expireTime,
public CollectionAttributes(long expireTime,
Long maxCount, CollectionOverflowAction overflowAction) {
this.expireTime = expireTime;
this.maxCount = maxCount;
Expand Down Expand Up @@ -100,7 +100,7 @@ public void setAttribute(String attribute) {
if ("flags".equals(name)) {
flags = Integer.parseInt(value);
} else if ("expiretime".equals(name)) {
expireTime = Integer.parseInt(value);
expireTime = Long.parseLong(value);
} else if ("type".equals(name)) {
type = CollectionType.find(value);
} else if ("count".equals(name)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@

public abstract class CollectionCreate {
protected int flags;
protected int expTime;
protected long expTime;
protected long maxCount;
protected CollectionOverflowAction overflowAction;
protected Boolean readable;
protected boolean noreply;

protected String str;

protected CollectionCreate(CollectionType type, int flags, Integer expTime, Long maxCount,
protected CollectionCreate(CollectionType type, int flags, Long expTime, Long maxCount,
CollectionOverflowAction overflowAction, Boolean readable,
boolean noreply) {
checkOverflowAction(type, overflowAction);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/spy/memcached/collection/ListCreate.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class ListCreate extends CollectionCreate {

private static final String COMMAND = "lop create";

public ListCreate(int flags, Integer expTime, Long maxCount,
public ListCreate(int flags, Long expTime, Long maxCount,
CollectionOverflowAction overflowAction, Boolean readable, boolean noreply) {
super(CollectionType.list, flags, expTime, maxCount, overflowAction, readable, noreply);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/spy/memcached/collection/MapCreate.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class MapCreate extends CollectionCreate {

private static final String COMMAND = "mop create";

public MapCreate(int flags, Integer expTime, Long maxCount, Boolean readable, boolean noreply) {
public MapCreate(int flags, Long expTime, Long maxCount, Boolean readable, boolean noreply) {
super(CollectionType.map, flags, expTime, maxCount, null, readable, noreply);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/spy/memcached/collection/SetCreate.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class SetCreate extends CollectionCreate {

private static final String COMMAND = "sop create";

public SetCreate(int flags, Integer expTime, Long maxCount, Boolean readable, boolean noreply) {
public SetCreate(int flags, Long expTime, Long maxCount, Boolean readable, boolean noreply) {
super(CollectionType.set, flags, expTime, maxCount, null, readable, noreply);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/spy/memcached/ops/CASOperation.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public interface CASOperation extends KeyedOperation {
/**
* Get the expiration to be set for this operation.
*/
int getExpiration();
long getExpiration();

/**
* Get the bytes to be set during this operation.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/spy/memcached/ops/MutatorOperation.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ public interface MutatorOperation extends KeyedOperation {
/**
* Get the expiration to set in case of a new entry.
*/
int getExpiration();
long getExpiration();
}
2 changes: 1 addition & 1 deletion src/main/java/net/spy/memcached/ops/StoreOperation.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public interface StoreOperation extends KeyedOperation {
/**
* Get the expiration value to be set.
*/
int getExpiration();
long getExpiration();

/**
* Get the bytes to be set during this operation.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/spy/memcached/ops/TouchOperation.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ public interface TouchOperation extends KeyedOperation {
/**
* Get the expiration to set in case of a new entry.
*/
int getExpiration();
long getExpiration();
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,143 +85,173 @@
*/
public class AsciiOperationFactory extends BaseOperationFactory {

@Override
public DeleteOperation delete(String key, OperationCallback cb) {
return new DeleteOperationImpl(key, cb);
}

@Override
public FlushOperation flush(int delay, OperationCallback cb) {
return new FlushOperationImpl(delay, cb);
}

@Override
public GetOperation get(String key, GetOperation.Callback cb) {
return new GetOperationImpl(key, cb);
}

@Override
public GetOperation get(Collection<String> keys, GetOperation.Callback cb, boolean isMGet) {
return new GetOperationImpl(keys, cb, isMGet);
}

@Override
public GetsOperation gets(String key, GetsOperation.Callback cb) {
return new GetsOperationImpl(key, cb);
}

@Override
public GetsOperation gets(Collection<String> keys, GetsOperation.Callback cb, boolean isMGet) {
return new GetsOperationImpl(keys, cb, isMGet);
}

public GetOperation getAndTouch(String key, int expiration, GetOperation.Callback cb) {
return new GetAndTouchOperationImpl(key, expiration, cb);
@Override
public GetOperation getAndTouch(String key, long exp, GetOperation.Callback cb) {
return new GetAndTouchOperationImpl(key, exp, cb);
}

public GetsOperation getsAndTouch(String key, int expiration, GetsOperation.Callback cb) {
return new GetsAndTouchOperationImpl(key, expiration, cb);
@Override
public GetsOperation getsAndTouch(String key, long exp, GetsOperation.Callback cb) {
return new GetsAndTouchOperationImpl(key, exp, cb);
}

@Override
public MutatorOperation mutate(Mutator m, String key, int by,
long def, int exp, OperationCallback cb) {
long def, long exp, OperationCallback cb) {
return new MutatorOperationImpl(m, key, by, def, exp, cb);
}

@Override
public StatsOperation stats(String arg, StatsOperation.Callback cb) {
return new StatsOperationImpl(arg, cb);
}

@Override
public StoreOperation store(StoreType storeType, String key, int flags,
int exp, byte[] data, OperationCallback cb) {
long exp, byte[] data, OperationCallback cb) {
return new StoreOperationImpl(storeType, key, flags, exp, data, cb);
}

public TouchOperation touch(String key, int expiration, OperationCallback cb) {
return new TouchOperationImpl(key, expiration, cb);
@Override
public TouchOperation touch(String key, long exp, OperationCallback cb) {
return new TouchOperationImpl(key, exp, cb);
}

@Override
public VersionOperation version(OperationCallback cb) {
return new VersionOperationImpl(cb);
}

@Override
public NoopOperation noop(OperationCallback cb) {
return new VersionOperationImpl(cb);
}

@Override
public CASOperation cas(StoreType type, String key, long casId, int flags,
int exp, byte[] data, OperationCallback cb) {
long exp, byte[] data, OperationCallback cb) {
return new CASOperationImpl(key, casId, flags, exp, data, cb);
}

@Override
public ConcatenationOperation cat(ConcatenationType catType,
long casId,
String key, byte[] data, OperationCallback cb) {
return new ConcatenationOperationImpl(catType, key, data, cb);
}

@Override
public SASLMechsOperation saslMechs(boolean isInternal, OperationCallback cb) {
return new SASLMechsOperationImpl(isInternal, cb);
}

@Override
public SASLStepOperation saslStep(SaslClient sc, byte[] challenge, OperationCallback cb) {
return new SASLStepOperationImpl(sc, challenge, cb);
}

@Override
public SASLAuthOperation saslAuth(SaslClient sc, OperationCallback cb) {
return new SASLAuthOperationImpl(sc, cb);
}

@Override
public SetAttrOperation setAttr(String key, Attributes attrs,
OperationCallback cb) {
return new SetAttrOperationImpl(key, attrs, cb);
}

@Override
public GetAttrOperation getAttr(String key, GetAttrOperation.Callback cb) {
return new GetAttrOperationImpl(key, cb);
}

@Override
public CollectionInsertOperation collectionInsert(String key, String subkey,
CollectionInsert<?> collectionInsert,
byte[] data, OperationCallback cb) {
return new CollectionInsertOperationImpl(key, subkey,
collectionInsert, data, cb);
collectionInsert, data, cb);
}

@Override
public CollectionPipedInsertOperation collectionPipedInsert(String key,
CollectionPipedInsert<?> insert,
OperationCallback cb) {
return new CollectionPipedInsertOperationImpl(key, insert, cb);
}

@Override
public CollectionGetOperation collectionGet(String key,
CollectionGet collectionGet,
CollectionGetOperation.Callback cb) {
return new CollectionGetOperationImpl(key, collectionGet, cb);
}

@Override
public CollectionDeleteOperation collectionDelete(String key,
CollectionDelete collectionDelete,
OperationCallback cb) {
return new CollectionDeleteOperationImpl(key, collectionDelete, cb);
}

@Override
public CollectionExistOperation collectionExist(String key, String subkey,
CollectionExist collectionExist,
OperationCallback cb) {
return new CollectionExistOperationImpl(key, subkey, collectionExist, cb);
}

@Override
public CollectionCreateOperation collectionCreate(String key,
CollectionCreate collectionCreate,
OperationCallback cb) {
return new CollectionCreateOperationImpl(key, collectionCreate, cb);
}

@Override
public CollectionCountOperation collectionCount(String key,
CollectionCount collectionCount,
OperationCallback cb) {
return new CollectionCountOperationImpl(key, collectionCount, cb);
}

@Override
public FlushOperation flush(String prefix, int delay, boolean noreply, OperationCallback cb) {
return new FlushByPrefixOperationImpl(prefix, delay, noreply, cb);
}

@Override
public BTreeSortMergeGetOperation bopsmget(BTreeSMGet<?> smGet,
BTreeSortMergeGetOperation.Callback cb) {
return new BTreeSortMergeGetOperationImpl(smGet, cb);
Expand All @@ -234,7 +264,7 @@ public CollectionUpdateOperation collectionUpdate(String key,
byte[] data,
OperationCallback cb) {
return new CollectionUpdateOperationImpl(key, subkey, collectionUpdate,
data, cb);
data, cb);
}

@Override
Expand Down
Loading
Loading