Package redis.clients.jedis

Examples of redis.clients.jedis.ScanParams


  assertFalse(bResult.getResult().isEmpty());
    }

    @Test
    public void zscanMatch() {
  ScanParams params = new ScanParams();
  params.match("a*");

  jedis.zadd("foo", 2, "b");
  jedis.zadd("foo", 1, "a");
  jedis.zadd("foo", 11, "aa");
  ScanResult<Tuple> result = jedis.zscan("foo", SCAN_POINTER_START,
    params);

  assertEquals(SCAN_POINTER_START, result.getCursor());
  assertFalse(result.getResult().isEmpty());

  // binary
  params = new ScanParams();
  params.match(bbarstar);

  jedis.zadd(bfoo, 2, bbar1);
  jedis.zadd(bfoo, 1, bbar2);
  jedis.zadd(bfoo, 11, bbar3);
  ScanResult<Tuple> bResult = jedis.zscan(bfoo,
View Full Code Here


    }

    @Test
    public void zscanCount() {
  ScanParams params = new ScanParams();
  params.count(2);

  jedis.zadd("foo", 1, "a1");
  jedis.zadd("foo", 2, "a2");
  jedis.zadd("foo", 3, "a3");
  jedis.zadd("foo", 4, "a4");
  jedis.zadd("foo", 5, "a5");

  ScanResult<Tuple> result = jedis.zscan("foo", SCAN_POINTER_START,
    params);

  assertFalse(result.getResult().isEmpty());

  // binary
  params = new ScanParams();
  params.count(2);

  jedis.zadd(bfoo, 2, bbar1);
  jedis.zadd(bfoo, 1, bbar2);
  jedis.zadd(bfoo, 11, bbar3);
View Full Code Here

  assertFalse(bResult.getResult().isEmpty());
    }

    @Test
    public void hscanMatch() {
  ScanParams params = new ScanParams();
  params.match("a*");

  jedis.hset("foo", "b", "b");
  jedis.hset("foo", "a", "a");
  jedis.hset("foo", "aa", "aa");
  ScanResult<Map.Entry<String, String>> result = jedis.hscan("foo",
    SCAN_POINTER_START, params);

  assertEquals(SCAN_POINTER_START, result.getCursor());
  assertFalse(result.getResult().isEmpty());

  // binary
  params = new ScanParams();
  params.match(bbarstar);

  jedis.hset(bfoo, bbar, bcar);
  jedis.hset(bfoo, bbar1, bcar);
  jedis.hset(bfoo, bbar2, bcar);
  jedis.hset(bfoo, bbar3, bcar);
View Full Code Here

  assertFalse(bResult.getResult().isEmpty());
    }

    @Test
    public void hscanCount() {
  ScanParams params = new ScanParams();
  params.count(2);

  for (int i = 0; i < 10; i++) {
      jedis.hset("foo", "a" + i, "a" + i);
  }

  ScanResult<Map.Entry<String, String>> result = jedis.hscan("foo",
    SCAN_POINTER_START, params);

  assertFalse(result.getResult().isEmpty());

  // binary
  params = new ScanParams();
  params.count(2);

  jedis.hset(bfoo, bbar, bcar);
  jedis.hset(bfoo, bbar1, bcar);
  jedis.hset(bfoo, bbar2, bcar);
  jedis.hset(bfoo, bbar3, bcar);
View Full Code Here

  assertFalse(bResult.getResult().isEmpty());
    }

    @Test
    public void sscanMatch() {
  ScanParams params = new ScanParams();
  params.match("a*");

  jedis.sadd("foo", "b", "a", "aa");
  ScanResult<String> result = jedis.sscan("foo", SCAN_POINTER_START,
    params);

  assertEquals(SCAN_POINTER_START, result.getCursor());
  assertFalse(result.getResult().isEmpty());

  // binary
  params = new ScanParams();
  params.match(bbarstar);

  jedis.sadd(bfoo, bbar1, bbar2, bbar3);
  ScanResult<byte[]> bResult = jedis.sscan(bfoo,
    SCAN_POINTER_START_BINARY, params);

View Full Code Here

  assertFalse(bResult.getResult().isEmpty());
    }

    @Test
    public void sscanCount() {
  ScanParams params = new ScanParams();
  params.count(2);

  jedis.sadd("foo", "a1", "a2", "a3", "a4", "a5");

  ScanResult<String> result = jedis.sscan("foo", SCAN_POINTER_START,
    params);

  assertFalse(result.getResult().isEmpty());

  // binary
  params = new ScanParams();
  params.count(2);

  jedis.sadd(bfoo, bbar1, bbar2, bbar3);
  ScanResult<byte[]> bResult = jedis.sscan(bfoo,
    SCAN_POINTER_START_BINARY, params);
View Full Code Here

  assertFalse(bResult.getResult().isEmpty());
    }

    @Test
    public void scanMatch() {
  ScanParams params = new ScanParams();
  params.match("a*");

  jedis.set("b", "b");
  jedis.set("a", "a");
  jedis.set("aa", "aa");
  ScanResult<String> result = jedis.scan(SCAN_POINTER_START, params);

  assertEquals(SCAN_POINTER_START, result.getCursor());
  assertFalse(result.getResult().isEmpty());

  // binary
  params = new ScanParams();
  params.match(bfoostar);

  jedis.set(bfoo1, bbar);
  jedis.set(bfoo2, bbar);
  jedis.set(bfoo3, bbar);

View Full Code Here

  assertFalse(bResult.getResult().isEmpty());
    }

    @Test
    public void scanCount() {
  ScanParams params = new ScanParams();
  params.count(2);

  for (int i = 0; i < 10; i++) {
      jedis.set("a" + i, "a" + i);
  }

  ScanResult<String> result = jedis.scan(SCAN_POINTER_START, params);

  assertFalse(result.getResult().isEmpty());

  // binary
  params = new ScanParams();
  params.count(2);

  jedis.set(bfoo1, bbar);
  jedis.set(bfoo2, bbar);
  jedis.set(bfoo3, bbar);
View Full Code Here

 
  protected Set<String> getResult() {
    Set<String> nodekeys = new HashSet<String>();
    assert(container != null);
   
    ScanParams params = new ScanParams();
    params.match(container + keyPattern);
    ScanResult<String> result;
    String cursor = SCAN_POINTER_START;
    do {
      result = jedis.scan(cursor, params);
      nodekeys.addAll(result.getResult());
View Full Code Here

        if (isQueueing() || isPipelined()) {
          throw new UnsupportedOperationException("'SCAN' cannot be called in pipeline / transaction mode.");
        }

        ScanParams params = prepareScanParams(options);
        redis.clients.jedis.ScanResult<String> result = jedis.scan(Long.toString(cursorId), params);
        return new ScanIteration<byte[]>(Long.valueOf(result.getStringCursor()), JedisConverters.stringListToByteList()
            .convert(result.getResult()));
      }
View Full Code Here

TOP

Related Classes of redis.clients.jedis.ScanParams

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.