Package org.voltdb

Examples of org.voltdb.CatalogContext


     * @return topologically sorted Vertices of tables in catalog
     * @throws CycleInDagException
     */
    public static Table[] sortTables() throws CycleInDagException
    {
        CatalogContext cc = new CatalogContext(s_cat.getCatalog());
        DependencyGraph dgraph = DependencyGraphGenerator.generate(cc);

        int size = dgraph.getVertexCount();

        Table[] ret = new Table[size];
View Full Code Here


    /**
     * testTimeIntervalCostModel
     */
    public void testTimeIntervalCostModel() throws Exception {
        Database clone_db = CatalogCloner.cloneDatabase(catalog_db);
        CatalogContext clone_catalogContext = new CatalogContext(clone_db.getCatalog());
       
        info = this.generateInfo(clone_catalogContext);
        TimeIntervalCostModel<SingleSitedCostModel> costModel = new TimeIntervalCostModel<SingleSitedCostModel>(clone_catalogContext, SingleSitedCostModel.class, 10);
        costModel.setCachingEnabled(true);
       
View Full Code Here

    /**
     * testSingleSitedCostModel
     */
    public void testSingleSitedCostModel() throws Exception {
        Database clone_db = CatalogCloner.cloneDatabase(catalog_db);
        CatalogContext clone_catalogContext = new CatalogContext(clone_db.getCatalog());
       
        info = this.generateInfo(clone_catalogContext);
        SingleSitedCostModel costModel = new SingleSitedCostModel(clone_catalogContext);
        costModel.setCachingEnabled(true);
       
View Full Code Here

     * testPartitionEstimator
     */
    public void testPartitionEstimator() throws Exception {
        Integer base_partition = 1;
        Database clone_db = CatalogCloner.cloneDatabase(catalog_db);
        CatalogContext clone_catalogContext = new CatalogContext(clone_db.getCatalog());
        PartitionEstimator p_estimator = new PartitionEstimator(clone_catalogContext);
        info = this.generateInfo(clone_catalogContext);
       
        Table catalog_tbl = this.getTable(clone_db, TM1Constants.TABLENAME_SUBSCRIBER);
        Column target_col = this.getColumn(catalog_tbl, "S_ID");
View Full Code Here

    /**
     * testCatalogUpdates
     */
    public void testCatalogUpdates() throws Exception {
        Database clone_db = CatalogCloner.cloneDatabase(catalog_db);
        CatalogContext clone_catalogContext = new CatalogContext(clone_db.getCatalog());
        info = this.generateInfo(clone_catalogContext);
       
        Table catalog_tbl = this.getTable(clone_db, TM1Constants.TABLENAME_SUBSCRIBER);
        Column target_col = this.getColumn(catalog_tbl, "S_ID");
        Collection<VerticalPartitionColumn> candidates = VerticalPartitionerUtil.generateCandidates(target_col, info.stats);
View Full Code Here

     * testGenerate
     */
    public void testVerticalPartitioning() throws Exception {
        Database clone_db = CatalogCloner.cloneDatabase(catalog_db);
        assert(clone_db.hashCode() != catalog_db.hashCode());
        CatalogContext clone_catalogContext = new CatalogContext(clone_db.getCatalog());
       
        System.err.println("catalog_db => " + catalog_db.hashCode());
        System.err.println("clone_db => " + clone_db.hashCode());
        int num_intervals = info.getNumIntervals();
        info = this.generateInfo(clone_catalogContext);
View Full Code Here

                java.util.Date date = new java.util.Date();
                Timestamp current = new Timestamp(date.getTime());
                String nonce = Long.toString(current.getTime());

                CatalogContext cc = this.getCatalogContext();
                String procName = VoltSystemProcedure.procCallName(SnapshotSave.class);
                Procedure catalog_proc = cc.procedures.getIgnoreCase(procName);

                ParameterSet params = new ParameterSet();
                params.setParameters(
View Full Code Here

     * @param t_estimator
     * @param args
     * @return
     */
    public static MarkovEstimate predictPath(MarkovGraph markov, MarkovEstimator t_estimator, Object args[]) {
        CatalogContext catalogContext = t_estimator.getCatalogContext();
        PartitionEstimator p_estimator = t_estimator.getPartitionEstimator();
       
        int base_partition = HStoreConstants.NULL_PARTITION_ID;
        try {
            base_partition = p_estimator.getBasePartition(markov.getProcedure(), args);
View Full Code Here

        // this.availableMemory = Runtime.getRuntime().maxMemory();
        this.availableMemory = hstore_conf.site.memory * 1024l * 1024l;
        if (debug.val)
            LOG.debug("AVAILABLE MEMORY: " + StringUtil.formatSize(this.availableMemory));

        CatalogContext catalogContext = hstore_site.getCatalogContext();
       
        evictableTables = new String[catalogContext.getEvictableTables().size()];
        int i = 0;
        for (Table table : catalogContext.getEvictableTables()) {
          if(!table.getBatchevicted()){
                evictableTables[i] = table.getName();
                i++;           
          }
        }

        AntiCacheEvictionPolicyType policy = AntiCacheEvictionPolicyType.get(hstore_conf.site.anticache_eviction_distribution);
        if (policy == null) {
            LOG.warn(String.format("Bad value for site.anticache_eviction_distribution: %s. Using default of 'even'",
                    hstore_conf.site.anticache_eviction_distribution));
            policy = AntiCacheEvictionPolicyType.EVEN;
        }
        this.evictionDistributionPolicy = policy;

        int num_partitions = hstore_site.getCatalogContext().numberOfPartitions;

        this.partitionStats = new PartitionStats[num_partitions];
        for(i = 0; i < num_partitions; i++) {
            this.partitionStats[i] = new PartitionStats()
        }
        this.pendingStatsUpdates = new boolean[num_partitions];
        Arrays.fill(pendingStatsUpdates, false);

        this.profilers = new AntiCacheManagerProfiler[num_partitions];
        for (int partition : hstore_site.getLocalPartitionIds().values()) {
            this.profilers[partition] = new AntiCacheManagerProfiler();
        } // FOR

        this.statsMessage = new TableStatsRequestMessage(catalogContext.getDataTables());
        this.statsMessage.getObservable().addObserver(new EventObserver<VoltTable>() {
            @Override
            public void update(EventObservable<VoltTable> o, VoltTable vt) {
              if (debug.val)
                  LOG.debug("updating partition stats in observer");
View Full Code Here

            Map<String, Integer> pdist = distribution.get(partition);
            String tableNames[] = new String[pdist.size()];
            long evictBlockSizes[] = new long[pdist.size()];
            int evictBlocks[] = new int[pdist.size()];
            int i = 0;
            CatalogContext catalogContext = hstore_site.getCatalogContext();
            String children[] = new String[pdist.size()];
            for (String table : pdist.keySet()) {
                tableNames[i] = table;
                Table catalogTable = catalogContext.getTableByName(table);
                if(hstore_conf.site.anticache_batching == true){
                    children = CatalogUtil.getChildTables(catalogContext.database, catalogTable);
                    System.out.println(children);                 
                }
                evictBlockSizes[i] = hstore_conf.site.anticache_block_size;
View Full Code Here

TOP

Related Classes of org.voltdb.CatalogContext

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.