Examples of UsState


Examples of com.netflix.exhibitor.core.state.UsState

    FixedEnsembleBuilder(Exhibitor exhibitor, ClusterState clusterState)
    {
        this.exhibitor = exhibitor;
        this.clusterState = clusterState;
        usState = new UsState(exhibitor);
        fixedEnsembleSize = exhibitor.getConfigManager().getConfig().getInt(IntConfigs.AUTO_MANAGE_INSTANCES_FIXED_ENSEMBLE_SIZE);
    }
View Full Code Here

Examples of com.netflix.exhibitor.core.state.UsState

        exhibitor.getLog().add(ActivityLog.Type.INFO, "Process started via: " + builder.command().get(0));
    }

    private void prepConfigFile(Details details) throws IOException
    {
        UsState                 usState = new UsState(exhibitor);

        File                    idFile = new File(details.dataDirectory, "myid");
        if ( usState.getUs() != null )
        {
            Files.createParentDirs(idFile);
            String                  id = String.format("%d\n", usState.getUs().getServerId());
            Files.write(id.getBytes(), idFile);
        }
        else
        {
            exhibitor.getLog().add(ActivityLog.Type.INFO, "Starting in standalone mode");
            if ( idFile.exists() && !idFile.delete() )
            {
                exhibitor.getLog().add(ActivityLog.Type.ERROR, "Could not delete ID file: " + idFile);
            }
        }

        Properties      localProperties = new Properties();
        localProperties.putAll(details.properties);

        localProperties.setProperty("clientPort", Integer.toString(usState.getConfig().getInt(IntConfigs.CLIENT_PORT)));

        String          portSpec = String.format(":%d:%d", usState.getConfig().getInt(IntConfigs.CONNECT_PORT), usState.getConfig().getInt(IntConfigs.ELECTION_PORT));
        for ( ServerSpec spec : usState.getServerList().getSpecs() )
        {
            localProperties.setProperty("server." + spec.getServerId(), spec.getHostname() + portSpec + spec.getServerType().getZookeeperConfigValue());
        }

        if ( usState.getUs().getServerType() == ServerType.OBSERVER )
        {
            localProperties.setProperty("peerType", "observer");
        }

        File            configFile = new File(details.configDirectory, "zoo.cfg");
View Full Code Here

Examples of com.netflix.exhibitor.core.state.UsState

    FlexibleEnsembleBuilder(Exhibitor exhibitor, ClusterState clusterState)
    {
        this.exhibitor = exhibitor;
        this.clusterState = clusterState;
        usState = new UsState(exhibitor);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.