use of redis.clients.jedis.commands.JedisCommands in project conductor by Netflix.
the class DynoProxy method hgetAll.
public Map<String, String> hgetAll(String key) {
Map<String, String> m = new HashMap<>();
JedisCommands dyno = dynoClient;
int cursor = 0;
do {
ScanResult<Entry<String, String>> scanResult = dyno.hscan(key, "" + cursor);
cursor = Integer.parseInt(scanResult.getCursor());
for (Entry<String, String> r : scanResult.getResult()) {
m.put(r.getKey(), r.getValue());
}
} while (cursor > 0);
return m;
}
use of redis.clients.jedis.commands.JedisCommands in project conductor by Netflix.
the class DynoProxy method smembers.
public Set<String> smembers(String key) {
logger.trace("smembers {}", key);
JedisCommands client = dynoClient;
Set<String> r = new HashSet<>();
int cursor = 0;
ScanParams sp = new ScanParams();
sp.count(50);
do {
ScanResult<String> scanResult = client.sscan(key, "" + cursor, sp);
cursor = Integer.parseInt(scanResult.getCursor());
r.addAll(scanResult.getResult());
} while (cursor > 0);
return r;
}
use of redis.clients.jedis.commands.JedisCommands in project conductor by Netflix.
the class DynoProxy method hkeys.
public Set<String> hkeys(String key) {
logger.trace("hkeys {}", key);
JedisCommands client = dynoClient;
Set<String> keys = new HashSet<>();
int cursor = 0;
do {
ScanResult<Entry<String, String>> sr = client.hscan(key, "" + cursor);
cursor = Integer.parseInt(sr.getCursor());
List<Entry<String, String>> result = sr.getResult();
for (Entry<String, String> e : result) {
keys.add(e.getKey());
}
} while (cursor > 0);
return keys;
}
use of redis.clients.jedis.commands.JedisCommands in project conductor by Netflix.
the class RedisEventHandlerDAOTest method init.
@Before
public void init() {
Configuration config = new TestConfiguration();
JedisCommands jedisMock = new JedisMock();
DynoProxy dynoClient = new DynoProxy(jedisMock);
redisEventHandlerDAO = new RedisEventHandlerDAO(dynoClient, objectMapper, config);
}
use of redis.clients.jedis.commands.JedisCommands in project conductor by Netflix.
the class RedisExecutionDAOTest method init.
@Before
public void init() {
Configuration config = new TestConfiguration();
JedisCommands jedisMock = new JedisMock();
DynoProxy dynoClient = new DynoProxy(jedisMock);
executionDAO = new RedisExecutionDAO(dynoClient, objectMapper, config);
}
Aggregations