Package org.jredis

Examples of org.jredis.RedisType


        List<byte[]> ssres = provider.sort(listkey).ALPHA().LIMIT(0, MEDIUM_CNT).DESC().STORE(destKey).execAsync().get();
        assertNotNull(ssres, "result of srot with STORE should be non-null");
        assertEquals(ssres.size(), 1, "result of sort with STORE should be a list of single entry (the stored list's size)");
        long sortedListSize = Query.Support.unpackValue(ssres);
        assertEquals(sortedListSize, MEDIUM_CNT);
        RedisType type = provider.type(destKey).get();
        assertEquals(type, RedisType.list, "dest key of SORT .. STORE should be a LIST");
        long sslistSize = provider.llen(destKey).get();
        assertEquals(sslistSize, sortedListSize, "result of SORT ... STORE and LLEN of destkey list should be same");
      }
      catch(ExecutionException e){
View Full Code Here


  public <K extends Object> RedisType type(K key) throws RedisException {
    byte[] keybytes = null;
    if((keybytes = getKeyBytes(key)) == null)
      throw new IllegalArgumentException ("invalid key => ["+key+"]");

    RedisType  type = null;
    /* ValueRespose */
    try {
      ValueResponse valResponse = (ValueResponse) this.serviceRequest(Command.TYPE, keybytes);
      String stringValue = valResponse.getStringValue();
      type = RedisType.valueOf(stringValue);
View Full Code Here

      List<byte[]> ssres = provider.sort(listkey).ALPHA().LIMIT(0, MEDIUM_CNT).DESC().STORE(destKey).exec();
      assertNotNull(ssres, "result of srot with STORE should be non-null");
      assertEquals(ssres.size(), 1, "result of sort with STORE should be a list of single entry (the stored list's size)");
      long sortedListSize = Query.Support.unpackValue(ssres);
      assertEquals(sortedListSize, MEDIUM_CNT);
      RedisType type = provider.type(destKey);
      assertEquals(type, RedisType.list, "dest key of SORT .. STORE should be a LIST");
      long sslistSize = provider.llen(destKey);
      assertEquals(sslistSize, sortedListSize, "result of SORT ... STORE and LLEN of destkey list should be same");
     
      Log.log("TEST: SORTED LIST [t.2]");
View Full Code Here

  public RedisType type(String key) throws RedisException {
    byte[] keybytes = null;
    if((keybytes = getKeyBytes(key)) == null)
      throw new IllegalArgumentException ("invalid key => ["+key+"]");

    RedisType  type = null;
    /* ValueRespose */
    try {
      ValueResponse valResponse = (ValueResponse) this.serviceRequest(Command.TYPE, keybytes);
      String stringValue = valResponse.getStringValue();
      type = RedisType.valueOf(stringValue);
View Full Code Here

TOP

Related Classes of org.jredis.RedisType

Copyright © 2018 www.massapicom. 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.