congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ScanIteration
Code IndexAdd Tabnine to your IDE (free)

How to use
ScanIteration
in
org.springframework.data.redis.core

Best Java code snippets using org.springframework.data.redis.core.ScanIteration (Showing top 20 results out of 315)

origin: redisson/redisson

  @Override
  protected ScanIteration<Tuple> doScan(byte[] key, long cursorId, ScanOptions options) {
    if (isQueueing() || isPipelined()) {
      throw new UnsupportedOperationException("'ZSCAN' cannot be called in pipeline / transaction mode.");
    }
    List<Object> args = new ArrayList<Object>();
    args.add(key);
    args.add(cursorId);
    if (options.getPattern() != null) {
      args.add("MATCH");
      args.add(options.getPattern());
    }
    if (options.getCount() != null) {
      args.add("COUNT");
      args.add(options.getCount());
    }
    
    RFuture<ListScanResult<Tuple>> f = executorService.readAsync(client, key, ByteArrayCodec.INSTANCE, ZSCAN, args.toArray());
    ListScanResult<Tuple> res = syncFuture(f);
    client = res.getRedisClient();
    return new ScanIteration<Tuple>(res.getPos(), res.getValues());
  }
}.open();
origin: spring-projects/spring-data-redis

private void processScanResult(ScanIteration<T> result) {
  if (result == null) {
    resetDelegate();
    state = CursorState.FINISHED;
    return;
  }
  cursorId = Long.valueOf(result.getCursorId());
  if (isFinished(cursorId)) {
    state = CursorState.FINISHED;
  }
  if (!CollectionUtils.isEmpty(result.getItems())) {
    delegate = result.iterator();
  } else {
    resetDelegate();
  }
}
origin: redisson/redisson

  @Override
  protected ScanIteration<byte[]> doScan(byte[] key, long cursorId, ScanOptions options) {
    if (isQueueing() || isPipelined()) {
      throw new UnsupportedOperationException("'SSCAN' cannot be called in pipeline / transaction mode.");
    }
    List<Object> args = new ArrayList<Object>();
    args.add(key);
    args.add(cursorId);
    if (options.getPattern() != null) {
      args.add("MATCH");
      args.add(options.getPattern());
    }
    if (options.getCount() != null) {
      args.add("COUNT");
      args.add(options.getCount());
    }
    
    RFuture<ListScanResult<byte[]>> f = executorService.readAsync(client, key, ByteArrayCodec.INSTANCE, RedisCommands.SSCAN, args.toArray());
    ListScanResult<byte[]> res = syncFuture(f);
    client = res.getRedisClient();
    return new ScanIteration<byte[]>(res.getPos(), res.getValues());
  }
}.open();
origin: org.springframework.data/spring-data-redis

private void processScanResult(ScanIteration<T> result) {
  if (result == null) {
    resetDelegate();
    state = CursorState.FINISHED;
    return;
  }
  cursorId = Long.valueOf(result.getCursorId());
  if (isFinished(cursorId)) {
    state = CursorState.FINISHED;
  }
  if (!CollectionUtils.isEmpty(result.getItems())) {
    delegate = result.iterator();
  } else {
    resetDelegate();
  }
}
origin: redisson/redisson

  @Override
  protected ScanIteration<Tuple> doScan(byte[] key, long cursorId, ScanOptions options) {
    if (isQueueing() || isPipelined()) {
      throw new UnsupportedOperationException("'ZSCAN' cannot be called in pipeline / transaction mode.");
    }
    List<Object> args = new ArrayList<Object>();
    args.add(key);
    args.add(cursorId);
    if (options.getPattern() != null) {
      args.add("MATCH");
      args.add(options.getPattern());
    }
    if (options.getCount() != null) {
      args.add("COUNT");
      args.add(options.getCount());
    }
    
    RFuture<ListScanResult<Tuple>> f = executorService.readAsync(client, key, ByteArrayCodec.INSTANCE, ZSCAN, args.toArray());
    ListScanResult<Tuple> res = syncFuture(f);
    client = res.getRedisClient();
    return new ScanIteration<Tuple>(res.getPos(), res.getValues());
  }
}.open();
origin: apache/servicemix-bundles

private void processScanResult(ScanIteration<T> result) {
  if (result == null) {
    resetDelegate();
    state = CursorState.FINISHED;
    return;
  }
  cursorId = Long.valueOf(result.getCursorId());
  if (isFinished(cursorId)) {
    state = CursorState.FINISHED;
  }
  if (!CollectionUtils.isEmpty(result.getItems())) {
    delegate = result.iterator();
  } else {
    resetDelegate();
  }
}
origin: redisson/redisson

  @Override
  protected ScanIteration<Entry<byte[], byte[]>> doScan(byte[] key, long cursorId, ScanOptions options) {
    if (isQueueing() || isPipelined()) {
      throw new UnsupportedOperationException("'HSCAN' cannot be called in pipeline / transaction mode.");
    }
    List<Object> args = new ArrayList<Object>();
    args.add(key);
    args.add(cursorId);
    if (options.getPattern() != null) {
      args.add("MATCH");
      args.add(options.getPattern());
    }
    if (options.getCount() != null) {
      args.add("COUNT");
      args.add(options.getCount());
    }
    
    RFuture<MapScanResult<byte[], byte[]>> f = executorService.readAsync(client, key, ByteArrayCodec.INSTANCE, RedisCommands.HSCAN, args.toArray());
    MapScanResult<byte[], byte[]> res = syncFuture(f);
    client = res.getRedisClient();
    return new ScanIteration<Entry<byte[], byte[]>>(res.getPos(), res.getValues());
  }
}.open();
origin: redisson/redisson

  @Override
  protected ScanIteration<Entry<byte[], byte[]>> doScan(byte[] key, long cursorId, ScanOptions options) {
    if (isQueueing() || isPipelined()) {
      throw new UnsupportedOperationException("'HSCAN' cannot be called in pipeline / transaction mode.");
    }
    List<Object> args = new ArrayList<Object>();
    args.add(key);
    args.add(cursorId);
    if (options.getPattern() != null) {
      args.add("MATCH");
      args.add(options.getPattern());
    }
    if (options.getCount() != null) {
      args.add("COUNT");
      args.add(options.getCount());
    }
    
    RFuture<MapScanResult<byte[], byte[]>> f = executorService.readAsync(client, key, ByteArrayCodec.INSTANCE, RedisCommands.HSCAN, args.toArray());
    MapScanResult<byte[], byte[]> res = syncFuture(f);
    client = res.getRedisClient();
    return new ScanIteration<Entry<byte[], byte[]>>(res.getPos(), res.getValues());
  }
}.open();
origin: redisson/redisson

  @Override
  protected ScanIteration<byte[]> doScan(byte[] key, long cursorId, ScanOptions options) {
    if (isQueueing() || isPipelined()) {
      throw new UnsupportedOperationException("'SSCAN' cannot be called in pipeline / transaction mode.");
    }
    List<Object> args = new ArrayList<Object>();
    args.add(key);
    args.add(cursorId);
    if (options.getPattern() != null) {
      args.add("MATCH");
      args.add(options.getPattern());
    }
    if (options.getCount() != null) {
      args.add("COUNT");
      args.add(options.getCount());
    }
    
    RFuture<ListScanResult<byte[]>> f = executorService.readAsync(client, key, ByteArrayCodec.INSTANCE, RedisCommands.SSCAN, args.toArray());
    ListScanResult<byte[]> res = syncFuture(f);
    client = res.getRedisClient();
    return new ScanIteration<byte[]>(res.getPos(), res.getValues());
  }
}.open();
origin: redisson/redisson

  @Override
  protected ScanIteration<Entry<byte[], byte[]>> doScan(byte[] key, long cursorId, ScanOptions options) {
    if (isQueueing() || isPipelined()) {
      throw new UnsupportedOperationException("'HSCAN' cannot be called in pipeline / transaction mode.");
    }
    List<Object> args = new ArrayList<Object>();
    args.add(key);
    args.add(cursorId);
    if (options.getPattern() != null) {
      args.add("MATCH");
      args.add(options.getPattern());
    }
    if (options.getCount() != null) {
      args.add("COUNT");
      args.add(options.getCount());
    }
    
    RFuture<MapScanResult<byte[], byte[]>> f = executorService.readAsync(client, key, ByteArrayCodec.INSTANCE, RedisCommands.HSCAN, args.toArray());
    MapScanResult<byte[], byte[]> res = syncFuture(f);
    client = res.getRedisClient();
    return new ScanIteration<Entry<byte[], byte[]>>(res.getPos(), res.getValues());
  }
}.open();
origin: redisson/redisson

  @Override
  protected ScanIteration<Entry<byte[], byte[]>> doScan(byte[] key, long cursorId, ScanOptions options) {
    if (isQueueing() || isPipelined()) {
      throw new UnsupportedOperationException("'HSCAN' cannot be called in pipeline / transaction mode.");
    }
    List<Object> args = new ArrayList<Object>();
    args.add(key);
    args.add(cursorId);
    if (options.getPattern() != null) {
      args.add("MATCH");
      args.add(options.getPattern());
    }
    if (options.getCount() != null) {
      args.add("COUNT");
      args.add(options.getCount());
    }
    
    RFuture<MapScanResult<byte[], byte[]>> f = executorService.readAsync(client, key, ByteArrayCodec.INSTANCE, RedisCommands.HSCAN, args.toArray());
    MapScanResult<byte[], byte[]> res = syncFuture(f);
    client = res.getRedisClient();
    return new ScanIteration<Entry<byte[], byte[]>>(res.getPos(), res.getValues());
  }
}.open();
origin: redisson/redisson

  @Override
  protected ScanIteration<Tuple> doScan(byte[] key, long cursorId, ScanOptions options) {
    if (isQueueing() || isPipelined()) {
      throw new UnsupportedOperationException("'ZSCAN' cannot be called in pipeline / transaction mode.");
    }
    List<Object> args = new ArrayList<Object>();
    args.add(key);
    args.add(cursorId);
    if (options.getPattern() != null) {
      args.add("MATCH");
      args.add(options.getPattern());
    }
    if (options.getCount() != null) {
      args.add("COUNT");
      args.add(options.getCount());
    }
    
    RFuture<ListScanResult<Tuple>> f = executorService.readAsync(client, key, ByteArrayCodec.INSTANCE, ZSCAN, args.toArray());
    ListScanResult<Tuple> res = syncFuture(f);
    client = res.getRedisClient();
    return new ScanIteration<Tuple>(res.getPos(), res.getValues());
  }
}.open();
origin: redisson/redisson

  @Override
  protected ScanIteration<Tuple> doScan(byte[] key, long cursorId, ScanOptions options) {
    if (isQueueing() || isPipelined()) {
      throw new UnsupportedOperationException("'ZSCAN' cannot be called in pipeline / transaction mode.");
    }
    List<Object> args = new ArrayList<Object>();
    args.add(key);
    args.add(cursorId);
    if (options.getPattern() != null) {
      args.add("MATCH");
      args.add(options.getPattern());
    }
    if (options.getCount() != null) {
      args.add("COUNT");
      args.add(options.getCount());
    }
    
    RFuture<ListScanResult<Tuple>> f = executorService.readAsync(client, key, ByteArrayCodec.INSTANCE, ZSCAN, args.toArray());
    ListScanResult<Tuple> res = syncFuture(f);
    client = res.getRedisClient();
    return new ScanIteration<Tuple>(res.getPos(), res.getValues());
  }
}.open();
origin: redisson/redisson

  @Override
  protected ScanIteration<byte[]> doScan(byte[] key, long cursorId, ScanOptions options) {
    if (isQueueing() || isPipelined()) {
      throw new UnsupportedOperationException("'SSCAN' cannot be called in pipeline / transaction mode.");
    }
    List<Object> args = new ArrayList<Object>();
    args.add(key);
    args.add(cursorId);
    if (options.getPattern() != null) {
      args.add("MATCH");
      args.add(options.getPattern());
    }
    if (options.getCount() != null) {
      args.add("COUNT");
      args.add(options.getCount());
    }
    
    RFuture<ListScanResult<byte[]>> f = executorService.readAsync(client, key, ByteArrayCodec.INSTANCE, RedisCommands.SSCAN, args.toArray());
    ListScanResult<byte[]> res = syncFuture(f);
    client = res.getRedisClient();
    return new ScanIteration<byte[]>(res.getPos(), res.getValues());
  }
}.open();
origin: redisson/redisson

  @Override
  protected ScanIteration<byte[]> doScan(byte[] key, long cursorId, ScanOptions options) {
    if (isQueueing() || isPipelined()) {
      throw new UnsupportedOperationException("'SSCAN' cannot be called in pipeline / transaction mode.");
    }
    List<Object> args = new ArrayList<Object>();
    args.add(key);
    args.add(cursorId);
    if (options.getPattern() != null) {
      args.add("MATCH");
      args.add(options.getPattern());
    }
    if (options.getCount() != null) {
      args.add("COUNT");
      args.add(options.getCount());
    }
    
    RFuture<ListScanResult<byte[]>> f = executorService.readAsync(client, key, ByteArrayCodec.INSTANCE, RedisCommands.SSCAN, args.toArray());
    ListScanResult<byte[]> res = syncFuture(f);
    client = res.getRedisClient();
    return new ScanIteration<byte[]>(res.getPos(), res.getValues());
  }
}.open();
origin: redisson/redisson

return new ScanIteration<byte[]>(pos, res.getValues());
origin: redisson/redisson

return new ScanIteration<byte[]>(pos, res.getValues());
origin: redisson/redisson

return new ScanIteration<byte[]>(pos, res.getValues());
origin: redisson/redisson

return new ScanIteration<byte[]>(pos, res.getValues());
origin: spring-projects/spring-data-redis

@Override
protected ScanIteration<Entry<byte[], byte[]>> doScan(byte[] key, long cursorId, ScanOptions options) {
  if (isQueueing() || isPipelined()) {
    throw new UnsupportedOperationException("'HSCAN' cannot be called in pipeline / transaction mode.");
  }
  io.lettuce.core.ScanCursor scanCursor = connection.getScanCursor(cursorId);
  ScanArgs scanArgs = LettuceConverters.toScanArgs(options);
  MapScanCursor<byte[], byte[]> mapScanCursor = getConnection().hscan(key, scanCursor, scanArgs);
  String nextCursorId = mapScanCursor.getCursor();
  Map<byte[], byte[]> values = mapScanCursor.getMap();
  return new ScanIteration<>(Long.valueOf(nextCursorId), values.entrySet());
}
org.springframework.data.redis.coreScanIteration

Javadoc

ScanIteration holds the values contained in Redis Multibulk reply on exectuting SCANcommand.

Most used methods

  • <init>
  • getCursorId
    The cursor id to be used for subsequent requests.
  • getItems
    Get the items returned.
  • iterator

Popular in Java

  • Reading from database using SQL prepared statement
  • compareTo (BigDecimal)
  • putExtra (Intent)
  • runOnUiThread (Activity)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Runner (org.openjdk.jmh.runner)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now