@Test(expected = ClientException.class) public void addSetMembersWithoutGraphId() { List<String> members = new ArrayList<String>(); members.add("do_1234567"); members.add("do_890"); SetCacheManager.addSetMembers(null, "set_123", members); }
public static void addSetMembers(String graphId, String setId, List<String> memberIds) { validateRequired(graphId, setId, memberIds, GraphCacheErrorCodes.ERR_CACHE_ADD_SET_MEMBER.name()); Jedis jedis = getRedisConncetion(); String key = CacheKeyGenerator.getSetMembersKey(graphId, setId); try { String[] members = new String[memberIds.size()]; for (int i = 0; i < memberIds.size(); i++) { members[i] = memberIds.get(i); } jedis.sadd(key, members); } catch (Exception e) { throw new ServerException(GraphCacheErrorCodes.ERR_CACHE_ADD_SET_MEMBER.name(), e.getMessage()); } finally { returnConnection(jedis); } }
SetCacheManager { public static void addSetMembers(String graphId, String setId, List<String> memberIds) { validateRequired(graphId, setId, memberIds, GraphCacheErrorCodes.ERR_CACHE_ADD_SET_MEMBER.name()); Jedis jedis = getRedisConncetion(); String key = CacheKeyGenerator.getSetMembersKey(graphId, setId); try { String[] members = new String[memberIds.size()]; for (int i = 0; i < memberIds.size(); i++) { members[i] = memberIds.get(i); } jedis.sadd(key, members); } catch (Exception e) { throw new ServerException(GraphCacheErrorCodes.ERR_CACHE_ADD_SET_MEMBER.name(), e.getMessage()); } finally { returnConnection(jedis); } } }
SetCacheManager { public static void addSetMembers(String graphId, String setId, List<String> memberIds) { validateRequired(graphId, setId, memberIds, GraphCacheErrorCodes.ERR_CACHE_ADD_SET_MEMBER.name()); Jedis jedis = getRedisConncetion(); String key = CacheKeyGenerator.getSetMembersKey(graphId, setId); try { String[] members = new String[memberIds.size()]; for (int i = 0; i < memberIds.size(); i++) { members[i] = memberIds.get(i); } jedis.sadd(key, members); } catch (Exception e) { throw new ServerException(GraphCacheErrorCodes.ERR_CACHE_ADD_SET_MEMBER.name(), e.getMessage()); } finally { returnConnection(jedis); } }  }
SetCacheManager { public static void addSetMembers(String graphId, String setId, List<String> memberIds) { validateRequired(graphId, setId, memberIds, GraphCacheErrorCodes.ERR_CACHE_ADD_SET_MEMBER.name()); Jedis jedis = getRedisConncetion(); String key = CacheKeyGenerator.getSetMembersKey(graphId, setId); try { String[] members = new String[memberIds.size()]; for (int i = 0; i < memberIds.size(); i++) { members[i] = memberIds.get(i); } jedis.sadd(key, members); } catch (Exception e) { throw new ServerException(GraphCacheErrorCodes.ERR_CACHE_ADD_SET_MEMBER.name(), e.getMessage()); } finally { returnConnection(jedis); } }  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 void addSetMembers(String graphId, String setId, List<String> memberIds) { validateRequired(graphId, setId, memberIds, GraphCacheErrorCodes.ERR_CACHE_ADD_SET_MEMBER.name()); Jedis jedis = getRedisConncetion(); String key = CacheKeyGenerator.getSetMembersKey(graphId, setId); try { String[] members = new String[memberIds.size()]; for (int i = 0; i < memberIds.size(); i++) { members[i] = memberIds.get(i); } jedis.sadd(key, members); } catch (Exception e) { throw new ServerException(GraphCacheErrorCodes.ERR_CACHE_ADD_SET_MEMBER.name(), e.getMessage()); } finally { returnConnection(jedis); } }  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);  }