@Test(expected = ClientException.class) public void getCardinalityWithoutSetId() { SetCacheManager.getSetMembers("domain", null); }
public static List<String> getSetMembers(String graphId, String setId) { validateRequired(graphId, setId, GraphCacheErrorCodes.ERR_CACHE_SET_GET_MEMBERS.name()); String key = CacheKeyGenerator.getSetMembersKey(graphId, setId); List<String> members = new ArrayList<String>(); Jedis jedis = getRedisConncetion(); try { Set<String> memberIds = jedis.smembers(key); if (null != memberIds && !memberIds.isEmpty()) { members.addAll(memberIds); } } finally { returnConnection(jedis); } return members; }
SetCacheManager { public static List<String> getSetMembers(String graphId, String setId) { validateRequired(graphId, setId, GraphCacheErrorCodes.ERR_CACHE_SET_GET_MEMBERS.name()); String key = CacheKeyGenerator.getSetMembersKey(graphId, setId); List<String> members = new ArrayList<String>(); Jedis jedis = getRedisConncetion(); try { Set<String> memberIds = jedis.smembers(key); if (null != memberIds && !memberIds.isEmpty()) { members.addAll(memberIds); } } finally { returnConnection(jedis); } return members; } }
SetCacheManager { public static List<String> getSetMembers(String graphId, String setId) { validateRequired(graphId, setId, GraphCacheErrorCodes.ERR_CACHE_SET_GET_MEMBERS.name()); String key = CacheKeyGenerator.getSetMembersKey(graphId, setId); List<String> members = new ArrayList<String>(); Jedis jedis = getRedisConncetion(); try { Set<String> memberIds = jedis.smembers(key); if (null != memberIds && !memberIds.isEmpty()) { members.addAll(memberIds); } } finally { returnConnection(jedis); } return members; }  }
SetCacheManager { public static List<String> getSetMembers(String graphId, String setId) { validateRequired(graphId, setId, GraphCacheErrorCodes.ERR_CACHE_SET_GET_MEMBERS.name()); String key = CacheKeyGenerator.getSetMembersKey(graphId, setId); List<String> members = new ArrayList<String>(); Jedis jedis = getRedisConncetion(); try { Set<String> memberIds = jedis.smembers(key); if (null != memberIds && !memberIds.isEmpty()) { members.addAll(memberIds); } } finally { returnConnection(jedis); } return members; }  static void createSet(String graphId, String setId, List<String> members); static void addSetMember(String graphId, String setId, String memberId); static void addSetMembers(String graphId, String setId, List<String> memberIds); static void removeSetMember(String graphId, String setId, String memberId); static void dropSet(String graphId, String setId); static List<String> getSetMembers(String graphId, String setId); static Long getSetCardinality(String graphId, String setId); static Boolean isSetMember(String graphId, String setId, String member); }
SetCacheManager { public static List<String> getSetMembers(String graphId, String setId) { validateRequired(graphId, setId, GraphCacheErrorCodes.ERR_CACHE_SET_GET_MEMBERS.name()); String key = CacheKeyGenerator.getSetMembersKey(graphId, setId); List<String> members = new ArrayList<String>(); Jedis jedis = getRedisConncetion(); try { Set<String> memberIds = jedis.smembers(key); if (null != memberIds && !memberIds.isEmpty()) { members.addAll(memberIds); } } finally { returnConnection(jedis); } return members; }  static void createSet(String graphId, String setId, List<String> members); static void addSetMember(String graphId, String setId, String memberId); static void addSetMembers(String graphId, String setId, List<String> memberIds); static void removeSetMember(String graphId, String setId, String memberId); static void dropSet(String graphId, String setId); static List<String> getSetMembers(String graphId, String setId); static Long getSetCardinality(String graphId, String setId); static Boolean isSetMember(String graphId, String setId, String member);  }