Skip to content

Instantly share code, notes, and snippets.

@wburns
Created March 3, 2018 22:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wburns/140e288f27ce7a4b04aec8ee65d9f819 to your computer and use it in GitHub Desktop.
Save wburns/140e288f27ce7a4b04aec8ee65d9f819 to your computer and use it in GitHub Desktop.
CloseableIterator<Entry<Object, Object>> iter = retrieveEntries("org.infinispan.server.hotrod.HotRodServer$ToEmptyBytesKeyValueFilterConverter", 110);
try (Stream<Entry<Object, Object>> stream = Closeables.stream(iter, false, Long.MAX_VALUE, Spliterator.NONNULL)) {
List<Object> keys = stream.skip(100).limit(10).map(Entry::getKey).collect(Collectors.toList());
... do stuff with keys ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment