Exemplo n.º 1
0
        internal static void RefreshGroups(HazelcastInstance hazelcastInstance, string memberId, IList <string> groups)
        {
            MultiMap <string, string> groupsMap = hazelcastInstance.getMultiMap(SERVER_GROUPS_MULTIMAP);
            ICollection <string>      existing  = groupsMap.get(memberId);

//JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter:
            ISet <string> superfluous = existing.Where(t => !groups.Contains(t)).collect(Collectors.toSet());
//JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter:
            ISet <string> missing = groups.Where(t => !existing.Contains(t)).collect(Collectors.toSet());

            missing.forEach(group => groupsMap.put(memberId, group));
            superfluous.forEach(group => groupsMap.remove(memberId, group));
        }