예제 #1
0
        private IList <Endpoint> RouteEndpoints(string dbName)
        {
            CoreTopology            filtered = _topologyService.allCoreServers().filterTopologyByDb(dbName);
            Stream <CoreServerInfo> filteredCoreMemberInfo = filtered.Members().Values.stream();

            return(filteredCoreMemberInfo.map(extractBoltAddress()).map(Endpoint.route).collect(Collectors.toList()));
        }
예제 #2
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));
        }
예제 #3
0
            public override Optional <MemberId> UpstreamDatabase()
            {
                CoreTopology coreTopology = TopologyService.allCoreServers();

                return(Optional.ofNullable(coreTopology.Members().Keys.GetEnumerator().next()));
            }