Package org.voltdb.catalog

Examples of org.voltdb.catalog.Procedure


   
    /**
     * testSingleColumnQuery
     */
    public void testSingleColumnQuery() throws Exception {
        Procedure catalog_proc = this.getProcedure("TestSingleTable");
        Statement catalog_stmt = CollectionUtil.first(catalog_proc.getStatements());
        Object params[] = new Object[]{ "ABC" };
       
        Integer base_partition = new Random().nextInt(NUM_PARTITIONS);
       
        // Double check that this is always a distributed query
View Full Code Here


        Table catalog_tbl = this.getTable(TM1Constants.TABLENAME_SUBSCRIBER);
        MaterializedViewInfo view = CatalogUtil.getVerticalPartition(catalog_tbl);
        assertNotNull(view);
        assertEquals(CatalogUtil.debug(view.getGroupbycols()), vp_cols.length, view.getGroupbycols().size());
       
        Procedure catalog_proc = this.getProcedure("TestOrderBy");
        Statement catalog_stmt = CollectionUtil.first(catalog_proc.getStatements());
        assert(catalog_stmt != null) : catalog_proc.getStatements();
        Object params[] = new Object[]{ "ABC" };
       
        Integer base_partition = new Random().nextInt(NUM_PARTITIONS);
       
        // We don't actually care whether this got turned to a single-partition txn
View Full Code Here

        assertFalse(crDebug.toString(), crDebug.isPredictSinglePartition());
        assertFalse(cr.toString(), cr.isSpeculative());
        assertEquals(crDebug.toString(), crDebug.getPredictTouchedPartitions(), crDebug.getExecTouchedPartitions());
        assertEquals(crDebug.toString(), crDebug.getPredictTouchedPartitions(), crDebug.getExecTouchedPartitions());
       
        Procedure catalog_proc = catalogContext.procedures.getIgnoreCase(procName);
        Set<Statement> expectedStmts = new HashSet<Statement>();
        expectedStmts.add(catalog_proc.getStatements().getIgnoreCase("getStockInfo"));
        expectedStmts.add(catalog_proc.getStatements().getIgnoreCase("updateStock"));
       
        for (int partition : crDebug.getExecTouchedPartitions()) {
            List<CountedStatement> query_estimates[] = crDebug.getRemoteQueryEstimates(catalogContext, partition);
            assertNotNull(query_estimates);
View Full Code Here

   
    /**
     * testGetPartitionsTransactionTrace
     */
    public void testGetPartitionsTransactionTrace() throws Exception {
        Procedure catalog_proc = this.getProcedure(GetNewDestination.class);
        Object txn_params[] = new Object[] { 1l, 4l, 0l, 5l };
       
        Statement catalog_stmt = this.getStatement(catalog_proc, "GetData");
        Object query_params[] = new Object[] { 1l, 1l, 4l, 0l, 5l };
       
View Full Code Here

   
    /**
     * testGetPartitionsProcedure
     */
    public void testGetPartitionsProcedure() throws Exception {
        Procedure catalog_proc = this.getProcedure(UpdateSubscriberData.class);
        Object params[] = new Object[] {
            new Long(1000),     // S_ID
            0l,                 // BIT_1
            0l,                 // DATA_A
            0l,                 // SF_TYPE
View Full Code Here

   
    /**
     * testGetPartitionsStatement
     */
    public void testGetPartitionsStatement() throws Exception {
        Procedure catalog_proc = this.getProcedure("InsertCallForwarding");
        assertNotNull(catalog_proc);
        Statement catalog_stmt = catalog_proc.getStatements().get("query1");
        assertNotNull(catalog_stmt);
       
        Object params[] = new Object[] { new String("Doesn't Matter") };
        p_estimator.getAllPartitions(partitions, catalog_stmt, params, base_partition);
        // System.out.println(catalog_stmt.getName() + " Partitions: " + partitions);
View Full Code Here

   
    /**
     * testGetPartitionsPlanFragment
     */
    public void testGetPartitionsPlanFragment() throws Exception {
        Procedure catalog_proc = this.getProcedure(GetNewDestination.class);
        Statement catalog_stmt = catalog_proc.getStatements().get("GetData");
        assertNotNull(catalog_stmt);
       
        // System.out.println("Num Partitions: " + CatalogUtil.getNumberOfPartitions(catalog_db));
        Object params[] = new Object[] {
            new Long(54),   // S_ID
View Full Code Here

   
    /**
     * testGetAllFragmentPartitions
     */
    public void testGetAllFragmentPartitions() throws Exception {
        Procedure catalog_proc = this.getProcedure(GetNewDestination.class);
        Statement catalog_stmt = catalog_proc.getStatements().get("GetData");
        assertNotNull(catalog_stmt);
       
        // System.out.println("Num Partitions: " + CatalogUtil.getNumberOfPartitions(catalog_db));
        Object params[] = new Object[] {
            new Long(54),   // S_ID
View Full Code Here

    public void testMultiColumnPartitioning() throws Exception {
        Database clone_db = CatalogCloner.cloneDatabase(catalogContext.database);
        CatalogContext clone_catalogContext = new CatalogContext(clone_db.getCatalog());
        PartitionEstimator p_estimator = new PartitionEstimator(clone_catalogContext);

        Procedure catalog_proc = this.getProcedure(clone_db, GetNewDestination.class);
        ProcParameter catalog_params[] = new ProcParameter[] {
            this.getProcParameter(clone_db, catalog_proc, 0),   // S_ID
            this.getProcParameter(clone_db, catalog_proc, 1),   // SF_TYPE
        };
        MultiProcParameter mpp = MultiProcParameter.get(catalog_params);
        assertNotNull(mpp);
        assert(mpp.getIndex() >= 0);
        catalog_proc.setPartitionparameter(mpp.getIndex());
       
        // First Test: Only partition one of the tables and make sure that
        // the MultiColumns don't map to the same partition
       
        Table catalog_tbl = this.getTable(clone_db, TM1Constants.TABLENAME_SPECIAL_FACILITY);
View Full Code Here

    public void testMultiColumnPartitioningIncomplete() throws Exception {
        Database clone_db = CatalogCloner.cloneDatabase(catalogContext.database);
        CatalogContext clone_catalogContext = new CatalogContext(clone_db.getCatalog());
        PartitionEstimator p_estimator = new PartitionEstimator(clone_catalogContext);

        Procedure catalog_proc = this.getProcedure(clone_db, GetAccessData.class);
        ProcParameter catalog_params[] = new ProcParameter[] {
            this.getProcParameter(clone_db, catalog_proc, 0),   // S_ID
            this.getProcParameter(clone_db, catalog_proc, 1),   // AI_TYPE
        };
        MultiProcParameter mpp = MultiProcParameter.get(catalog_params);
        assertNotNull(mpp);
        assert(mpp.getIndex() >= 0);
        catalog_proc.setPartitionparameter(mpp.getIndex());
        p_estimator.initCatalog(clone_catalogContext);
       
        Table catalog_tbl = this.getTable(clone_db, TM1Constants.TABLENAME_ACCESS_INFO);
        Column catalog_cols[] = new Column[] {
            this.getColumn(clone_db, catalog_tbl, "S_ID"),
View Full Code Here

TOP

Related Classes of org.voltdb.catalog.Procedure

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.