Package org.apache.phoenix.compile

Examples of org.apache.phoenix.compile.MutationPlan


        @SuppressWarnings("unchecked")
        @Override
        public MutationPlan compilePlan(PhoenixStatement stmt, Sequence.ValueOp seqAction) throws SQLException {
            UpsertCompiler compiler = new UpsertCompiler(stmt);
            MutationPlan plan = compiler.compile(this);
            plan.getContext().getSequenceManager().validateSequences(seqAction);
            return plan;
        }
View Full Code Here


        @SuppressWarnings("unchecked")
        @Override
        public MutationPlan compilePlan(PhoenixStatement stmt, Sequence.ValueOp seqAction) throws SQLException {
            DeleteCompiler compiler = new DeleteCompiler(stmt);
            MutationPlan plan = compiler.compile(this);
            plan.getContext().getSequenceManager().validateSequences(seqAction);
            return plan;
        }
View Full Code Here

    protected int executeMutation(CompilableStatement stmt) throws SQLException {
        // Note that the upsert select statements will need to commit any open transaction here,
        // since they'd update data directly from coprocessors, and should thus operate on
        // the latest state
        try {
            MutationPlan plan = stmt.compilePlan(this);
            plan.getContext().getSequenceManager().validateSequences(stmt.getSequenceAction());;
            MutationState state = plan.execute();
            connection.getMutationState().join(state);
            if (connection.getAutoCommit()) {
                connection.commit();
            }
            setLastResultSet(null);
View Full Code Here

        @SuppressWarnings("unchecked")
        @Override
        public MutationPlan compilePlan(final PhoenixStatement stmt) throws SQLException {
            final StatementContext context = new StatementContext(stmt);
            return new MutationPlan() {

                @Override
                public StatementContext getContext() {
                    return context;
                }
View Full Code Here

        @SuppressWarnings("unchecked")
        @Override
        public MutationPlan compilePlan(final PhoenixStatement stmt) throws SQLException {
            final StatementContext context = new StatementContext(stmt);
            return new MutationPlan() {
               
                @Override
                public StatementContext getContext() {
                    return context;
                }
View Full Code Here

        @SuppressWarnings("unchecked")
        @Override
        public MutationPlan compilePlan(final PhoenixStatement stmt) throws SQLException {
            final StatementContext context = new StatementContext(stmt);
            return new MutationPlan() {
               
                @Override
                public StatementContext getContext() {
                    return context;
                }
View Full Code Here

        @SuppressWarnings("unchecked")
        @Override
        public MutationPlan compilePlan(final PhoenixStatement stmt) throws SQLException {
            final StatementContext context = new StatementContext(stmt);
            return new MutationPlan() {

                @Override
                public StatementContext getContext() {
                    return context;
                }
View Full Code Here

        long ts = (scn == null ? table.getTimeStamp() : scn);
        // Getting the schema through the current connection doesn't work when the connection has an scn specified
        // Since the table won't be added to the current connection.
        TableRef tableRef = new TableRef(null, table, ts, false);
        byte[] emptyCF = SchemaUtil.getEmptyColumnFamily(table);
        MutationPlan plan = compiler.compile(Collections.singletonList(tableRef), emptyCF, null, null, tableRef.getTimeStamp());
        return connection.getQueryServices().updateData(plan);
    }
View Full Code Here

        boolean wasAutoCommit = connection.getAutoCommit();
        connection.rollback();
        try {
            connection.setAutoCommit(true);
            PostIndexDDLCompiler compiler = new PostIndexDDLCompiler(connection, dataTableRef);
            MutationPlan plan = compiler.compile(index);
            MutationState state = connection.getQueryServices().updateData(plan);
            AlterIndexStatement indexStatement = FACTORY.alterIndex(FACTORY.namedTable(null,
                    TableName.create(index.getSchemaName().getString(), index.getTableName().getString())),
                    dataTableRef.getTable().getTableName().getString(), false, PIndexState.ACTIVE);
            alterIndex(indexStatement);
View Full Code Here

                            tableRefs.add(new TableRef(null, table, ts, false));
                            // TODO: Let the standard mutable secondary index maintenance handle this?
                            for (PTable index: table.getIndexes()) {
                                tableRefs.add(new TableRef(null, index, ts, false));
                            }
                            MutationPlan plan = new PostDDLCompiler(connection).compile(tableRefs, null, null, Collections.<PColumn>emptyList(), ts);
                            return connection.getQueryServices().updateData(plan);
                        }
                    }
                    break;
                }
View Full Code Here

TOP

Related Classes of org.apache.phoenix.compile.MutationPlan

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.