Exemple #1
0
        private IDictionary <AdminCommandSection, IList <AdminCommand_Provider> > GroupProvidersBySection()
        {
            IList <AdminCommand_Provider> providers = new List <AdminCommand_Provider>();

            _commands.AllProviders.forEach(providers.add);
//JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter:
//JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter:
            return(providers.collect(Collectors.groupingBy(AdminCommand_Provider::commandSection)));
        }
Exemple #2
0
        public virtual ClusterRule WithDatabaseNames(ISet <string> dbNames)
        {
            this._dbNames = dbNames;
            IDictionary <int, string> coreDBMap = CausalClusteringTestHelpers.distributeDatabaseNamesToHostNums(_noCoreMembers, dbNames);
            IDictionary <int, string> rrDBMap   = CausalClusteringTestHelpers.distributeDatabaseNamesToHostNums(_noReadReplicas, dbNames);

//JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter:
            IDictionary <string, long> minCoresPerDb = coreDBMap.SetOfKeyValuePairs().collect(Collectors.groupingBy(DictionaryEntry.getValue, Collectors.counting()));

            IDictionary <int, string> minCoresSettingsMap = new Dictionary <int, string>();

            foreach (KeyValuePair <int, string> entry in coreDBMap.SetOfKeyValuePairs())
            {
                long?minNumCores = Optional.ofNullable(minCoresPerDb[entry.Value]);
                minNumCores.ifPresent(n => minCoresSettingsMap.put(entry.Key, n.ToString()));
            }

            WithInstanceCoreParam(CausalClusteringSettings.database, coreDBMap.get);
            WithInstanceCoreParam(CausalClusteringSettings.minimum_core_cluster_size_at_formation, minCoresSettingsMap.get);
            WithInstanceReadReplicaParam(CausalClusteringSettings.database, rrDBMap.get);
            return(this);
        }
Exemple #3
0
 public static Stream <TransactionResult> CountTransactionByUsername(Stream <string> usernames)
 {
     return(usernames.collect(Collectors.groupingBy(identity(), Collectors.counting())).entrySet().Select(entry => new TransactionResult(entry.Key, entry.Value)
                                                                                                          ));
 }
Exemple #4
0
        public virtual void ForEach(System.Action <string, URI> consumer)
        {
//JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter:
            _entries.collect(Collectors.groupingBy(e => e.key)).ForEach((key, list) => list.Max(System.Collections.IComparer.comparing(e => e.precedence)).ifPresent(e => consumer(key, e.uri)));
        }
Exemple #5
0
        private IDictionary <string, IList <Endpoint> > RouteEndpoints()
        {
            CoreTopology            core = _topologyService.allCoreServers();
            Stream <CoreServerInfo> allCoreMemberInfo = _topologyService.allCoreServers().members().Values.stream();

//JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter:
            IDictionary <string, IList <CoreServerInfo> > coresByDb = allCoreMemberInfo.collect(Collectors.groupingBy(CoreServerInfo::getDatabaseName));

            System.Func <KeyValuePair <string, IList <CoreServerInfo> >, IList <Endpoint> > extractQualifiedBoltAddresses = entry =>
            {
                IList <CoreServerInfo> cores = entry.Value;
                return(cores.Select(extractBoltAddress()).Select(Endpoint.route).ToList());
            };

            return(coresByDb.SetOfKeyValuePairs().ToDictionary(DictionaryEntry.getKey, extractQualifiedBoltAddresses));
        }