Esempio n. 1
0
            internal virtual void SwitchToSlave(InstanceId me)
            {
                InstanceId someOneElseThanMyself = new InstanceId(me.ToIntegerIndex() + 1);

                Listener.memberIsAvailable("master", someOneElseThanMyself, URI.create("cluster://127.0.0.1:2390?serverId=2"), null);
                Listener.memberIsAvailable("slave", me, null, null);
            }
Esempio n. 2
0
        private ClusterClientModule NewClusterClient(LifeSupport life, InstanceId id)
        {
            Config config = Config.defaults(MapUtil.stringMap(ClusterSettings.initial_hosts.name(), _cluster.InitialHostsConfigString, ClusterSettings.server_id.name(), id.ToIntegerIndex().ToString(), ClusterSettings.cluster_server.name(), "0.0.0.0:" + PortAuthority.allocatePort()));

            FormattedLogProvider logProvider = FormattedLogProvider.toOutputStream(System.out);
            SimpleLogService     logService  = new SimpleLogService(logProvider, logProvider);

            return(new ClusterClientModule(life, new Dependencies(), new Monitors(), config, logService, new NotElectableElectionCredentialsProvider()));
        }