Examples of VoltProcedure


Examples of org.voltdb.VoltProcedure

            this.args[i] = ParameterSet.EMPTY;
            this.stmtCounters[i] = i;
            i++;
        } // FOR

        VoltProcedure volt_proc = ClassUtil.newInstance(TARGET_PROCEDURE, new Object[0], new Class<?>[0]);
        assert(volt_proc != null);
        this.executor = new MockPartitionExecutor(BASE_PARTITION, catalogContext, p_estimator);
        volt_proc.init(this.executor, catalog_proc, BackendTarget.NONE);
       
        this.planner = new BatchPlanner(this.batch, this.catalog_proc, p_estimator);
    }
View Full Code Here

Examples of org.voltdb.VoltProcedure

        this.proc_class = p_class;

    }
    @Override
    public VoltProcedure makeObjectImpl() throws Exception {
        VoltProcedure volt_proc = null;
        try {
            if (this.has_java) {
                volt_proc = (VoltProcedure)this.proc_class.newInstance();
            } else {
                volt_proc = new VoltProcedure.StmtProcedure();
            }
            volt_proc.init(this.executor,
                           this.catalog_proc,
                           this.executor.getBackendTarget());
        } catch (Exception e) {
            LOG.error("Failed to created VoltProcedure instance for " + catalog_proc.getName() , e);
            throw e;
View Full Code Here

Examples of org.voltdb.VoltProcedure

                // info.reduceEmitTable = annotationInfo.reduceEmitTable();
            }
        }
        assert (info != null);

        VoltProcedure procInstance = null;
        try {
            procInstance = (VoltProcedure) procClass.newInstance();
        } catch (InstantiationException e1) {
            e1.printStackTrace();
        } catch (IllegalAccessException e1) {
View Full Code Here

Examples of org.voltdb.VoltProcedure

   
   
    protected void initializeVoltProcedures() {
        // load up all the stored procedures
        for (final Procedure catalog_proc : catalogContext.procedures) {
            VoltProcedure volt_proc = this.initializeVoltProcedure(catalog_proc);
            Queue<VoltProcedure> queue = new LinkedList<VoltProcedure>();
            queue.add(volt_proc);
            this.procedures[catalog_proc.getId()] = queue;
        } // FOR
    }
View Full Code Here

Examples of org.voltdb.VoltProcedure

        } // FOR
    }

    @SuppressWarnings("unchecked")
    protected VoltProcedure initializeVoltProcedure(Procedure catalog_proc) {
        VoltProcedure volt_proc = null;
       
        if (catalog_proc.getHasjava()) {
            // Only try to load the Java class file for the SP if it has one
            Class<? extends VoltProcedure> p_class = null;
            final String className = catalog_proc.getClassname();
            try {
                p_class = (Class<? extends VoltProcedure>)Class.forName(className);
                volt_proc = (VoltProcedure)p_class.newInstance();
            } catch (Exception e) {
                throw new ServerFaultException("Failed to created VoltProcedure instance for " + catalog_proc.getName() , e);
            }
           
        } else {
            volt_proc = new VoltProcedure.StmtProcedure();
        }
        volt_proc.init(this, catalog_proc, this.backend_target);
        return (volt_proc);
    }
View Full Code Here

Examples of org.voltdb.VoltProcedure

     * <B>Note:</B> You will get a new VoltProcedure for each invocation
     * @param proc_name
     * @return
     */
    protected VoltProcedure getVoltProcedure(int proc_id) {
        VoltProcedure voltProc = this.procedures[proc_id].poll();
        if (voltProc == null) {
            Procedure catalog_proc = catalogContext.getProcedureById(proc_id);
            voltProc = this.initializeVoltProcedure(catalog_proc);
        }
        return (voltProc);
View Full Code Here

Examples of org.voltdb.VoltProcedure

        // Make sure the dependency tracker knows about us
        if (ts.hasDependencyTracker()) this.depTracker.addTransaction(ts);
       
        // Grab a VoltProcedure handle for this txn
        // Two txns can't use the same VoltProcedure at the same time.
        VoltProcedure volt_proc = this.getVoltProcedure(ts.getProcedure().getId());
        assert(volt_proc != null) : "No VoltProcedure for " + ts;
       
        if (debug.val) {
            LOG.debug(String.format("%s - Starting execution of txn on partition %d " +
                      "[txnMode=%s, mode=%s]",
                      ts, this.partitionId, before_mode, this.currentExecMode));
            if (trace.val)
                LOG.trace(String.format("Current Transaction at partition #%d\n%s",
                          this.partitionId, ts.debug()));
        }
       
        if (hstore_conf.site.txn_counters) TransactionCounter.EXECUTED.inc(ts.getProcedure());
        ClientResponseImpl cresponse = null;
        VoltProcedure previous = this.currentVoltProc;
        try {
            this.currentVoltProc = volt_proc;
            ts.markControlCodeExecuted();
            cresponse = volt_proc.call(ts, ts.getProcedureParameters().toArray()); // Blocking...
        // VoltProcedure.call() should handle any exceptions thrown by the transaction
View Full Code Here

Examples of org.voltdb.VoltProcedure

                    args[i][ii] = VoltProcedure.getCleanParams(batch[i][ii], query_trace.getParams());
                } // FOR
            } // FOR
        }
       
        VoltProcedure volt_proc = ClassUtil.newInstance(TARGET_PROCEDURE, new Object[0], new Class<?>[0]);
        assert(volt_proc != null);
        this.executor = new MockPartitionExecutor(BASE_PARTITION, catalogContext, p_estimator);
        volt_proc.init(this.executor, catalog_proc, BackendTarget.NONE);
    }
View Full Code Here

Examples of org.voltdb.VoltProcedure

    /**
     * testGetVoltProcedure
     */
    @Test
    public void testGetVoltProcedure() {
        VoltProcedure volt_proc0 = executor.getVoltProcedure(catalog_proc.getId());
        assertNotNull(volt_proc0);
    }
View Full Code Here

Examples of org.voltdb.VoltProcedure

    public void testMultipleGetVoltProcedure() {
        // Invoke getVoltProcedure() multiple times and make sure that we never get back the same handle
        int count = 10;
        Set<VoltProcedure> procs = new HashSet<VoltProcedure>();
        for (int i = 0; i < count; i++) {
            VoltProcedure volt_proc = executor.getVoltProcedure(catalog_proc.getId());
            assertNotNull(volt_proc);
            assertFalse(procs.contains(volt_proc));
            procs.add(volt_proc);
        } // FOR
        assertEquals(count, procs.size());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.