Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
Expand Up@@ -270,7 +270,7 @@ private PhoenixConnection getConnectionWithTableOrderPreservingMutationState() t
// passing a null mutation state forces the connection.newMutationState() to be used to create the MutationState
return new PhoenixConnection(con, (MutationState)null) {
@Override
protected MutationState newMutationState(int maxSize, int maxSizeBytes) {
protected MutationState newMutationState(int maxSize, long maxSizeBytes) {
return new MutationState(maxSize, maxSizeBytes, this, mutations, false, null);
};
};
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -142,7 +142,7 @@ private static MutationState deleteRows(StatementContext context, ResultIterator
final boolean autoFlush = connection.getAutoCommit() || tableRef.getTable().isTransactional();
ConnectionQueryServices services = connection.getQueryServices();
final int maxSize = services.getProps().getInt(QueryServices.MAX_MUTATION_SIZE_ATTRIB,QueryServicesOptions.DEFAULT_MAX_MUTATION_SIZE);
final int maxSizeBytes = services.getProps().getInt(QueryServices.MAX_MUTATION_SIZE_BYTES_ATTRIB,QueryServicesOptions.DEFAULT_MAX_MUTATION_SIZE_BYTES);
final long maxSizeBytes = services.getProps().getLong(QueryServices.MAX_MUTATION_SIZE_BYTES_ATTRIB,QueryServicesOptions.DEFAULT_MAX_MUTATION_SIZE_BYTES);
final int batchSize = Math.min(connection.getMutateBatchSize(), maxSize);
MultiRowMutationState mutations = new MultiRowMutationState(batchSize);
List<MultiRowMutationState> otherMutations = null;
Expand DownExpand Up@@ -569,7 +569,7 @@ Collections.<ParseNode> emptyList(), null, delete.getOrderBy(), delete.getLimit(
}

final int maxSize = services.getProps().getInt(QueryServices.MAX_MUTATION_SIZE_ATTRIB,QueryServicesOptions.DEFAULT_MAX_MUTATION_SIZE);
final int maxSizeBytes = services.getProps().getInt(QueryServices.MAX_MUTATION_SIZE_BYTES_ATTRIB,QueryServicesOptions.DEFAULT_MAX_MUTATION_SIZE_BYTES);
final long maxSizeBytes = services.getProps().getLong(QueryServices.MAX_MUTATION_SIZE_BYTES_ATTRIB,QueryServicesOptions.DEFAULT_MAX_MUTATION_SIZE_BYTES);

// If we're doing a query for a set of rows with no where clause, then we don't need to contact the server at all.
if (noQueryReqd) {
Expand DownExpand Up@@ -649,9 +649,9 @@ private class SingleRowDeleteMutationPlan implements MutationPlan {
private final PhoenixConnection connection;
private final int maxSize;
private final StatementContext context;
private final int maxSizeBytes;
private final long maxSizeBytes;

public SingleRowDeleteMutationPlan(QueryPlan dataPlan, PhoenixConnection connection, int maxSize, int maxSizeBytes) {
public SingleRowDeleteMutationPlan(QueryPlan dataPlan, PhoenixConnection connection, int maxSize, long maxSizeBytes) {
this.dataPlan = dataPlan;
this.connection = connection;
this.maxSize = maxSize;
Expand DownExpand Up@@ -733,10 +733,10 @@ private class ServerSelectDeleteMutationPlan implements MutationPlan {
private final QueryPlan aggPlan;
private final RowProjector projector;
private final int maxSize;
private final int maxSizeBytes;
private final long maxSizeBytes;

public ServerSelectDeleteMutationPlan(QueryPlan dataPlan, PhoenixConnection connection, QueryPlan aggPlan,
RowProjector projector, int maxSize, int maxSizeBytes) {
RowProjector projector, int maxSize, long maxSizeBytes) {
this.context = dataPlan.getContext();
this.dataPlan = dataPlan;
this.connection = connection;
Expand DownExpand Up@@ -847,14 +847,14 @@ private class ClientSelectDeleteMutationPlan implements MutationPlan {
private final List<TableRef> otherTableRefs;
private final TableRef projectedTableRef;
private final int maxSize;
private final int maxSizeBytes;
private final long maxSizeBytes;
private final PhoenixConnection connection;

public ClientSelectDeleteMutationPlan(TableRef targetTableRef, QueryPlan dataPlan, QueryPlan bestPlan,
boolean hasPreOrPostProcessing,
DeletingParallelIteratorFactory parallelIteratorFactory,
List<TableRef> otherTableRefs, TableRef projectedTableRef, int maxSize,
int maxSizeBytes, PhoenixConnection connection) {
long maxSizeBytes, PhoenixConnection connection) {
this.context = bestPlan.getContext();
this.targetTableRef = targetTableRef;
this.dataPlan = dataPlan;
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -212,8 +212,8 @@ public static MutationState upsertSelect(StatementContext childContext, TableRef
ConnectionQueryServices services = connection.getQueryServices();
int maxSize = services.getProps().getInt(QueryServices.MAX_MUTATION_SIZE_ATTRIB,
QueryServicesOptions.DEFAULT_MAX_MUTATION_SIZE);
int maxSizeBytes =
services.getProps().getInt(QueryServices.MAX_MUTATION_SIZE_BYTES_ATTRIB,
long maxSizeBytes =
services.getProps().getLong(QueryServices.MAX_MUTATION_SIZE_BYTES_ATTRIB,
QueryServicesOptions.DEFAULT_MAX_MUTATION_SIZE_BYTES);
int maxHBaseClientKeyValueSize =
services.getProps().getInt(QueryServices.HBASE_CLIENT_KEYVALUE_MAXSIZE,
Expand DownExpand Up@@ -370,7 +370,7 @@ public MutationPlan compile(UpsertStatement upsert) throws SQLException {
final PhoenixConnection connection = statement.getConnection();
ConnectionQueryServices services = connection.getQueryServices();
final int maxSize = services.getProps().getInt(QueryServices.MAX_MUTATION_SIZE_ATTRIB,QueryServicesOptions.DEFAULT_MAX_MUTATION_SIZE);
final int maxSizeBytes = services.getProps().getInt(QueryServices.MAX_MUTATION_SIZE_BYTES_ATTRIB,QueryServicesOptions.DEFAULT_MAX_MUTATION_SIZE_BYTES);
final long maxSizeBytes = services.getProps().getLong(QueryServices.MAX_MUTATION_SIZE_BYTES_ATTRIB,QueryServicesOptions.DEFAULT_MAX_MUTATION_SIZE_BYTES);
List<ColumnName> columnNodes = upsert.getColumns();
TableRef tableRefToBe = null;
PTable table = null;
Expand DownExpand Up@@ -1056,12 +1056,12 @@ private class ServerUpsertSelectMutationPlan implements MutationPlan {
private final QueryPlan aggPlan;
private final RowProjector aggProjector;
private final int maxSize;
private final int maxSizeBytes;
private final long maxSizeBytes;

public ServerUpsertSelectMutationPlan(QueryPlan queryPlan, TableRef tableRef, QueryPlan originalQueryPlan,
StatementContext context, PhoenixConnection connection,
Scan scan, QueryPlan aggPlan, RowProjector aggProjector,
int maxSize, int maxSizeBytes) {
int maxSize, long maxSizeBytes) {
this.queryPlan = queryPlan;
this.tableRef = tableRef;
this.originalQueryPlan = originalQueryPlan;
Expand DownExpand Up@@ -1179,14 +1179,14 @@ private class UpsertValuesMutationPlan implements MutationPlan {
private final boolean useServerTimestamp;
private final byte[] onDupKeyBytes;
private final int maxSize;
private final int maxSizeBytes;
private final long maxSizeBytes;

public UpsertValuesMutationPlan(StatementContext context, TableRef tableRef, int nodeIndexOffset,
List<Expression> constantExpressions, List<PColumn> allColumns,
int[] columnIndexes, Set<PColumn> overlapViewColumns, byte[][] values,
Set<PColumn> addViewColumns, PhoenixConnection connection,
int[] pkSlotIndexes, boolean useServerTimestamp, byte[] onDupKeyBytes,
int maxSize, int maxSizeBytes) {
int maxSize, long maxSizeBytes) {
this.context = context;
this.tableRef = tableRef;
this.nodeIndexOffset = nodeIndexOffset;
Expand DownExpand Up@@ -1342,9 +1342,9 @@ private class ClientUpsertSelectMutationPlan implements MutationPlan {
private final int[] pkSlotIndexes;
private final boolean useServerTimestamp;
private final int maxSize;
private final int maxSizeBytes;
private final long maxSizeBytes;

public ClientUpsertSelectMutationPlan(QueryPlan queryPlan, TableRef tableRef, QueryPlan originalQueryPlan, UpsertingParallelIteratorFactory parallelIteratorFactory, RowProjector projector, int[] columnIndexes, int[] pkSlotIndexes, boolean useServerTimestamp, int maxSize, int maxSizeBytes) {
public ClientUpsertSelectMutationPlan(QueryPlan queryPlan, TableRef tableRef, QueryPlan originalQueryPlan, UpsertingParallelIteratorFactory parallelIteratorFactory, RowProjector projector, int[] columnIndexes, int[] pkSlotIndexes, boolean useServerTimestamp, int maxSize, long maxSizeBytes) {
this.queryPlan = queryPlan;
this.tableRef = tableRef;
this.originalQueryPlan = originalQueryPlan;
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -328,7 +328,7 @@ public ReadOnlyProps getProps() {
int maxSize = this.services.getProps().getInt(
QueryServices.MAX_MUTATION_SIZE_ATTRIB,
QueryServicesOptions.DEFAULT_MAX_MUTATION_SIZE);
int maxSizeBytes = this.services.getProps().getInt(
long maxSizeBytes = this.services.getProps().getLong(
QueryServices.MAX_MUTATION_SIZE_BYTES_ATTRIB,
QueryServicesOptions.DEFAULT_MAX_MUTATION_SIZE_BYTES);
String timeZoneID = this.services.getProps().get(QueryServices.DATE_FORMAT_TIMEZONE_ATTRIB,
Expand DownExpand Up@@ -589,7 +589,7 @@ public PTableRef getTableRef(PTableKey key) throws TableNotFoundException {
return metaData.getTableRef(key);
}

protected MutationState newMutationState(int maxSize, int maxSizeBytes) {
protected MutationState newMutationState(int maxSize, long maxSizeBytes) {
return new MutationState(maxSize, maxSizeBytes, this);
}

Expand Down