@Override public Set<byte[]> sMembers(byte[] key) { Assert.notNull(key, "Key must not be null!"); try { if (isPipelined()) { pipeline(connection.newJedisResult(connection.getRequiredPipeline().smembers(key))); return null; } if (isQueueing()) { transaction(connection.newJedisResult(connection.getRequiredTransaction().smembers(key))); return null; } return connection.getJedis().smembers(key); } catch (Exception ex) { throw convertJedisAccessException(ex); } }
@Override Response<Set<String>> execute(Pipeline jedisPipeline) throws DynoException { return jedisPipeline.smembers(key); }
@Override public Response<Set<String>> smembers(String key) { String command = "smembers"; return instrumented(command, () -> delegated.smembers(key)); }
@Override public Response<Set<byte[]>> smembers(byte[] key) { String command = "smembers"; return instrumented(command, () -> delegated.smembers(key)); }
@Override public Map<AggregateId, List<Event>> getEvents(EventTypeMatcher matcher, String aggregateType, Collection<String> aggregateIds, TimeRange timeRange) { Function<String, Optional<Event>> deserialiser = eventJson -> EventJson.fromString(eventJson, matcher, objectMapper); Pipeline pipeline = jedis.pipelined(); final Map<AggregateId, Response<Set<String>>> responses = aggregateIds.stream() .map(id -> AggregateId.of(aggregateType, id)) .collect(toMap( Function.identity(), id -> pipeline.smembers(id.toString()))); pipeline.sync(); return responses.entrySet().stream() .collect(toMap( Entry::getKey, e -> deserialiseAll(timeRange, deserialiser, e.getValue().get()))); } }
@Override public Map<AggregateId, List<Event>> getEvents(EventTypeMatcher matcher, String aggregateType, Collection<UUID> aggregateIds, TimeRange timeRange) { Function<String, Optional<Event>> deserialiser = eventJson -> EventJson.fromString(eventJson, matcher, objectMapper); Pipeline pipeline = jedis.pipelined(); final Map<AggregateId, Response<Set<String>>> responses = aggregateIds.stream() .map(id -> AggregateId.of(aggregateType, id)) .collect(toMap( Function.identity(), id -> pipeline.smembers(id.toString()))); pipeline.sync(); return responses.entrySet().stream() .collect(toMap( Entry::getKey, e -> deserialiseAll(timeRange, deserialiser, e.getValue().get()))); } }
List<Response<Set<String>>> responses = anyRoles .stream() .map(role -> p.smembers(roleKey(role))) .collect(Collectors.toList()); p.sync();
List<Response<Set<String>>> responses = anyRoles .stream() .map(role -> p.smembers(roleKey(role))) .collect(Collectors.toList()); p.sync();
@Override public Set<byte[]> sMembers(byte[] key) { Assert.notNull(key, "Key must not be null!"); try { if (isPipelined()) { pipeline(connection.newJedisResult(connection.getRequiredPipeline().smembers(key))); return null; } if (isQueueing()) { transaction(connection.newJedisResult(connection.getRequiredTransaction().smembers(key))); return null; } return connection.getJedis().smembers(key); } catch (Exception ex) { throw convertJedisAccessException(ex); } }
@Override public Set<byte[]> sMembers(byte[] key) { Assert.notNull(key, "Key must not be null!"); try { if (isPipelined()) { pipeline(connection.newJedisResult(connection.getRequiredPipeline().smembers(key))); return null; } if (isQueueing()) { transaction(connection.newJedisResult(connection.getRequiredTransaction().smembers(key))); return null; } return connection.getJedis().smembers(key); } catch (Exception ex) { throw convertJedisAccessException(ex); } }