Search in sources :

Example 1 with CompositeIterable

use of org.redisson.misc.CompositeIterable in project redisson by redisson.

the class RedissonKeys method getKeysByPattern.

public Iterable<String> getKeysByPattern(final String pattern, final int count) {
    List<Iterable<String>> iterables = new ArrayList<Iterable<String>>();
    for (final MasterSlaveEntry entry : commandExecutor.getConnectionManager().getEntrySet()) {
        Iterable<String> iterable = new Iterable<String>() {

            @Override
            public Iterator<String> iterator() {
                return createKeysIterator(entry, pattern, count);
            }
        };
        iterables.add(iterable);
    }
    return new CompositeIterable<String>(iterables);
}
Also used : CompositeIterable(org.redisson.misc.CompositeIterable) MasterSlaveEntry(org.redisson.connection.MasterSlaveEntry) ArrayList(java.util.ArrayList) CompositeIterable(org.redisson.misc.CompositeIterable)

Aggregations

ArrayList (java.util.ArrayList)1 MasterSlaveEntry (org.redisson.connection.MasterSlaveEntry)1 CompositeIterable (org.redisson.misc.CompositeIterable)1