Package org.voltdb.catalog

Examples of org.voltdb.catalog.Site


            // Now create the sites for this host
            for (Integer siteid : cc.getSites(host)) {
                LOG.debug("Adding Site #" + siteid + " on " + host);

                Site catalog_site = catalog_clus.getSites().add(siteid.toString());
                assert (catalog_site != null);
                catalog_site.setId(siteid);
                catalog_site.setHost(catalog_host);
                catalog_site.setProc_port(proc_port++);
                catalog_site.setMessenger_port(messenger_port++);

                // Add all the partitions
                for (Integer partition_id : cc.getPartitionIds(host, siteid)) {
                    Partition catalog_part = catalog_site.getPartitions().add(partition_id.toString());
                    assert (catalog_part != null);
                    catalog_part.setId(partition_id);
                    partition_ctr++;
                } // FOR
View Full Code Here


                port = this.port;
            }
        }
        // Connect to random host and using a random port that it's listening on
        else if (this.catalog != null) {
            Site catalog_site = CollectionUtil.random(CatalogUtil.getAllSites(this.catalog));
            hostname = catalog_site.getHost().getIpaddr();
            port = catalog_site.getProc_port();
        }
        assert(hostname != null);
        assert(port > 0);
       
        if (debug.val)
View Full Code Here

     */
    @Deprecated
    public static Map<Integer, Integer> getPartitionSiteXref(CatalogType catalog_item) {
        Map<Integer, Integer> m = new HashMap<Integer, Integer>();
        for (Partition catalog_part : CatalogUtil.getAllPartitions(catalog_item)) {
            Site catalog_site = catalog_part.getParent();
            m.put(catalog_part.getId(), catalog_site.getId());
        } // FOR
        return (m);
    }
View Full Code Here

        // First figure out what partition we are in the catalog
        Cluster catalog_clus = CatalogUtil.getCluster(catalog_db);
        assert (catalog_clus != null);
        Partition catalog_part = CatalogUtil.getPartitionById(catalog_clus, base_partition);
        assert (catalog_part != null);
        Site catalog_site = catalog_part.getParent();
        assert (catalog_site != null);
        Host catalog_host = catalog_site.getHost();
        assert (catalog_host != null);

        // Now look at what other partitions are on the same host that we are
        for (Site other_site : catalog_clus.getSites()) {
            if (other_site.getHost().equals(catalog_host) == false)
View Full Code Here

        return (catalogContext.cluster);
    }
   
    protected final Site getSite(int site_id) {
        assertNotNull(catalogContext);
        Site catalog_site = catalogContext.getSiteById(site_id);
        assert(catalog_site != null) : "Failed to retrieve Site #" + site_id + " from catalog";
        return (catalog_site);
    }
View Full Code Here

     * @return
     * @throws Exception
     */
    protected final Client createClient() throws Exception {
        // Connect to random site and using a random port that it's listening on
        Site catalog_site = CollectionUtil.random(catalogContext.sites);
        assertNotNull(catalog_site);
       
        Host catalog_host = catalog_site.getHost();
        assertNotNull(catalog_host);
       
        String hostName = catalog_host.getIpaddr();
        int port = catalog_site.getProc_port();
       
        LOG.debug(String.format("Creating new client connection to HStoreSite %s at %s:%d",
                                HStoreThreadManager.formatSiteName(catalog_site.getId()),
                                hostName, port));
       
        Client client = ClientFactory.createClient(128, null, false, null);
        client.createConnection(null, hostName, port, "user", "password");
        return (client);
View Full Code Here

       
        for (TransactionCounter tc : TransactionCounter.values()) {
            tc.clear();
        } // FOR
       
        Site catalog_site = CollectionUtil.first(catalogContext.sites);
        this.hstore_conf = HStoreConf.singleton();
        this.hstore_conf.site.specexec_enable = true;
        this.hstore_conf.site.txn_client_debug = true;
        this.hstore_conf.site.txn_counters = true;
        this.hstore_conf.site.exec_force_singlepartitioned = true;
View Full Code Here

                    hstore_site.getPartitionExecutor(partition).queuePrepare(ts, callback);
                }
                // Check whether we can piggyback on another WorkFragment that is going to
                // the same site
                else {
                    Site remoteSite = catalogContext.getSiteForPartition(partition);
                    boolean found = false;
                    for (Partition remotePartition : remoteSite.getPartitions().values()) {
                        if (fragmentsPerPartition.get(remotePartition.getId(), 0) != 0) {
                            found = true;
                            break;
                        }
                    } // FOR
View Full Code Here

            assertNotNull(clone_host);
            checkFields(Host.class, catalog_host, clone_host);
        } // FOR

        for (Site catalog_site : catalog_cluster.getSites()) {
            Site clone_site = clone_cluster.getSites().get(catalog_site.getName());
            assertNotNull(clone_site);
            checkFields(Site.class, catalog_site, clone_site);
        }

        assertEquals(NUM_PARTITIONS, CatalogUtil.getNumberOfPartitions(clone_db));
View Full Code Here

        VoltTable error = acquireSnapshotPermit(context, hostname, result);
        if (error != null) {
            return error;
        }

        Site site = context.getSite();
        CatalogMap<Partition> partition_map = site.getPartitions();
        Integer lowest_partition_id = Integer.MAX_VALUE, p_id;       
        for (Partition pt : partition_map) {
            p_id = pt.getId();
            lowest_partition_id = Math.min(p_id, lowest_partition_id);
        }       
View Full Code Here

TOP

Related Classes of org.voltdb.catalog.Site

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.