Search in sources :

Example 1 with NotElectableElectionCredentialsProvider

use of org.neo4j.cluster.protocol.election.NotElectableElectionCredentialsProvider in project neo4j by neo4j.

the class ClusterTopologyChangesIT method newClusterClient.

private ClusterClientModule newClusterClient(LifeSupport life, InstanceId id) {
    Config config = Config.embeddedDefaults(MapUtil.stringMap(ClusterSettings.initial_hosts.name(), cluster.getInitialHostsConfigString(), ClusterSettings.server_id.name(), String.valueOf(id.toIntegerIndex()), ClusterSettings.cluster_server.name(), "0.0.0.0:8888"));
    FormattedLogProvider logProvider = FormattedLogProvider.toOutputStream(System.out);
    SimpleLogService logService = new SimpleLogService(logProvider, logProvider);
    return new ClusterClientModule(life, new Dependencies(), new Monitors(), config, logService, new NotElectableElectionCredentialsProvider());
}
Also used : SimpleLogService(org.neo4j.kernel.impl.logging.SimpleLogService) Config(org.neo4j.kernel.configuration.Config) NotElectableElectionCredentialsProvider(org.neo4j.cluster.protocol.election.NotElectableElectionCredentialsProvider) Monitors(org.neo4j.kernel.monitoring.Monitors) Dependencies(org.neo4j.kernel.impl.util.Dependencies) ClusterClientModule(org.neo4j.cluster.client.ClusterClientModule) FormattedLogProvider(org.neo4j.logging.FormattedLogProvider)

Example 2 with NotElectableElectionCredentialsProvider

use of org.neo4j.cluster.protocol.election.NotElectableElectionCredentialsProvider in project neo4j by neo4j.

the class ArbiterBootstrapper method start.

@SafeVarargs
@Override
public final int start(File homeDir, Optional<File> configFile, Pair<String, String>... configOverrides) {
    Config config = getConfig(configFile, configOverrides);
    try {
        DefaultFileSystemAbstraction fileSystem = new DefaultFileSystemAbstraction();
        life.add(new FileSystemLifecycleAdapter(fileSystem));
        life.add(new Neo4jJobScheduler());
        new ClusterClientModule(life, new Dependencies(), new Monitors(), config, logService(fileSystem, config), new NotElectableElectionCredentialsProvider());
    } catch (LifecycleException e) {
        @SuppressWarnings({ "ThrowableResultOfMethodCallIgnored", "unchecked" }) Throwable cause = peel(e, Predicates.<Throwable>instanceOf(LifecycleException.class));
        if (cause instanceof ChannelException) {
            System.err.println("ERROR: " + cause.getMessage() + (cause.getCause() != null ? ", caused by:" + cause.getCause().getMessage() : ""));
        } else {
            System.err.println("ERROR: Unknown error");
            throw e;
        }
    }
    addShutdownHook();
    life.start();
    return 0;
}
Also used : FileSystemLifecycleAdapter(org.neo4j.io.fs.FileSystemLifecycleAdapter) Neo4jJobScheduler(org.neo4j.kernel.impl.util.Neo4jJobScheduler) LifecycleException(org.neo4j.kernel.lifecycle.LifecycleException) DefaultFileSystemAbstraction(org.neo4j.io.fs.DefaultFileSystemAbstraction) Config(org.neo4j.kernel.configuration.Config) NotElectableElectionCredentialsProvider(org.neo4j.cluster.protocol.election.NotElectableElectionCredentialsProvider) Monitors(org.neo4j.kernel.monitoring.Monitors) Dependencies(org.neo4j.kernel.impl.util.Dependencies) ClusterClientModule(org.neo4j.cluster.client.ClusterClientModule) ChannelException(org.jboss.netty.channel.ChannelException)

Aggregations

ClusterClientModule (org.neo4j.cluster.client.ClusterClientModule)2 NotElectableElectionCredentialsProvider (org.neo4j.cluster.protocol.election.NotElectableElectionCredentialsProvider)2 Config (org.neo4j.kernel.configuration.Config)2 Dependencies (org.neo4j.kernel.impl.util.Dependencies)2 Monitors (org.neo4j.kernel.monitoring.Monitors)2 ChannelException (org.jboss.netty.channel.ChannelException)1 DefaultFileSystemAbstraction (org.neo4j.io.fs.DefaultFileSystemAbstraction)1 FileSystemLifecycleAdapter (org.neo4j.io.fs.FileSystemLifecycleAdapter)1 SimpleLogService (org.neo4j.kernel.impl.logging.SimpleLogService)1 Neo4jJobScheduler (org.neo4j.kernel.impl.util.Neo4jJobScheduler)1 LifecycleException (org.neo4j.kernel.lifecycle.LifecycleException)1 FormattedLogProvider (org.neo4j.logging.FormattedLogProvider)1