Package org.voltdb.catalog

Examples of org.voltdb.catalog.Partition


                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

            } // FOR
            host_id++;
View Full Code Here


    @Deprecated
    public static Partition getPartitionById(CatalogType catalog_item, Integer id) {
        final CatalogUtil.Cache cache = CatalogUtil.getCatalogCache(catalog_item);
        if (cache.PARTITION_XREF.isEmpty())
            cache.buildPartitionCache(catalog_item);
        Partition catalog_part = cache.PARTITION_XREF.get(id);
        return (catalog_part);
    }
View Full Code Here

        Set<Partition> partitions = new ListOrderedSet<Partition>();

        // 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
View Full Code Here

        HStoreThreadManager manager = hstore_site.getThreadManager();
        HStoreThreadManager.Debug managerDebug = manager.getDebugContext();

        // Check whether we can register the thread and it doesn't
        // come back as disabled
        Partition partition = CollectionUtil.first(this.catalog_site.getPartitions());
        boolean ret = manager.registerEEThread(partition);
        assertTrue(ret);
        assertTrue(manager.isEnabled());
        assertTrue(managerDebug.isRegistered(self));
       
View Full Code Here

        HStoreThreadManager manager = hstore_site.getThreadManager();
        HStoreThreadManager.Debug managerDebug = manager.getDebugContext();

        // Check whether we can register the thread and it doesn't
        // come back as disabled
        Partition partition = CollectionUtil.first(this.catalog_site.getPartitions());
        boolean ret = manager.registerEEThread(partition);
        assertTrue(ret);
        assertTrue(manager.isEnabled());
        assertTrue(managerDebug.isRegistered(self));
       
View Full Code Here

        HStoreThreadManager manager = hstore_site.getThreadManager();
        HStoreThreadManager.Debug managerDebug = manager.getDebugContext();

        // Check whether we can register the thread and it doesn't
        // come back as disabled
        Partition partition = CollectionUtil.first(this.catalog_site.getPartitions());
        boolean ret = manager.registerEEThread(partition);
        assertTrue(ret);
        assertTrue(manager.isEnabled());
        assertTrue(managerDebug.isRegistered(self));
       
View Full Code Here

            } // FOR
        } // FOR

        for (Host catalog_host : host_partitions.keySet()) {
            Set<Partition> partitions = host_partitions.get(catalog_host);
            Partition catalog_part = CollectionUtil.first(partitions);
            int base_partition = catalog_part.getId();
            Collection<Partition> local_partitions = CatalogUtil.getLocalPartitions(catalogContext.database, base_partition);
            assertEquals(partitions.size(), local_partitions.size());

            for (Partition other_part : local_partitions) {
                assertNotNull(other_part);
View Full Code Here

            this.prefetchBatch[i] = new SQLStmt(this.catalog_stmt);
            this.prefetchParamsHash[i] = this.prefetchParams[i].hashCode();
            this.prefetchStmtCounters[i] = PREFETCH_STMT_COUNTER;
        } // FOR

        Partition catalog_part = catalogContext.getPartitionById(BASE_PARTITION);
        assertNotNull(catalog_part);
        this.hstore_site = HStore.initialize(catalogContext, ((Site)catalog_part.getParent()).getId(), HStoreConf.singleton());
        this.hstore_site.addPartitionExecutor(BASE_PARTITION, executor);
        this.depTracker = hstore_site.getDependencyTracker(BASE_PARTITION);
        this.depTrackerDbg = this.depTracker.getDebugContext();
       
        // Create a BatchPlan for our batch
View Full Code Here

        // CHANGE : Up Sites
        Host catalog_host = context.getHost();
        Collection<Site> catalog_sites = CatalogUtil.getSitesForHost(catalog_host);
        Site catalog_site = context.getSite();
        Partition catalog_partition = context.getPartitionExecutor().getPartition();           

        LOG.trace("Table :" + tableName);

        for (Site site : catalog_sites) {
            for (Partition partition : site.getPartitions()) {
                sites_to_partitions.put(site.getId(), partition.getId());
            }
        }

        try {
            initializeTableSaveFiles(m_filePath, m_fileNonce, tableName, originalHostIds, relevantPartitionIds, context);
        } catch (IOException e) {
            VoltTable result = constructResultsTable();
            // e.printStackTrace();
            result.addRow(m_hostId, hostname, m_siteId, tableName, relevantPartitionIds[0], "FAILURE", "Unable to load table: " + tableName + " error: " + e.getMessage());
            return result;
        }

        int partition_id = context.getPartitionExecutor().getPartitionId();
        LOG.trace("Starting performLoadPartitionedTable " + tableName + " at partition - " + partition_id);

        String result_str = "SUCCESS";
        String error_msg = "";
        TableSaveFile savefile = null;

        /**
         * For partitioned tables
         */
        try {
            savefile = getTableSaveFile(getSaveFileForPartitionedTable(m_filePath, m_fileNonce, tableName,
                    catalog_host.getId(),
                    catalog_site.getId(),
                    catalog_partition.getId()),                            
                    3, null);
            assert (savefile.getCompleted());
        } catch (IOException e) {
            VoltTable result = constructResultsTable();
            result.addRow(m_hostId, hostname, m_siteId, tableName, -1, "FAILURE", "Unable to load table: " + tableName + " error: " + e.getMessage());
View Full Code Here

            site.setHost(host);
            site.setProc_port(HStoreConstants.DEFAULT_PORT);
            site.setMessenger_port(HStoreConstants.DEFAULT_PORT + HStoreConstants.MESSENGER_PORT_OFFSET);
            site.setIsup(true);

            Partition part = site.getPartitions().add(String.valueOf(++partitionCounter));
            part.setId(partitionCounter);
//            System.err.println("[" + partitionCounter + "] " + CatalogUtil.getDisplayName(site) + " => " + CatalogUtil.getDisplayName(part));
//            System.err.println(CatalogUtil.debug(site));
        }
    }
View Full Code Here

TOP

Related Classes of org.voltdb.catalog.Partition

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.