Examples of AdHocPlannedStmtBatch


Examples of org.voltdb.compiler.AdHocPlannedStmtBatch

        if (sql == null || sql.isEmpty()) {
            throw new IllegalArgumentException("SQL statement '" + sql + "' is null or the empty string");
        }

        try {
            AdHocPlannedStmtBatch batch = m_csp.plan(sql, args,m_isSinglePartition).get();
            if (batch.errorMsg != null) {
                throw new VoltAbortException("Failed to plan sql '" + sql + "' error: " + batch.errorMsg);
            }

            if (m_isReadOnly && !batch.isReadOnly()) {
                throw new VoltAbortException("Attempted to queue DML adhoc sql '" + sql + "' from read only procedure");
            }

            assert(1 == batch.plannedStatements.size());
View Full Code Here

Examples of org.voltdb.compiler.AdHocPlannedStmtBatch

    public void testFinishedMPAdHocPlanning() throws Exception {
        // Need a batch and a statement
        String query = "select * from a";
        Object[] extractedValues =  new Object[0];
        VoltType[] paramTypes =  new VoltType[0];
        AdHocPlannedStmtBatch plannedStmtBatch =
            AdHocPlannedStmtBatch.mockStatementBatch(3, query, extractedValues, paramTypes, null, -1);
        m_ci.processFinishedCompilerWork(plannedStmtBatch).run();

        ArgumentCaptor<Long> destinationCaptor =
                ArgumentCaptor.forClass(Long.class);
View Full Code Here

Examples of org.voltdb.compiler.AdHocPlannedStmtBatch

        // Need a batch and a statement
        String query = "select * from a where i = ?";
        int partitionParamIndex = 0;
        Object[] extractedValues =  new Object[0];
        VoltType[] paramTypes =  new VoltType[]{VoltType.INTEGER};
        AdHocPlannedStmtBatch plannedStmtBatch =
                AdHocPlannedStmtBatch.mockStatementBatch(3, query, extractedValues, paramTypes,
                                                         new Object[]{3}, partitionParamIndex);
        m_ci.processFinishedCompilerWork(plannedStmtBatch).run();

        ArgumentCaptor<Long> destinationCaptor =
View Full Code Here

Examples of org.voltdb.compiler.AdHocPlannedStmtBatch

        final ListenableFutureTask<?> ft = ListenableFutureTask.create(new Runnable() {
            @Override
            public void run() {
                if (result.errorMsg == null) {
                    if (result instanceof AdHocPlannedStmtBatch) {
                        final AdHocPlannedStmtBatch plannedStmtBatch = (AdHocPlannedStmtBatch) result;

                        // assume all stmts have the same catalog version
                        if ((plannedStmtBatch.getPlannedStatementCount() > 0) &&
                            (plannedStmtBatch.getPlannedStatement(0).core.catalogVersion != m_catalogContext.get().catalogVersion)) {

                            /* The adhoc planner learns of catalog updates after the EE and the
                               rest of the system. If the adhoc sql was planned against an
                               obsolete catalog, re-plan. */
                            LocalObjectMessage work = new LocalObjectMessage(
                                    AdHocPlannerWork.rework(plannedStmtBatch.work, m_adhocCompletionHandler));

                            m_mailbox.send(m_plannerSiteId, work);
                        }
                        else if( plannedStmtBatch.isExplainWork() ) {
                            processExplainPlannedStmtBatch( plannedStmtBatch );
                        }
                        else {
                            try {
                                createAdHocTransaction(plannedStmtBatch, c);
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.