[02/10] phoenix git commit: PHOENIX-3534 Support multi region SYSTEM.CATALOG table (Thomas D'Silva and Rahul Gidwani)
http://git-wip-us.apache.org/repos/asf/phoenix/blob/c53d9ada/phoenix-core/src/main/java/org/apache/phoenix/schema/PColumnImpl.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/schema/PColumnImpl.java b/phoenix-core/src/main/java/org/apache/phoenix/schema/PColumnImpl.java index 45aca98..a267629 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/schema/PColumnImpl.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/PColumnImpl.java @@ -17,6 +17,7 @@ */ package org.apache.phoenix.schema; +import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.util.ByteStringer; import org.apache.phoenix.coprocessor.generated.PTableProtos; import org.apache.phoenix.query.QueryConstants; @@ -42,36 +43,63 @@ public class PColumnImpl implements PColumn { private boolean isRowTimestamp; private boolean isDynamic; private byte[] columnQualifierBytes; - +private boolean derived; +private long timestamp; + public PColumnImpl() { } -public PColumnImpl(PName name, - PName familyName, - PDataType dataType, - Integer maxLength, - Integer scale, - boolean nullable, - int position, - SortOrder sortOrder, Integer arrSize, byte[] viewConstant, boolean isViewReferenced, String expressionStr, boolean isRowTimestamp, boolean isDynamic, byte[] columnQualifierBytes) { -init(name, familyName, dataType, maxLength, scale, nullable, position, sortOrder, arrSize, viewConstant, isViewReferenced, expressionStr, isRowTimestamp, isDynamic, columnQualifierBytes); +public PColumnImpl(PColumn column, int position) { +this(column, column.isDerived(), position); } -public PColumnImpl(PColumn column, int position) { +public PColumnImpl(PColumn column, byte[] viewConstant, boolean isViewReferenced) { +this(column.getName(), column.getFamilyName(), column.getDataType(), column.getMaxLength(), +column.getScale(), column.isNullable(), column.getPosition(), column.getSortOrder(), column.getArraySize(), viewConstant, isViewReferenced, column.getExpressionStr(), column.isRowTimestamp(), column.isDynamic(), column.getColumnQualifierBytes(), +column.getTimestamp(), column.isDerived()); +} + +public PColumnImpl(PColumn column, boolean derivedColumn, int position) { +this(column, derivedColumn, position, column.getViewConstant()); +} + +public PColumnImpl(PColumn column, boolean derivedColumn, int position, byte[] viewConstant) { this(column.getName(), column.getFamilyName(), column.getDataType(), column.getMaxLength(), -column.getScale(), column.isNullable(), position, column.getSortOrder(), column.getArraySize(), column.getViewConstant(), column.isViewReferenced(), column.getExpressionStr(), column.isRowTimestamp(), column.isDynamic(), column.getColumnQualifierBytes()); +column.getScale(), column.isNullable(), position, column.getSortOrder(), column.getArraySize(), viewConstant, column.isViewReferenced(), column.getExpressionStr(), column.isRowTimestamp(), column.isDynamic(), column.getColumnQualifierBytes(), +column.getTimestamp(), derivedColumn); +} + +public PColumnImpl(PName name, PName familyName, PDataType dataType, Integer maxLength, Integer scale, boolean nullable, +int position, SortOrder sortOrder, Integer arrSize, byte[] viewConstant, boolean isViewReferenced, String expressionStr, boolean isRowTimestamp, boolean isDynamic, +byte[] columnQualifierBytes, long timestamp) { +this(name, familyName, dataType, maxLength, scale, nullable, position, sortOrder, arrSize, viewConstant, isViewReferenced, expressionStr, isRowTimestamp, isDynamic, columnQualifierBytes, timestamp, false); +} + +public PColumnImpl(PName name, PName familyName, PDataType dataType, Integer maxLength, Integer scale, boolean nullable, +int position, SortOrder sortOrder, Integer arrSize, byte[] viewConstant, boolean isViewReferenced, String expressionStr, boolean isRowTimestamp, boolean isDynamic, +byte[] columnQualifierBytes, long timestamp, boolean derived) { +init(name, familyName, dataType, maxLength, scale, nullable, position, sortOrder, arrSize, viewConstant, isViewReferenced, expressionStr, isRowTimestamp, isDynamic, columnQualifierBytes, timestamp, derived); +} + +private PColumnImpl(PName familyName, PName columnName, Long timestamp) { +this.familyName = familyName; +this.name = columnName; +this.derived = true; +if (timestamp!=null) { +this.timestamp = timestamp; +} } -private void init(PName name, -PName familyName, -PDataType
[02/10] phoenix git commit: PHOENIX-3534 Support multi region SYSTEM.CATALOG table (Thomas D'Silva and Rahul Gidwani)
http://git-wip-us.apache.org/repos/asf/phoenix/blob/d56fd3c9/phoenix-core/src/main/java/org/apache/phoenix/schema/PColumnImpl.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/schema/PColumnImpl.java b/phoenix-core/src/main/java/org/apache/phoenix/schema/PColumnImpl.java index 45aca98..a267629 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/schema/PColumnImpl.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/PColumnImpl.java @@ -17,6 +17,7 @@ */ package org.apache.phoenix.schema; +import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.util.ByteStringer; import org.apache.phoenix.coprocessor.generated.PTableProtos; import org.apache.phoenix.query.QueryConstants; @@ -42,36 +43,63 @@ public class PColumnImpl implements PColumn { private boolean isRowTimestamp; private boolean isDynamic; private byte[] columnQualifierBytes; - +private boolean derived; +private long timestamp; + public PColumnImpl() { } -public PColumnImpl(PName name, - PName familyName, - PDataType dataType, - Integer maxLength, - Integer scale, - boolean nullable, - int position, - SortOrder sortOrder, Integer arrSize, byte[] viewConstant, boolean isViewReferenced, String expressionStr, boolean isRowTimestamp, boolean isDynamic, byte[] columnQualifierBytes) { -init(name, familyName, dataType, maxLength, scale, nullable, position, sortOrder, arrSize, viewConstant, isViewReferenced, expressionStr, isRowTimestamp, isDynamic, columnQualifierBytes); +public PColumnImpl(PColumn column, int position) { +this(column, column.isDerived(), position); } -public PColumnImpl(PColumn column, int position) { +public PColumnImpl(PColumn column, byte[] viewConstant, boolean isViewReferenced) { +this(column.getName(), column.getFamilyName(), column.getDataType(), column.getMaxLength(), +column.getScale(), column.isNullable(), column.getPosition(), column.getSortOrder(), column.getArraySize(), viewConstant, isViewReferenced, column.getExpressionStr(), column.isRowTimestamp(), column.isDynamic(), column.getColumnQualifierBytes(), +column.getTimestamp(), column.isDerived()); +} + +public PColumnImpl(PColumn column, boolean derivedColumn, int position) { +this(column, derivedColumn, position, column.getViewConstant()); +} + +public PColumnImpl(PColumn column, boolean derivedColumn, int position, byte[] viewConstant) { this(column.getName(), column.getFamilyName(), column.getDataType(), column.getMaxLength(), -column.getScale(), column.isNullable(), position, column.getSortOrder(), column.getArraySize(), column.getViewConstant(), column.isViewReferenced(), column.getExpressionStr(), column.isRowTimestamp(), column.isDynamic(), column.getColumnQualifierBytes()); +column.getScale(), column.isNullable(), position, column.getSortOrder(), column.getArraySize(), viewConstant, column.isViewReferenced(), column.getExpressionStr(), column.isRowTimestamp(), column.isDynamic(), column.getColumnQualifierBytes(), +column.getTimestamp(), derivedColumn); +} + +public PColumnImpl(PName name, PName familyName, PDataType dataType, Integer maxLength, Integer scale, boolean nullable, +int position, SortOrder sortOrder, Integer arrSize, byte[] viewConstant, boolean isViewReferenced, String expressionStr, boolean isRowTimestamp, boolean isDynamic, +byte[] columnQualifierBytes, long timestamp) { +this(name, familyName, dataType, maxLength, scale, nullable, position, sortOrder, arrSize, viewConstant, isViewReferenced, expressionStr, isRowTimestamp, isDynamic, columnQualifierBytes, timestamp, false); +} + +public PColumnImpl(PName name, PName familyName, PDataType dataType, Integer maxLength, Integer scale, boolean nullable, +int position, SortOrder sortOrder, Integer arrSize, byte[] viewConstant, boolean isViewReferenced, String expressionStr, boolean isRowTimestamp, boolean isDynamic, +byte[] columnQualifierBytes, long timestamp, boolean derived) { +init(name, familyName, dataType, maxLength, scale, nullable, position, sortOrder, arrSize, viewConstant, isViewReferenced, expressionStr, isRowTimestamp, isDynamic, columnQualifierBytes, timestamp, derived); +} + +private PColumnImpl(PName familyName, PName columnName, Long timestamp) { +this.familyName = familyName; +this.name = columnName; +this.derived = true; +if (timestamp!=null) { +this.timestamp = timestamp; +} } -private void init(PName name, -PName familyName, -PDataType
[02/10] phoenix git commit: PHOENIX-3534 Support multi region SYSTEM.CATALOG table (Thomas D'Silva and Rahul Gidwani)
http://git-wip-us.apache.org/repos/asf/phoenix/blob/3987c123/phoenix-core/src/main/java/org/apache/phoenix/schema/PColumnImpl.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/schema/PColumnImpl.java b/phoenix-core/src/main/java/org/apache/phoenix/schema/PColumnImpl.java index 45aca98..a267629 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/schema/PColumnImpl.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/PColumnImpl.java @@ -17,6 +17,7 @@ */ package org.apache.phoenix.schema; +import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.util.ByteStringer; import org.apache.phoenix.coprocessor.generated.PTableProtos; import org.apache.phoenix.query.QueryConstants; @@ -42,36 +43,63 @@ public class PColumnImpl implements PColumn { private boolean isRowTimestamp; private boolean isDynamic; private byte[] columnQualifierBytes; - +private boolean derived; +private long timestamp; + public PColumnImpl() { } -public PColumnImpl(PName name, - PName familyName, - PDataType dataType, - Integer maxLength, - Integer scale, - boolean nullable, - int position, - SortOrder sortOrder, Integer arrSize, byte[] viewConstant, boolean isViewReferenced, String expressionStr, boolean isRowTimestamp, boolean isDynamic, byte[] columnQualifierBytes) { -init(name, familyName, dataType, maxLength, scale, nullable, position, sortOrder, arrSize, viewConstant, isViewReferenced, expressionStr, isRowTimestamp, isDynamic, columnQualifierBytes); +public PColumnImpl(PColumn column, int position) { +this(column, column.isDerived(), position); } -public PColumnImpl(PColumn column, int position) { +public PColumnImpl(PColumn column, byte[] viewConstant, boolean isViewReferenced) { +this(column.getName(), column.getFamilyName(), column.getDataType(), column.getMaxLength(), +column.getScale(), column.isNullable(), column.getPosition(), column.getSortOrder(), column.getArraySize(), viewConstant, isViewReferenced, column.getExpressionStr(), column.isRowTimestamp(), column.isDynamic(), column.getColumnQualifierBytes(), +column.getTimestamp(), column.isDerived()); +} + +public PColumnImpl(PColumn column, boolean derivedColumn, int position) { +this(column, derivedColumn, position, column.getViewConstant()); +} + +public PColumnImpl(PColumn column, boolean derivedColumn, int position, byte[] viewConstant) { this(column.getName(), column.getFamilyName(), column.getDataType(), column.getMaxLength(), -column.getScale(), column.isNullable(), position, column.getSortOrder(), column.getArraySize(), column.getViewConstant(), column.isViewReferenced(), column.getExpressionStr(), column.isRowTimestamp(), column.isDynamic(), column.getColumnQualifierBytes()); +column.getScale(), column.isNullable(), position, column.getSortOrder(), column.getArraySize(), viewConstant, column.isViewReferenced(), column.getExpressionStr(), column.isRowTimestamp(), column.isDynamic(), column.getColumnQualifierBytes(), +column.getTimestamp(), derivedColumn); +} + +public PColumnImpl(PName name, PName familyName, PDataType dataType, Integer maxLength, Integer scale, boolean nullable, +int position, SortOrder sortOrder, Integer arrSize, byte[] viewConstant, boolean isViewReferenced, String expressionStr, boolean isRowTimestamp, boolean isDynamic, +byte[] columnQualifierBytes, long timestamp) { +this(name, familyName, dataType, maxLength, scale, nullable, position, sortOrder, arrSize, viewConstant, isViewReferenced, expressionStr, isRowTimestamp, isDynamic, columnQualifierBytes, timestamp, false); +} + +public PColumnImpl(PName name, PName familyName, PDataType dataType, Integer maxLength, Integer scale, boolean nullable, +int position, SortOrder sortOrder, Integer arrSize, byte[] viewConstant, boolean isViewReferenced, String expressionStr, boolean isRowTimestamp, boolean isDynamic, +byte[] columnQualifierBytes, long timestamp, boolean derived) { +init(name, familyName, dataType, maxLength, scale, nullable, position, sortOrder, arrSize, viewConstant, isViewReferenced, expressionStr, isRowTimestamp, isDynamic, columnQualifierBytes, timestamp, derived); +} + +private PColumnImpl(PName familyName, PName columnName, Long timestamp) { +this.familyName = familyName; +this.name = columnName; +this.derived = true; +if (timestamp!=null) { +this.timestamp = timestamp; +} } -private void init(PName name, -PName familyName, -PDataType
[02/10] phoenix git commit: PHOENIX-3534 Support multi region SYSTEM.CATALOG table (Thomas D'Silva and Rahul Gidwani)
http://git-wip-us.apache.org/repos/asf/phoenix/blob/93fdd5ba/phoenix-core/src/main/java/org/apache/phoenix/schema/PColumnImpl.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/schema/PColumnImpl.java b/phoenix-core/src/main/java/org/apache/phoenix/schema/PColumnImpl.java index 45aca98..a267629 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/schema/PColumnImpl.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/PColumnImpl.java @@ -17,6 +17,7 @@ */ package org.apache.phoenix.schema; +import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.util.ByteStringer; import org.apache.phoenix.coprocessor.generated.PTableProtos; import org.apache.phoenix.query.QueryConstants; @@ -42,36 +43,63 @@ public class PColumnImpl implements PColumn { private boolean isRowTimestamp; private boolean isDynamic; private byte[] columnQualifierBytes; - +private boolean derived; +private long timestamp; + public PColumnImpl() { } -public PColumnImpl(PName name, - PName familyName, - PDataType dataType, - Integer maxLength, - Integer scale, - boolean nullable, - int position, - SortOrder sortOrder, Integer arrSize, byte[] viewConstant, boolean isViewReferenced, String expressionStr, boolean isRowTimestamp, boolean isDynamic, byte[] columnQualifierBytes) { -init(name, familyName, dataType, maxLength, scale, nullable, position, sortOrder, arrSize, viewConstant, isViewReferenced, expressionStr, isRowTimestamp, isDynamic, columnQualifierBytes); +public PColumnImpl(PColumn column, int position) { +this(column, column.isDerived(), position); } -public PColumnImpl(PColumn column, int position) { +public PColumnImpl(PColumn column, byte[] viewConstant, boolean isViewReferenced) { +this(column.getName(), column.getFamilyName(), column.getDataType(), column.getMaxLength(), +column.getScale(), column.isNullable(), column.getPosition(), column.getSortOrder(), column.getArraySize(), viewConstant, isViewReferenced, column.getExpressionStr(), column.isRowTimestamp(), column.isDynamic(), column.getColumnQualifierBytes(), +column.getTimestamp(), column.isDerived()); +} + +public PColumnImpl(PColumn column, boolean derivedColumn, int position) { +this(column, derivedColumn, position, column.getViewConstant()); +} + +public PColumnImpl(PColumn column, boolean derivedColumn, int position, byte[] viewConstant) { this(column.getName(), column.getFamilyName(), column.getDataType(), column.getMaxLength(), -column.getScale(), column.isNullable(), position, column.getSortOrder(), column.getArraySize(), column.getViewConstant(), column.isViewReferenced(), column.getExpressionStr(), column.isRowTimestamp(), column.isDynamic(), column.getColumnQualifierBytes()); +column.getScale(), column.isNullable(), position, column.getSortOrder(), column.getArraySize(), viewConstant, column.isViewReferenced(), column.getExpressionStr(), column.isRowTimestamp(), column.isDynamic(), column.getColumnQualifierBytes(), +column.getTimestamp(), derivedColumn); +} + +public PColumnImpl(PName name, PName familyName, PDataType dataType, Integer maxLength, Integer scale, boolean nullable, +int position, SortOrder sortOrder, Integer arrSize, byte[] viewConstant, boolean isViewReferenced, String expressionStr, boolean isRowTimestamp, boolean isDynamic, +byte[] columnQualifierBytes, long timestamp) { +this(name, familyName, dataType, maxLength, scale, nullable, position, sortOrder, arrSize, viewConstant, isViewReferenced, expressionStr, isRowTimestamp, isDynamic, columnQualifierBytes, timestamp, false); +} + +public PColumnImpl(PName name, PName familyName, PDataType dataType, Integer maxLength, Integer scale, boolean nullable, +int position, SortOrder sortOrder, Integer arrSize, byte[] viewConstant, boolean isViewReferenced, String expressionStr, boolean isRowTimestamp, boolean isDynamic, +byte[] columnQualifierBytes, long timestamp, boolean derived) { +init(name, familyName, dataType, maxLength, scale, nullable, position, sortOrder, arrSize, viewConstant, isViewReferenced, expressionStr, isRowTimestamp, isDynamic, columnQualifierBytes, timestamp, derived); +} + +private PColumnImpl(PName familyName, PName columnName, Long timestamp) { +this.familyName = familyName; +this.name = columnName; +this.derived = true; +if (timestamp!=null) { +this.timestamp = timestamp; +} } -private void init(PName name, -PName familyName, -PDataType
[02/10] phoenix git commit: PHOENIX-3534 Support multi region SYSTEM.CATALOG table (Thomas D'Silva and Rahul Gidwani)
http://git-wip-us.apache.org/repos/asf/phoenix/blob/4d6dbf9c/phoenix-core/src/main/java/org/apache/phoenix/schema/PColumnImpl.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/schema/PColumnImpl.java b/phoenix-core/src/main/java/org/apache/phoenix/schema/PColumnImpl.java index 45aca98..a267629 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/schema/PColumnImpl.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/PColumnImpl.java @@ -17,6 +17,7 @@ */ package org.apache.phoenix.schema; +import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.util.ByteStringer; import org.apache.phoenix.coprocessor.generated.PTableProtos; import org.apache.phoenix.query.QueryConstants; @@ -42,36 +43,63 @@ public class PColumnImpl implements PColumn { private boolean isRowTimestamp; private boolean isDynamic; private byte[] columnQualifierBytes; - +private boolean derived; +private long timestamp; + public PColumnImpl() { } -public PColumnImpl(PName name, - PName familyName, - PDataType dataType, - Integer maxLength, - Integer scale, - boolean nullable, - int position, - SortOrder sortOrder, Integer arrSize, byte[] viewConstant, boolean isViewReferenced, String expressionStr, boolean isRowTimestamp, boolean isDynamic, byte[] columnQualifierBytes) { -init(name, familyName, dataType, maxLength, scale, nullable, position, sortOrder, arrSize, viewConstant, isViewReferenced, expressionStr, isRowTimestamp, isDynamic, columnQualifierBytes); +public PColumnImpl(PColumn column, int position) { +this(column, column.isDerived(), position); } -public PColumnImpl(PColumn column, int position) { +public PColumnImpl(PColumn column, byte[] viewConstant, boolean isViewReferenced) { +this(column.getName(), column.getFamilyName(), column.getDataType(), column.getMaxLength(), +column.getScale(), column.isNullable(), column.getPosition(), column.getSortOrder(), column.getArraySize(), viewConstant, isViewReferenced, column.getExpressionStr(), column.isRowTimestamp(), column.isDynamic(), column.getColumnQualifierBytes(), +column.getTimestamp(), column.isDerived()); +} + +public PColumnImpl(PColumn column, boolean derivedColumn, int position) { +this(column, derivedColumn, position, column.getViewConstant()); +} + +public PColumnImpl(PColumn column, boolean derivedColumn, int position, byte[] viewConstant) { this(column.getName(), column.getFamilyName(), column.getDataType(), column.getMaxLength(), -column.getScale(), column.isNullable(), position, column.getSortOrder(), column.getArraySize(), column.getViewConstant(), column.isViewReferenced(), column.getExpressionStr(), column.isRowTimestamp(), column.isDynamic(), column.getColumnQualifierBytes()); +column.getScale(), column.isNullable(), position, column.getSortOrder(), column.getArraySize(), viewConstant, column.isViewReferenced(), column.getExpressionStr(), column.isRowTimestamp(), column.isDynamic(), column.getColumnQualifierBytes(), +column.getTimestamp(), derivedColumn); +} + +public PColumnImpl(PName name, PName familyName, PDataType dataType, Integer maxLength, Integer scale, boolean nullable, +int position, SortOrder sortOrder, Integer arrSize, byte[] viewConstant, boolean isViewReferenced, String expressionStr, boolean isRowTimestamp, boolean isDynamic, +byte[] columnQualifierBytes, long timestamp) { +this(name, familyName, dataType, maxLength, scale, nullable, position, sortOrder, arrSize, viewConstant, isViewReferenced, expressionStr, isRowTimestamp, isDynamic, columnQualifierBytes, timestamp, false); +} + +public PColumnImpl(PName name, PName familyName, PDataType dataType, Integer maxLength, Integer scale, boolean nullable, +int position, SortOrder sortOrder, Integer arrSize, byte[] viewConstant, boolean isViewReferenced, String expressionStr, boolean isRowTimestamp, boolean isDynamic, +byte[] columnQualifierBytes, long timestamp, boolean derived) { +init(name, familyName, dataType, maxLength, scale, nullable, position, sortOrder, arrSize, viewConstant, isViewReferenced, expressionStr, isRowTimestamp, isDynamic, columnQualifierBytes, timestamp, derived); +} + +private PColumnImpl(PName familyName, PName columnName, Long timestamp) { +this.familyName = familyName; +this.name = columnName; +this.derived = true; +if (timestamp!=null) { +this.timestamp = timestamp; +} } -private void init(PName name, -PName familyName, -PDataType