Example usage for com.fasterxml.jackson.databind.util ArrayIterator ArrayIterator

List of usage examples for com.fasterxml.jackson.databind.util ArrayIterator ArrayIterator

Introduction

In this page you can find the example usage for com.fasterxml.jackson.databind.util ArrayIterator ArrayIterator.

Prototype

public ArrayIterator(T[] a) 

Source Link

Usage

From source file:com.netflix.spinnaker.fiat.permissions.RedisPermissionsRepository.java

private Table<String, ResourceType, Response<Map<String, String>>> getAllFromRedis(Set<String> userIds) {
    if (userIds.size() == 0) {
        return HashBasedTable.create();
    }/* w  w  w.ja v a 2  s .c om*/
    try (Jedis jedis = jedisSource.getJedis()) {
        Table<String, ResourceType, Response<Map<String, String>>> responseTable = ArrayTable.create(userIds,
                new ArrayIterator<>(ResourceType.values()));

        Pipeline p = jedis.pipelined();
        for (String userId : userIds) {
            for (ResourceType r : ResourceType.values()) {
                responseTable.put(userId, r, p.hgetAll(userKey(userId, r)));
            }
        }
        p.sync();
        return responseTable;
    } catch (Exception e) {
        log.error("Storage exception reading all entries.", e);
    }
    return null;
}