Package org.voltdb.catalog

Examples of org.voltdb.catalog.Database


        // ----------------------------------------------------------------------------
        ParameterMappingsSet mappings = new ParameterMappingsSet();
        if (hstore_conf.site.mappings_path != null) {
            File path = new File(hstore_conf.site.mappings_path);
            if (path.exists()) {
                Database catalog_db = catalogContext.database;
                try {
                    mappings.load(path, catalog_db);
                } catch (IOException ex) {
                    throw new RuntimeException(ex);
                }
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);
        info.setCostModel(new TimeIntervalCostModel<SingleSitedCostModel>(clone_catalogContext, SingleSitedCostModel.class, num_intervals));
        info.setPartitionerClass(LNSPartitioner.class);
       
        hints.enable_vertical_partitioning = true;
        hints.max_memory_per_partition = Long.MAX_VALUE;
        hints.enable_costmodel_multipartition_penalty = true;
        hints.enable_replication_readmostly = false;
        hints.enable_replication_readonly = false;
        hints.weight_costmodel_multipartition_penalty = 100.0d;
        hints.relaxation_min_size = clone_db.getTables().size();
        hints.limit_local_time = 30;
        hints.limit_total_time = 30;
       
        designer = new Designer(info, hints, info.getArgs());
        LNSPartitioner partitioner = (LNSPartitioner)designer.getPartitioner();
View Full Code Here

     */
    public static ClientResponse invoke(Catalog catalog,
                                         Client client,
                                         String procName,
                                         String...params) throws Exception {
        Database catalog_db = CatalogUtil.getDatabase(catalog);
       
        // Get Procedure catalog handle
        if (procName == null || procName.isEmpty()) {
            LOG.error("Missing procedure name");
            return (null);
        }
        Procedure catalog_proc = catalog_db.getProcedures().getIgnoreCase(procName);
        if (catalog_proc == null) {
            throw new Exception("Invalid procedure name '" + procName + "'");
        }
       
        int expectedParams = catalog_proc.getParameters().size();
View Full Code Here

     * for this PartitionExecutor
     * @return
     */
    public static File getDatabaseDir(PartitionExecutor executor) {
        HStoreConf hstore_conf = executor.getHStoreConf();
        Database catalog_db = CatalogUtil.getDatabase(executor.getPartition());

        // First make sure that our base directory exists
        String base_dir = FileUtil.realpath(hstore_conf.site.anticache_dir +
                File.separatorChar +
                catalog_db.getProject());
        synchronized (AntiCacheManager.class) {
            FileUtil.makeDirIfNotExists(base_dir);
        } // SYNC

        // Then each partition will have a separate directory inside of the base one
View Full Code Here

    // ----------------------------------------------------------------------------
   
    public static List<Pair<Integer, InetSocketAddress>> getRemoteCoordinators(Site catalog_site) {
        List<Pair<Integer, InetSocketAddress>> m = new ArrayList<Pair<Integer,InetSocketAddress>>();
       
        Database catalog_db = CatalogUtil.getDatabase(catalog_site);
        Map<Host, Set<Site>> host_partitions = CatalogUtil.getSitesPerHost(catalog_db);
        for (Entry<Host, Set<Site>> e : host_partitions.entrySet()) {
            String host = e.getKey().getIpaddr();
            for (Site remote_site : e.getValue()) {
                if (remote_site.getId() != catalog_site.getId()) {
View Full Code Here

   
    protected VoltTable loadTable_ORDER_LINE(Client client) throws IOException, ProcCallException {
        int num_partitions = this.getServerConfig().getPartitionCount();
        int num_tuples = num_partitions * 10;

        Database catalog_db = CatalogUtil.getDatabase(this.getCatalog());
        Table catalog_tbl = catalog_db.getTables().get("ORDER_LINE");
        assertNotNull(catalog_tbl);
        /*
        CREATE TABLE ORDER_LINE (
                OL_O_ID INTEGER DEFAULT '0' NOT NULL,
                OL_D_ID TINYINT DEFAULT '0' NOT NULL,
View Full Code Here

TOP

Related Classes of org.voltdb.catalog.Database

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.