Examples of KeyCodec


Examples of org.jredis.semantics.KeyCodec

  private FutureStatus mset(byte[][] mappings){
    Future<Response> futureResponse = this.queueRequest(Command.MSET, mappings);
    return new FutureStatus(futureResponse);
  }
  public FutureStatus mset(Map<String, byte[]> keyValueMap){
    KeyCodec codec = DefaultKeyCodec.provider();
    byte[][] mappings = new byte[keyValueMap.size()*2][];
    int i = 0;
    for (Entry<String, byte[]> e : keyValueMap.entrySet()){
      mappings[i++] = codec.encode(e.getKey());
      mappings[i++] = e.getValue();
    }
    return mset(mappings);
  }
View Full Code Here

Examples of org.jredis.semantics.KeyCodec

  private Future<Boolean> msetnx(byte[][] mappings){
    Future<Response> futureResponse = this.queueRequest(Command.MSETNX, mappings);
    return new FutureBoolean(futureResponse);
  }
  public Future<Boolean> msetnx(Map<String, byte[]> keyValueMap){
    KeyCodec codec = DefaultKeyCodec.provider();
    byte[][] mappings = new byte[keyValueMap.size()*2][];
    int i = 0;
    for (Entry<String, byte[]> e : keyValueMap.entrySet()){
      mappings[i++] = codec.encode(e.getKey());
      mappings[i++] = e.getValue();
    }
    return msetnx(mappings);
  }
View Full Code Here

Examples of org.jredis.semantics.KeyCodec

public abstract class BulkSetMapping<T> implements KeyValueSet<T>{
  private final Map<String, T> map = new HashMap<String, T>();
  abstract byte[] toBytes(T value) ;
  public byte[][] getMappings () {
    KeyCodec codec = DefaultKeyCodec.provider();
    byte[][] mappings = new byte[map.size()*2][];
    int i = 0;
    for (Entry<String, T> e : map.entrySet()){
      mappings[i++] = codec.encode(e.getKey());
      mappings[i++] = toBytes(e.getValue());
    }
    return mappings;
  }
View Full Code Here

Examples of org.jredis.semantics.KeyCodec

      throw new ProviderException("Expecting a ValueResponse here => " + e.getLocalizedMessage(), e);
    }
    return resvalue;
  }
  public boolean msetnx(Map<String, byte[]> keyValueMap) throws RedisException {
    KeyCodec codec = DefaultKeyCodec.provider();
    byte[][] mappings = new byte[keyValueMap.size()*2][];
    int i = 0;
    for (Entry<String, byte[]> e : keyValueMap.entrySet()){
      mappings[i++] = codec.encode(e.getKey());
      mappings[i++] = e.getValue();
    }
    return msetnx(mappings);
  }
View Full Code Here

Examples of org.jredis.semantics.KeyCodec

  private void mset(byte[][] mappings) throws RedisException {
    this.serviceRequest(Command.MSET, mappings);
  }
  public void mset(Map<String, byte[]> keyValueMap) throws RedisException {
    KeyCodec codec = DefaultKeyCodec.provider();
    byte[][] mappings = new byte[keyValueMap.size()*2][];
    int i = 0;
    for (Entry<String, byte[]> e : keyValueMap.entrySet()){
      mappings[i++] = codec.encode(e.getKey());
      mappings[i++] = e.getValue();
    }
    mset(mappings);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.