Examples of MutationState


Examples of org.apache.phoenix.execute.MutationState

        int maxSize = services.getProps().getInt(QueryServices.MAX_MUTATION_SIZE_ATTRIB,QueryServicesOptions.DEFAULT_MAX_MUTATION_SIZE);
        Format dateTimeFormat = DateUtil.getDateFormatter(datePattern);
        formatters[PDataType.DATE.ordinal()] = dateTimeFormat;
        formatters[PDataType.TIME.ordinal()] = dateTimeFormat;
        this.metaData = metaData;
        this.mutationState = new MutationState(maxSize, this);
    }
View Full Code Here

Examples of org.apache.phoenix.execute.MutationState

   
    private int executeMutation(MutationPlan plan) 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
        MutationState state = plan.execute();
        connection.getMutationState().join(state);
        if (connection.getAutoCommit()) {
            connection.commit();
        }
        lastResultSet = null;
        lastQueryPlan = null;
        // Unfortunately, JDBC uses an int for update count, so we
        // just max out at Integer.MAX_VALUE
        long updateCount = state.getUpdateCount();
        lastUpdateCount = (int)Math.min(Integer.MAX_VALUE, updateCount);
        return lastUpdateCount;
    }
View Full Code Here

Examples of org.apache.phoenix.execute.MutationState

        }

        @Override
        public int executeUpdate() throws SQLException {
            MutationPlan plan = optimizePlan();
            MutationState state = plan.execute();
            lastQueryPlan = null;
            lastResultSet = null;
            lastUpdateCount = (int)Math.min(state.getUpdateCount(), Integer.MAX_VALUE);
            lastUpdateOperation = UpdateOperation.UPSERTED;
            return lastUpdateCount;
        }
View Full Code Here

Examples of org.apache.phoenix.execute.MutationState

        }

        @Override
        public int executeUpdate() throws SQLException {
            MutationPlan plan = optimizePlan();
            MutationState state = plan.execute();
            lastQueryPlan = null;
            lastResultSet = null;
            lastUpdateCount = (int)Math.min(state.getUpdateCount(), Integer.MAX_VALUE);
            lastUpdateOperation = UpdateOperation.UPSERTED;
            return lastUpdateCount;
        }
View Full Code Here

Examples of org.apache.phoenix.execute.MutationState

        }

        @Override
        public int executeUpdate() throws SQLException {
            MetaDataClient client = new MetaDataClient(connection);
            MutationState state = client.dropTable(this);
            lastQueryPlan = null;
            lastResultSet = null;
            lastUpdateCount = (int)Math.min(state.getUpdateCount(), Integer.MAX_VALUE);
            lastUpdateOperation = UpdateOperation.DELETED;
            return lastUpdateCount;
        }
View Full Code Here

Examples of org.apache.phoenix.execute.MutationState

        }

        @Override
        public int executeUpdate() throws SQLException {
            MetaDataClient client = new MetaDataClient(connection);
            MutationState state = client.dropIndex(this);
            lastQueryPlan = null;
            lastResultSet = null;
            lastUpdateCount = (int)Math.min(state.getUpdateCount(), Integer.MAX_VALUE);
            lastUpdateOperation = UpdateOperation.DELETED;
            return lastUpdateCount;
        }
View Full Code Here

Examples of org.apache.phoenix.execute.MutationState

        }

        @Override
        public int executeUpdate() throws SQLException {
            MetaDataClient client = new MetaDataClient(connection);
            MutationState state = client.alterIndex(this);
            lastQueryPlan = null;
            lastResultSet = null;
            lastUpdateCount = (int)Math.min(state.getUpdateCount(), Integer.MAX_VALUE);
            lastUpdateOperation = UpdateOperation.UPSERTED;
            return lastUpdateCount;
        }
View Full Code Here

Examples of org.apache.phoenix.execute.MutationState

        }

        @Override
        public int executeUpdate() throws SQLException {
            MetaDataClient client = new MetaDataClient(connection);
            MutationState state = client.addColumn(this);
            lastQueryPlan = null;
            lastResultSet = null;
            lastUpdateCount = (int)Math.min(state.getUpdateCount(), Integer.MAX_VALUE);
            lastUpdateOperation = UpdateOperation.UPSERTED;
            return lastUpdateCount;
        }
View Full Code Here

Examples of org.apache.phoenix.execute.MutationState

        }

        @Override
        public int executeUpdate() throws SQLException {
            MetaDataClient client = new MetaDataClient(connection);
            MutationState state = client.dropColumn(this);
            lastQueryPlan = null;
            lastResultSet = null;
            lastUpdateCount = (int)Math.min(state.getUpdateCount(), Integer.MAX_VALUE);
            lastUpdateOperation = UpdateOperation.UPSERTED;
            return lastUpdateCount;
        }
View Full Code Here

Examples of org.apache.phoenix.execute.MutationState

    }

    public MutationState createTable(CreateTableStatement statement, byte[][] splits) throws SQLException {
        PTable table = createTable(statement, splits, null);
        if (table == null || table.getType() == PTableType.VIEW) {
            return new MutationState(0,connection);
        }
       
        // Hack to get around the case when an SCN is specified on the connection.
        // In this case, we won't see the table we just created yet, so we hack
        // around it by forcing the compiler to not resolve anything.
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.