@Test public void createSet() { List<String> members = new ArrayList<String>(); members.add("test"); members.add("data"); SetCacheManager.createSet("domain", "set_123", members); List<String> membersList = SetCacheManager.getSetMembers("domain", "set_123"); Assert.assertEquals(false, membersList.isEmpty()); Assert.assertEquals(true, membersList.contains("data")); }
public static void createSet(String graphId, String setId, List<String> members) { validateRequired(graphId, setId, members, GraphCacheErrorCodes.ERR_CACHE_CREATE_SET_ERROR.name()); String key = CacheKeyGenerator.getSetMembersKey(graphId, setId); Jedis jedis = getRedisConncetion(); try { String[] tempMembers = new String[members.size()]; members.toArray(tempMembers); jedis.sadd(key, tempMembers); } finally { returnConnection(jedis); } }
SetCacheManager { public static void createSet(String graphId, String setId, List<String> members) { validateRequired(graphId, setId, members, GraphCacheErrorCodes.ERR_CACHE_CREATE_SET_ERROR.name()); String key = CacheKeyGenerator.getSetMembersKey(graphId, setId); Jedis jedis = getRedisConncetion(); try { String[] tempMembers = new String[members.size()]; members.toArray(tempMembers); jedis.sadd(key, tempMembers); } finally { returnConnection(jedis); } } }
SetCacheManager { public static void createSet(String graphId, String setId, List<String> members) { validateRequired(graphId, setId, members, GraphCacheErrorCodes.ERR_CACHE_CREATE_SET_ERROR.name()); String key = CacheKeyGenerator.getSetMembersKey(graphId, setId); Jedis jedis = getRedisConncetion(); try { String[] tempMembers = new String[members.size()]; members.toArray(tempMembers); jedis.sadd(key, tempMembers); } finally { returnConnection(jedis); } }  }
SetCacheManager { public static void createSet(String graphId, String setId, List<String> members) { validateRequired(graphId, setId, members, GraphCacheErrorCodes.ERR_CACHE_CREATE_SET_ERROR.name()); String key = CacheKeyGenerator.getSetMembersKey(graphId, setId); Jedis jedis = getRedisConncetion(); try { String[] tempMembers = new String[members.size()]; members.toArray(tempMembers); jedis.sadd(key, tempMembers); } 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 createSet(String graphId, String setId, List<String> members) { validateRequired(graphId, setId, members, GraphCacheErrorCodes.ERR_CACHE_CREATE_SET_ERROR.name()); String key = CacheKeyGenerator.getSetMembersKey(graphId, setId); Jedis jedis = getRedisConncetion(); try { String[] tempMembers = new String[members.size()]; members.toArray(tempMembers); jedis.sadd(key, tempMembers); } 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);  }