Package org.voltdb.compiler

Examples of org.voltdb.compiler.ClusterConfig


        File projectFile = VoltProjectBuilder.writeStringToTempFile(simpleProject);
        String projectPath = projectFile.getPath();

        VoltCompiler compiler = new VoltCompiler();
        ClusterConfig cluster_config = new ClusterConfig(1, 1, 0, "localhost");
        assertTrue(compiler.compile(projectPath, cluster_config,
                                    "testout.jar", System.out, null));

        // Now read the jar file back in and make sure that we can grab the
        // class file from it using JarClassLoader
View Full Code Here


        m_hm = mock(HostMessenger.class);
        m_zk = getClient(0);
        when(m_hm.getZK()).thenReturn(m_zk);
        VoltZK.createPersistentZKNodes(m_zk);

        m_config = new ClusterConfig(hostCount, sitesPerHost, replicationFactor);
        TheHashinator.initialize(TheHashinator.getConfiguredHashinatorClass(), TheHashinator.getConfigureBytes(m_config.getPartitionCount()));
        m_hostIds = new ArrayList<Integer>();
        for (int i = 0; i < hostCount; i++) {
            m_hostIds.add(i);
        }
View Full Code Here

             */
            JSONObject topo = getTopology(config.m_startAction, m_joinCoordinator);
            m_partitionsToSitesAtStartupForExportInit = new ArrayList<Integer>();
            try {
                // IV2 mailbox stuff
                ClusterConfig clusterConfig = new ClusterConfig(topo);
                m_configuredReplicationFactor = clusterConfig.getReplicationFactor();
                m_cartographer = new Cartographer(m_messenger, m_configuredReplicationFactor,
                        m_catalogContext.cluster.getNetworkpartition());
                List<Integer> partitions = null;
                if (isRejoin) {
                    m_configuredNumberOfPartitions = m_cartographer.getPartitionCount();
                    partitions = m_cartographer.getIv2PartitionsToReplace(m_configuredReplicationFactor,
                                                                          clusterConfig.getSitesPerHost());
                    if (partitions.size() == 0) {
                        VoltDB.crashLocalVoltDB("The VoltDB cluster already has enough nodes to satisfy " +
                                "the requested k-safety factor of " +
                                m_configuredReplicationFactor + ".\n" +
                                "No more nodes can join.", false, null);
                    }
                }
                else {
                    m_configuredNumberOfPartitions = clusterConfig.getPartitionCount();
                    partitions = ClusterConfig.partitionsForHost(topo, m_messenger.getHostId());
                }
                for (int ii = 0; ii < partitions.size(); ii++) {
                    Integer partition = partitions.get(ii);
                    m_iv2InitiatorStartingTxnIds.put( partition, TxnEgo.makeZero(partition).getTxnId());
View Full Code Here

        }
        else if (!startAction.doesRejoin()) {
            int sitesperhost = m_deployment.getCluster().getSitesperhost();
            int hostcount = m_deployment.getCluster().getHostcount();
            int kfactor = m_deployment.getCluster().getKfactor();
            ClusterConfig clusterConfig = new ClusterConfig(hostcount, sitesperhost, kfactor);
            if (!clusterConfig.validate()) {
                VoltDB.crashLocalVoltDB(clusterConfig.getErrorMsg(), false, null);
            }
            topo = registerClusterConfig(clusterConfig);
        }
        else {
            Stat stat = new Stat();
View Full Code Here

        ClusterType cluster = deployment.getCluster();
        int hostCount = cluster.getHostcount();
        int sitesPerHost = cluster.getSitesperhost();
        int kFactor = cluster.getKfactor();

        ClusterConfig config = new ClusterConfig(hostCount, sitesPerHost, kFactor);

        if (!config.validate()) {
            hostLog.error(config.getErrorMsg());
        } else {
            Cluster catCluster = catalog.getClusters().get("cluster");
            // copy the deployment info that is currently not recorded anywhere else
            Deployment catDeploy = catCluster.getDeployment().get("deployment");
            catDeploy.setHostcount(hostCount);
View Full Code Here

     * @throws JSONException
     */
    public static List<Integer> getPartitionsToAdd(ZooKeeper zk, JSONObject topo)
            throws JSONException
    {
        ClusterConfig  clusterConfig = new ClusterConfig(topo);
        List<Integer> newPartitions = new ArrayList<Integer>();
        Set<Integer> existingParts = new HashSet<Integer>(getPartitions(zk));
        // Remove MPI
        existingParts.remove(MpInitiator.MP_INIT_PID);
        int partsToAdd = clusterConfig.getPartitionCount() - existingParts.size();

        if (partsToAdd > 0) {
            hostLog.info("Computing new partitions to add. Total partitions: " + clusterConfig.getPartitionCount());
            for (int i = 0; newPartitions.size() != partsToAdd; i++) {
                if (!existingParts.contains(i)) {
                    newPartitions.add(i);
                }
            }
View Full Code Here

TOP

Related Classes of org.voltdb.compiler.ClusterConfig

Copyright © 2018 www.massapicom. 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.