From 53233be5a91a1f86c4e35c995a3492d09fde2a37 Mon Sep 17 00:00:00 2001 From: Chia-Ping Tsai Date: Thu, 28 Dec 2017 12:59:13 +0800 Subject: [PATCH] HBASE-19626 Rename Cell.DataType to Cell.Type --- .../hadoop/hbase/MetaTableAccessor.java | 38 +++++------ .../apache/hadoop/hbase/client/Append.java | 2 +- .../apache/hadoop/hbase/client/Delete.java | 2 +- .../apache/hadoop/hbase/client/Increment.java | 2 +- .../org/apache/hadoop/hbase/client/Put.java | 2 +- .../hadoop/hbase/filter/KeyOnlyFilter.java | 4 +- .../hadoop/hbase/protobuf/ProtobufUtil.java | 6 +- .../hbase/shaded/protobuf/ProtobufUtil.java | 6 +- .../hadoop/hbase/client/TestMutation.java | 14 ++-- .../hbase/ipc/TestHBaseRpcControllerImpl.java | 2 +- .../hbase/ByteBufferKeyOnlyKeyValue.java | 4 +- .../java/org/apache/hadoop/hbase/Cell.java | 8 +-- .../org/apache/hadoop/hbase/CellBuilder.java | 2 +- .../org/apache/hadoop/hbase/ExtendedCell.java | 4 +- .../hadoop/hbase/ExtendedCellBuilder.java | 2 +- .../hadoop/hbase/ExtendedCellBuilderImpl.java | 2 +- .../apache/hadoop/hbase/PrivateCellUtil.java | 65 +++++++++---------- .../apache/hadoop/hbase/RawCellBuilder.java | 2 +- .../apache/hadoop/hbase/TestCellBuilder.java | 4 +- .../org/apache/hadoop/hbase/TestCellUtil.java | 25 +++---- .../org/apache/hadoop/hbase/TestKeyValue.java | 29 ++++----- .../example/MultiThreadedClientExample.java | 7 +- .../example/ValueRewritingObserver.java | 2 +- .../example/WriteHeavyIncrementObserver.java | 4 +- .../apache/hadoop/hbase/rest/RowResource.java | 8 +-- .../favored/FavoredNodeAssignmentHelper.java | 4 +- .../hbase/master/TableNamespaceManager.java | 4 +- .../master/assignment/RegionStateStore.java | 5 +- .../security/access/AccessControlLists.java | 4 +- .../DefaultVisibilityLabelServiceImpl.java | 8 +-- .../hbase/client/TestMultiRespectsLimits.java | 4 +- .../TestPassCustomCellViaRegionObserver.java | 12 ++-- .../hbase/regionserver/MockHStoreFile.java | 6 +- .../TestCompactionLifeCycleTracker.java | 7 +- .../TestFlushLifeCycleTracker.java | 6 +- .../hbase/regionserver/TestHRegion.java | 12 ++-- .../hadoop/hbase/regionserver/TestHStore.java | 8 +-- .../regionserver/TestWALEntrySinkFilter.java | 2 +- ...ExpAsStringVisibilityLabelServiceImpl.java | 3 +- .../hbase/thrift/ThriftServerRunner.java | 8 +-- .../hadoop/hbase/thrift2/ThriftUtilities.java | 5 +- 41 files changed, 171 insertions(+), 173 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java index f75472b25c4..c53e2acb665 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java @@ -35,7 +35,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.Cell.DataType; +import org.apache.hadoop.hbase.Cell.Type; import org.apache.hadoop.hbase.client.Connection; import org.apache.hadoop.hbase.client.ConnectionFactory; import org.apache.hadoop.hbase.client.Consistency; @@ -1358,7 +1358,7 @@ public class MetaTableAccessor { .setFamily(HConstants.REPLICATION_BARRIER_FAMILY) .setQualifier(seqBytes) .setTimestamp(put.getTimeStamp()) - .setType(DataType.Put) + .setType(Type.Put) .setValue(seqBytes) .build()) .add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY) @@ -1366,7 +1366,7 @@ public class MetaTableAccessor { .setFamily(HConstants.REPLICATION_META_FAMILY) .setQualifier(tableNameCq) .setTimestamp(put.getTimeStamp()) - .setType(DataType.Put) + .setType(Cell.Type.Put) .setValue(tableName) .build()); return put; @@ -1380,7 +1380,7 @@ public class MetaTableAccessor { .setFamily(HConstants.REPLICATION_META_FAMILY) .setQualifier(daughterNameCq) .setTimestamp(put.getTimeStamp()) - .setType(DataType.Put) + .setType(Type.Put) .setValue(value) .build()); return put; @@ -1393,7 +1393,7 @@ public class MetaTableAccessor { .setFamily(HConstants.REPLICATION_META_FAMILY) .setQualifier(parentNameCq) .setTimestamp(put.getTimeStamp()) - .setType(DataType.Put) + .setType(Type.Put) .setValue(value) .build()); return put; @@ -1410,7 +1410,7 @@ public class MetaTableAccessor { .setFamily(HConstants.CATALOG_FAMILY) .setQualifier(HConstants.SPLITA_QUALIFIER) .setTimestamp(put.getTimeStamp()) - .setType(DataType.Put) + .setType(Type.Put) .setValue(RegionInfo.toByteArray(splitA)) .build()); } @@ -1420,7 +1420,7 @@ public class MetaTableAccessor { .setFamily(HConstants.CATALOG_FAMILY) .setQualifier(HConstants.SPLITB_QUALIFIER) .setTimestamp(put.getTimeStamp()) - .setType(DataType.Put) + .setType(Type.Put) .setValue(RegionInfo.toByteArray(splitB)) .build()); } @@ -1555,7 +1555,7 @@ public class MetaTableAccessor { .setFamily(HConstants.CATALOG_FAMILY) .setQualifier(getRegionStateColumn()) .setTimestamp(put.getTimeStamp()) - .setType(DataType.Put) + .setType(Cell.Type.Put) .setValue(Bytes.toBytes(state.name())) .build()); } @@ -1667,7 +1667,7 @@ public class MetaTableAccessor { .setFamily(HConstants.CATALOG_FAMILY) .setQualifier(HConstants.MERGEA_QUALIFIER) .setTimestamp(putOfMerged.getTimeStamp()) - .setType(DataType.Put) + .setType(Type.Put) .setValue(RegionInfo.toByteArray(regionA)) .build()) .add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY) @@ -1675,7 +1675,7 @@ public class MetaTableAccessor { .setFamily(HConstants.CATALOG_FAMILY) .setQualifier(HConstants.MERGEB_QUALIFIER) .setTimestamp(putOfMerged.getTimeStamp()) - .setType(DataType.Put) + .setType(Type.Put) .setValue(RegionInfo.toByteArray(regionB)) .build()); @@ -1918,7 +1918,7 @@ public class MetaTableAccessor { .setFamily(HConstants.REPLICATION_POSITION_FAMILY) .setQualifier(Bytes.toBytes(peerId)) .setTimestamp(put.getTimeStamp()) - .setType(DataType.Put) + .setType(Cell.Type.Put) .setValue(Bytes.toBytes(Math.abs(entry.getValue()))) .build()); puts.add(put); @@ -2052,7 +2052,7 @@ public class MetaTableAccessor { .setFamily(getCatalogFamily()) .setQualifier(HConstants.REGIONINFO_QUALIFIER) .setTimestamp(p.getTimeStamp()) - .setType(DataType.Put) + .setType(Type.Put) .setValue(RegionInfo.toByteArray(hri)) .build()); return p; @@ -2069,7 +2069,7 @@ public class MetaTableAccessor { .setFamily(getCatalogFamily()) .setQualifier(getServerColumn(replicaId)) .setTimestamp(time) - .setType(DataType.Put) + .setType(Cell.Type.Put) .setValue(Bytes.toBytes(sn.getAddress().toString())) .build()) .add(builder.clear() @@ -2077,7 +2077,7 @@ public class MetaTableAccessor { .setFamily(getCatalogFamily()) .setQualifier(getStartCodeColumn(replicaId)) .setTimestamp(time) - .setType(DataType.Put) + .setType(Cell.Type.Put) .setValue(Bytes.toBytes(sn.getStartcode())) .build()) .add(builder.clear() @@ -2085,7 +2085,7 @@ public class MetaTableAccessor { .setFamily(getCatalogFamily()) .setQualifier(getSeqNumColumn(replicaId)) .setTimestamp(time) - .setType(DataType.Put) + .setType(Type.Put) .setValue(Bytes.toBytes(openSeqNum)) .build()); } @@ -2098,21 +2098,21 @@ public class MetaTableAccessor { .setFamily(getCatalogFamily()) .setQualifier(getServerColumn(replicaId)) .setTimestamp(now) - .setType(DataType.Put) + .setType(Type.Put) .build()) .add(builder.clear() .setRow(p.getRow()) .setFamily(getCatalogFamily()) .setQualifier(getStartCodeColumn(replicaId)) .setTimestamp(now) - .setType(DataType.Put) + .setType(Cell.Type.Put) .build()) .add(builder.clear() .setRow(p.getRow()) .setFamily(getCatalogFamily()) .setQualifier(getSeqNumColumn(replicaId)) .setTimestamp(now) - .setType(DataType.Put) + .setType(Cell.Type.Put) .build()); } @@ -2141,7 +2141,7 @@ public class MetaTableAccessor { .setFamily(HConstants.CATALOG_FAMILY) .setQualifier(getSeqNumColumn(replicaId)) .setTimestamp(time) - .setType(DataType.Put) + .setType(Type.Put) .setValue(Bytes.toBytes(openSeqNum)) .build()); } diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java index b2995ed0d68..61474b7e357 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java @@ -136,7 +136,7 @@ public class Append extends Mutation { /** * Construct the Append with user defined data. NOTED: - * 1) all cells in the familyMap must have the DataType.Put + * 1) all cells in the familyMap must have the Type.Put * 2) the row of each cell must be same with passed row. * @param row row. CAN'T be null * @param ts timestamp diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java index b5a0b93ebb2..33389cfc697 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java @@ -143,7 +143,7 @@ public class Delete extends Mutation implements Comparable { /** * Construct the Delete with user defined data. NOTED: * 1) all cells in the familyMap must have the delete type. - * see {@link org.apache.hadoop.hbase.Cell.DataType} + * see {@link org.apache.hadoop.hbase.Cell.Type} * 2) the row of each cell must be same with passed row. * @param row row. CAN'T be null * @param ts timestamp diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Increment.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Increment.java index 1ccc7e99929..5ab5b85e4f9 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Increment.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Increment.java @@ -81,7 +81,7 @@ public class Increment extends Mutation implements Comparable { /** * Construct the Increment with user defined data. NOTED: - * 1) all cells in the familyMap must have the DataType.Put + * 1) all cells in the familyMap must have the Type.Put * 2) the row of each cell must be same with passed row. * @param row row. CAN'T be null * @param ts timestamp diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Put.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Put.java index 34ddf08e30d..b817d7030cd 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Put.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Put.java @@ -157,7 +157,7 @@ public class Put extends Mutation implements HeapSize, Comparable { /** * Construct the Put with user defined data. NOTED: - * 1) all cells in the familyMap must have the DataType.Put + * 1) all cells in the familyMap must have the Type.Put * 2) the row of each cell must be same with passed row. * @param row row. CAN'T be null * @param ts timestamp diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/KeyOnlyFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/KeyOnlyFilter.java index 4487292904b..c8aa0842885 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/KeyOnlyFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/KeyOnlyFilter.java @@ -198,7 +198,7 @@ public class KeyOnlyFilter extends FilterBase { } @Override - public DataType getType() { + public Type getType() { return cell.getType(); } @@ -334,7 +334,7 @@ public class KeyOnlyFilter extends FilterBase { } @Override - public DataType getType() { + public Type getType() { return cell.getType(); } diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java index 267dc7a55f6..2152c7c8a34 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java @@ -41,7 +41,7 @@ import java.util.function.Function; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; -import org.apache.hadoop.hbase.Cell.DataType; +import org.apache.hadoop.hbase.Cell.Type; import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.CellScanner; import org.apache.hadoop.hbase.CellUtil; @@ -536,7 +536,7 @@ public final class ProtobufUtil { .setFamily(family) .setQualifier(qv.hasQualifier() ? qv.getQualifier().toByteArray() : null) .setTimestamp(ts) - .setType(DataType.Put) + .setType(Cell.Type.Put) .setValue(qv.hasValue() ? qv.getValue().toByteArray() : null) .setTags(allTagsBytes) .build()); @@ -556,7 +556,7 @@ public final class ProtobufUtil { .setFamily(family) .setQualifier(qv.hasQualifier() ? qv.getQualifier().toByteArray() : null) .setTimestamp(ts) - .setType(DataType.Put) + .setType(Type.Put) .setValue(qv.hasValue() ? qv.getValue().toByteArray() : null) .build()); } diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java index 8f441358ce2..8d7c95689d3 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java @@ -44,7 +44,7 @@ import org.apache.hadoop.hbase.ByteBufferExtendedCell; import org.apache.hadoop.hbase.CacheEvictionStats; import org.apache.hadoop.hbase.CacheEvictionStatsBuilder; import org.apache.hadoop.hbase.Cell; -import org.apache.hadoop.hbase.Cell.DataType; +import org.apache.hadoop.hbase.Cell.Type; import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.CellScanner; import org.apache.hadoop.hbase.CellUtil; @@ -670,7 +670,7 @@ public final class ProtobufUtil { .setFamily(family) .setQualifier(qv.hasQualifier() ? qv.getQualifier().toByteArray() : null) .setTimestamp(ts) - .setType(DataType.Put) + .setType(Cell.Type.Put) .setValue(qv.hasValue() ? qv.getValue().toByteArray() : null) .setTags(allTagsBytes) .build()); @@ -690,7 +690,7 @@ public final class ProtobufUtil { .setFamily(family) .setQualifier(qv.hasQualifier() ? qv.getQualifier().toByteArray() : null) .setTimestamp(ts) - .setType(DataType.Put) + .setType(Type.Put) .setValue(qv.hasValue() ? qv.getValue().toByteArray() : null) .build()); } diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestMutation.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestMutation.java index 111634a8141..9b8144db863 100644 --- a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestMutation.java +++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestMutation.java @@ -25,7 +25,7 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import java.util.List; import org.apache.hadoop.hbase.Cell; -import org.apache.hadoop.hbase.Cell.DataType; +import org.apache.hadoop.hbase.Cell.Type; import org.apache.hadoop.hbase.CellBuilderFactory; import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.CellUtil; @@ -50,7 +50,7 @@ public class TestMutation { .setRow(origin.getRow()) .setFamily(family) .setQualifier(Bytes.toBytes("q")) - .setType(DataType.Put) + .setType(Type.Put) .setValue(Bytes.toBytes(100)) .build()); origin.addColumn(family, Bytes.toBytes("q0"), Bytes.toBytes("value")); @@ -73,7 +73,7 @@ public class TestMutation { .setRow(origin.getRow()) .setFamily(family) .setQualifier(Bytes.toBytes("q")) - .setType(DataType.Put) + .setType(Cell.Type.Put) .setValue(Bytes.toBytes(100)) .build()); origin.addColumn(family, Bytes.toBytes("q0"), 4); @@ -96,7 +96,7 @@ public class TestMutation { .setRow(origin.getRow()) .setFamily(family) .setQualifier(Bytes.toBytes("q")) - .setType(DataType.Delete) + .setType(Type.Delete) .build()); origin.addColumn(family, Bytes.toBytes("q0")); origin.addColumns(family, Bytes.toBytes("q1")); @@ -121,7 +121,7 @@ public class TestMutation { .setRow(origin.getRow()) .setFamily(family) .setQualifier(Bytes.toBytes("q")) - .setType(DataType.Put) + .setType(Cell.Type.Put) .setValue(Bytes.toBytes("value")) .build()); origin.addColumn(family, Bytes.toBytes("q0"), Bytes.toBytes("V-01")); @@ -202,7 +202,7 @@ public class TestMutation { .setFamily(family) .setQualifier(qualifier0) .setTimestamp(put.getTimeStamp()) - .setType(DataType.Put) + .setType(Type.Put) .setValue(value0) .build()) .add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY) @@ -210,7 +210,7 @@ public class TestMutation { .setFamily(family) .setQualifier(qualifier1) .setTimestamp(ts1) - .setType(DataType.Put) + .setType(Type.Put) .setValue(value1) .build()); diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestHBaseRpcControllerImpl.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestHBaseRpcControllerImpl.java index bfd1eb99858..6990b30b035 100644 --- a/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestHBaseRpcControllerImpl.java +++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestHBaseRpcControllerImpl.java @@ -179,7 +179,7 @@ public class TestHBaseRpcControllerImpl { } @Override - public DataType getType() { + public Type getType() { // unused return null; } diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/ByteBufferKeyOnlyKeyValue.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/ByteBufferKeyOnlyKeyValue.java index 7ecb946b543..db2890f2950 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/ByteBufferKeyOnlyKeyValue.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/ByteBufferKeyOnlyKeyValue.java @@ -152,8 +152,8 @@ public class ByteBufferKeyOnlyKeyValue extends ByteBufferExtendedCell { return ByteBufferUtils.toByte(this.buf, this.offset + this.length - 1); } - public DataType getType() { - return PrivateCellUtil.toDataType(getTypeByte()); + public Type getType() { + return PrivateCellUtil.toType(getTypeByte()); } @Override diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/Cell.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/Cell.java index 40f0a1c3e23..f208625e9c5 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/Cell.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/Cell.java @@ -201,15 +201,15 @@ public interface Cell { int getTagsLength(); /** - * Returns the type of cell in a human readable format using {@link DataType} + * Returns the type of cell in a human readable format using {@link Type} * @return The data type this cell: one of Put, Delete, etc */ - DataType getType(); + Type getType(); /** * The valid types for user to build the cell. Currently, This is subset of {@link KeyValue.Type}. */ - public enum DataType { + enum Type { Put((byte) 4), Delete((byte) 8), @@ -222,7 +222,7 @@ public interface Cell { private final byte code; - DataType(final byte c) { + Type(final byte c) { this.code = c; } diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/CellBuilder.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/CellBuilder.java index e89ac3762a4..4b39a12d9fd 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/CellBuilder.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/CellBuilder.java @@ -37,7 +37,7 @@ public interface CellBuilder { CellBuilder setTimestamp(final long timestamp); - CellBuilder setType(final Cell.DataType type); + CellBuilder setType(final Cell.Type type); CellBuilder setValue(final byte[] value); CellBuilder setValue(final byte[] value, final int vOffset, final int vLength); diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/ExtendedCell.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/ExtendedCell.java index 31df296e1d2..be6d96c7ce5 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/ExtendedCell.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/ExtendedCell.java @@ -169,8 +169,8 @@ public interface ExtendedCell extends RawCell, HeapSize, Cloneable { * {@link KeyValue.Type#Minimum} */ @Override - default DataType getType() { - return PrivateCellUtil.toDataType(getTypeByte()); + default Type getType() { + return PrivateCellUtil.toType(getTypeByte()); } /** diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/ExtendedCellBuilder.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/ExtendedCellBuilder.java index 0afe27359e2..1b892b877e4 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/ExtendedCellBuilder.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/ExtendedCellBuilder.java @@ -49,7 +49,7 @@ public interface ExtendedCellBuilder extends RawCellBuilder { ExtendedCellBuilder setTimestamp(final long timestamp); @Override - ExtendedCellBuilder setType(final Cell.DataType type); + ExtendedCellBuilder setType(final Cell.Type type); ExtendedCellBuilder setType(final byte type); diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/ExtendedCellBuilderImpl.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/ExtendedCellBuilderImpl.java index 770b61d3277..a8e02ed387f 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/ExtendedCellBuilderImpl.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/ExtendedCellBuilderImpl.java @@ -89,7 +89,7 @@ public abstract class ExtendedCellBuilderImpl implements ExtendedCellBuilder { } @Override - public ExtendedCellBuilder setType(final Cell.DataType type) { + public ExtendedCellBuilder setType(final Cell.Type type) { this.type = PrivateCellUtil.toTypeByte(type); return this; } diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/PrivateCellUtil.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/PrivateCellUtil.java index 69eaab07674..de2e482481f 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/PrivateCellUtil.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/PrivateCellUtil.java @@ -30,7 +30,6 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Optional; -import org.apache.hadoop.hbase.KeyValue.Type; import org.apache.hadoop.hbase.filter.ByteArrayComparable; import org.apache.hadoop.hbase.io.HeapSize; import org.apache.hadoop.hbase.io.TagCompressionContext; @@ -799,30 +798,30 @@ public final class PrivateCellUtil { * or a {@link KeyValue.Type#DeleteColumn} KeyValue type. */ public static boolean isDelete(final byte type) { - return Type.Delete.getCode() <= type && type <= Type.DeleteFamily.getCode(); + return KeyValue.Type.Delete.getCode() <= type && type <= KeyValue.Type.DeleteFamily.getCode(); } /** * @return True if this cell is a {@link KeyValue.Type#Delete} type. */ public static boolean isDeleteType(Cell cell) { - return cell.getTypeByte() == Type.Delete.getCode(); + return cell.getTypeByte() == KeyValue.Type.Delete.getCode(); } public static boolean isDeleteFamily(final Cell cell) { - return cell.getTypeByte() == Type.DeleteFamily.getCode(); + return cell.getTypeByte() == KeyValue.Type.DeleteFamily.getCode(); } public static boolean isDeleteFamilyVersion(final Cell cell) { - return cell.getTypeByte() == Type.DeleteFamilyVersion.getCode(); + return cell.getTypeByte() == KeyValue.Type.DeleteFamilyVersion.getCode(); } public static boolean isDeleteColumns(final Cell cell) { - return cell.getTypeByte() == Type.DeleteColumn.getCode(); + return cell.getTypeByte() == KeyValue.Type.DeleteColumn.getCode(); } public static boolean isDeleteColumnVersion(final Cell cell) { - return cell.getTypeByte() == Type.Delete.getCode(); + return cell.getTypeByte() == KeyValue.Type.Delete.getCode(); } /** @@ -830,7 +829,7 @@ public final class PrivateCellUtil { */ public static boolean isDeleteColumnOrFamily(Cell cell) { int t = cell.getTypeByte(); - return t == Type.DeleteColumn.getCode() || t == Type.DeleteFamily.getCode(); + return t == KeyValue.Type.DeleteColumn.getCode() || t == KeyValue.Type.DeleteFamily.getCode(); } public static byte[] cloneTags(Cell cell) { @@ -1166,11 +1165,11 @@ public final class PrivateCellUtil { // "lexicographically last column" (it would be infinitely long). The // "maximum" key type does not need this behavior. if (nextIndexedCell.getFamilyLength() + nextIndexedCell.getQualifierLength() == 0 - && nextIndexedCell.getTypeByte() == Type.Minimum.getCode()) { + && nextIndexedCell.getTypeByte() == KeyValue.Type.Minimum.getCode()) { // left is "bigger", i.e. it appears later in the sorted order return 1; } - if (flen + clen == 0 && type == Type.Minimum.getCode()) { + if (flen + clen == 0 && type == KeyValue.Type.Minimum.getCode()) { return -1; } @@ -1254,19 +1253,19 @@ public final class PrivateCellUtil { cell.getQualifierLength()); } - public static Cell.DataType toDataType(byte type) { - Type codeToType = KeyValue.Type.codeToType(type); + public static Cell.Type toType(byte type) { + KeyValue.Type codeToType = KeyValue.Type.codeToType(type); switch (codeToType) { - case Put: return Cell.DataType.Put; - case Delete: return Cell.DataType.Delete; - case DeleteColumn: return Cell.DataType.DeleteColumn; - case DeleteFamily: return Cell.DataType.DeleteFamily; - case DeleteFamilyVersion: return Cell.DataType.DeleteFamilyVersion; + case Put: return Cell.Type.Put; + case Delete: return Cell.Type.Delete; + case DeleteColumn: return Cell.Type.DeleteColumn; + case DeleteFamily: return Cell.Type.DeleteFamily; + case DeleteFamilyVersion: return Cell.Type.DeleteFamilyVersion; default: throw new UnsupportedOperationException("Invalid type of cell "+type); } } - public static KeyValue.Type toTypeByte(Cell.DataType type) { + public static KeyValue.Type toTypeByte(Cell.Type type) { switch (type) { case Put: return KeyValue.Type.Put; case Delete: return KeyValue.Type.Delete; @@ -1590,11 +1589,11 @@ public final class PrivateCellUtil { @Override public byte getTypeByte() { - return Type.Maximum.getCode(); + return KeyValue.Type.Maximum.getCode(); } @Override - public DataType getType() { + public Type getType() { throw new UnsupportedOperationException(); } } @@ -1645,11 +1644,11 @@ public final class PrivateCellUtil { @Override public byte getTypeByte() { - return Type.Maximum.getCode(); + return KeyValue.Type.Maximum.getCode(); } @Override - public DataType getType() { + public Type getType() { throw new UnsupportedOperationException(); } } @@ -1700,11 +1699,11 @@ public final class PrivateCellUtil { @Override public byte getTypeByte() { - return Type.Minimum.getCode(); + return KeyValue.Type.Minimum.getCode(); } @Override - public DataType getType() { + public Type getType() { throw new UnsupportedOperationException(); } } @@ -1935,11 +1934,11 @@ public final class PrivateCellUtil { @Override public byte getTypeByte() { - return Type.Minimum.getCode(); + return KeyValue.Type.Minimum.getCode(); } @Override - public DataType getType() { + public Type getType() { throw new UnsupportedOperationException(); } } @@ -2125,12 +2124,12 @@ public final class PrivateCellUtil { @Override public byte getTypeByte() { - return Type.DeleteFamily.getCode(); + return KeyValue.Type.DeleteFamily.getCode(); } @Override - public DataType getType() { - return DataType.DeleteFamily; + public Type getType() { + return Type.DeleteFamily; } } @@ -2633,11 +2632,11 @@ public final class PrivateCellUtil { // for specifying the last key/value in a given row, because there is no // "lexicographically last column" (it would be infinitely long). The // "maximum" key type does not need this behavior. - if (lcolumnlength == 0 && ltype == Type.Minimum.getCode()) { + if (lcolumnlength == 0 && ltype == KeyValue.Type.Minimum.getCode()) { // left is "bigger", i.e. it appears later in the sorted order return 1; } - if (rcolumnlength == 0 && rtype == Type.Minimum.getCode()) { + if (rcolumnlength == 0 && rtype == KeyValue.Type.Minimum.getCode()) { return -1; } @@ -2683,11 +2682,11 @@ public final class PrivateCellUtil { public static Cell createNextOnRowCol(Cell cell) { long ts = cell.getTimestamp(); byte type = cell.getTypeByte(); - if (type != Type.Minimum.getCode()) { + if (type != KeyValue.Type.Minimum.getCode()) { type = KeyValue.Type.values()[KeyValue.Type.codeToType(type).ordinal() - 1].getCode(); } else if (ts != HConstants.OLDEST_TIMESTAMP) { ts = ts - 1; - type = Type.Maximum.getCode(); + type = KeyValue.Type.Maximum.getCode(); } else { return cell; } diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/RawCellBuilder.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/RawCellBuilder.java index 22bb358faa6..53920f6753a 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/RawCellBuilder.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/RawCellBuilder.java @@ -45,7 +45,7 @@ public interface RawCellBuilder extends CellBuilder { RawCellBuilder setTimestamp(final long timestamp); @Override - RawCellBuilder setType(final Cell.DataType type); + RawCellBuilder setType(final Cell.Type type); @Override RawCellBuilder setValue(final byte[] value); diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestCellBuilder.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestCellBuilder.java index 5c6c65af98d..1443878fb1f 100644 --- a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestCellBuilder.java +++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestCellBuilder.java @@ -41,7 +41,7 @@ public class TestCellBuilder { .setRow(row) .setFamily(family) .setQualifier(qualifier) - .setType(Cell.DataType.Put) + .setType(Cell.Type.Put) .setValue(value) .build(); row[0] = NEW_DATA; @@ -64,7 +64,7 @@ public class TestCellBuilder { .setRow(row) .setFamily(family) .setQualifier(qualifier) - .setType(Cell.DataType.Put) + .setType(Cell.Type.Put) .setValue(value) .build(); row[0] = NEW_DATA; diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestCellUtil.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestCellUtil.java index 41c0fc4e69e..60a1d55cd8f 100644 --- a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestCellUtil.java +++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestCellUtil.java @@ -30,8 +30,6 @@ import java.util.ArrayList; import java.util.List; import java.util.NavigableMap; import java.util.TreeMap; - -import org.apache.hadoop.hbase.KeyValue.Type; import org.apache.hadoop.hbase.testclassification.MiscTests; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.apache.hadoop.hbase.util.Bytes; @@ -199,8 +197,8 @@ public class TestCellUtil { } @Override - public DataType getType() { - return PrivateCellUtil.toDataType(getTypeByte()); + public Type getType() { + return PrivateCellUtil.toType(getTypeByte()); } } @@ -352,7 +350,7 @@ public class TestCellUtil { + kv6.getFamilyLength() + kv6.getQualifierLength() + 7, PrivateCellUtil.findCommonPrefixInFlatKey(kv6, kv7, true, true)); // rk, cf, q and ts are same. Only type differs - KeyValue kv8 = new KeyValue(Bytes.toBytes("rk"), 1234L, Type.Delete); + KeyValue kv8 = new KeyValue(Bytes.toBytes("rk"), 1234L, KeyValue.Type.Delete); Assert.assertEquals(KeyValue.ROW_LENGTH_SIZE + kv6.getRowLength() + KeyValue.FAMILY_LENGTH_SIZE + kv6.getFamilyLength() + kv6.getQualifierLength() + KeyValue.TIMESTAMP_SIZE, PrivateCellUtil.findCommonPrefixInFlatKey(kv6, kv8, true, true)); @@ -393,7 +391,7 @@ public class TestCellUtil { String family = "test.family"; String qualifier = "test.qualifier"; long timestamp = 42; - Type type = Type.Put; + KeyValue.Type type = KeyValue.Type.Put; String value = "test.value"; long seqId = 1042; @@ -428,7 +426,8 @@ public class TestCellUtil { byte[] q = Bytes.toBytes("qual1"); byte[] v = Bytes.toBytes("val1"); byte[] tags = Bytes.toBytes("tag1"); - KeyValue kv = new KeyValue(r, f, q, 0, q.length, 1234L, Type.Put, v, 0, v.length, tags); + KeyValue kv = + new KeyValue(r, f, q, 0, q.length, 1234L, KeyValue.Type.Put, v, 0, v.length, tags); ByteBuffer buffer = ByteBuffer.wrap(kv.getBuffer()); Cell bbCell = new ByteBufferKeyValue(buffer, 0, buffer.remaining()); byte[] rDest = CellUtil.cloneRow(bbCell); @@ -452,10 +451,11 @@ public class TestCellUtil { byte[] q2 = Bytes.toBytes("qual2"); byte[] v = Bytes.toBytes("val1"); byte[] tags = Bytes.toBytes("tag1"); - KeyValue kv = new KeyValue(r, f, q1, 0, q1.length, 1234L, Type.Put, v, 0, v.length, tags); + KeyValue kv = + new KeyValue(r, f, q1, 0, q1.length, 1234L, KeyValue.Type.Put, v, 0, v.length, tags); ByteBuffer buffer = ByteBuffer.wrap(kv.getBuffer()); Cell bbCell1 = new ByteBufferKeyValue(buffer, 0, buffer.remaining()); - kv = new KeyValue(r, f, q2, 0, q2.length, 1234L, Type.Put, v, 0, v.length, tags); + kv = new KeyValue(r, f, q2, 0, q2.length, 1234L, KeyValue.Type.Put, v, 0, v.length, tags); buffer = ByteBuffer.wrap(kv.getBuffer()); Cell bbCell2 = new ByteBufferKeyValue(buffer, 0, buffer.remaining()); assertTrue(CellUtil.matchingRows(bbCell1, bbCell2)); @@ -512,7 +512,8 @@ public class TestCellUtil { byte[] q2 = Bytes.toBytes("qual2"); byte[] v = Bytes.toBytes("val1"); byte[] tags = Bytes.toBytes("tag1"); - KeyValue kv = new KeyValue(r, f, q1, 0, q1.length, 1234L, Type.Put, v, 0, v.length, tags); + KeyValue kv = + new KeyValue(r, f, q1, 0, q1.length, 1234L, KeyValue.Type.Put, v, 0, v.length, tags); NonExtendedCell nonExtCell = new NonExtendedCell(kv); ByteArrayOutputStream os = new ByteArrayOutputStream(); int writeCell = PrivateCellUtil.writeCell(nonExtCell, os, true); @@ -619,8 +620,8 @@ public class TestCellUtil { } @Override - public DataType getType() { - return PrivateCellUtil.toDataType(getTypeByte()); + public Type getType() { + return PrivateCellUtil.toType(getTypeByte()); } } } diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestKeyValue.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestKeyValue.java index 881c679828b..bd45a09276b 100644 --- a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestKeyValue.java +++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestKeyValue.java @@ -31,7 +31,6 @@ import java.util.List; import java.util.Set; import java.util.TreeSet; -import org.apache.hadoop.hbase.KeyValue.Type; import org.apache.hadoop.hbase.util.ByteBufferUtils; import org.apache.hadoop.hbase.util.Bytes; import org.slf4j.Logger; @@ -49,14 +48,14 @@ public class TestKeyValue extends TestCase { byte [] family2 = Bytes.toBytes("abcd"); byte [] qualifier2 = Bytes.toBytes("ef"); - KeyValue aaa = new KeyValue(a, family1, qualifier1, 0L, Type.Put, a); + KeyValue aaa = new KeyValue(a, family1, qualifier1, 0L, KeyValue.Type.Put, a); assertFalse(CellUtil.matchingColumn(aaa, family2, qualifier2)); assertTrue(CellUtil.matchingColumn(aaa, family1, qualifier1)); - aaa = new KeyValue(a, family2, qualifier2, 0L, Type.Put, a); + aaa = new KeyValue(a, family2, qualifier2, 0L, KeyValue.Type.Put, a); assertFalse(CellUtil.matchingColumn(aaa, family1, qualifier1)); assertTrue(CellUtil.matchingColumn(aaa, family2,qualifier2)); byte [] nullQualifier = new byte[0]; - aaa = new KeyValue(a, family1, nullQualifier, 0L, Type.Put, a); + aaa = new KeyValue(a, family1, nullQualifier, 0L, KeyValue.Type.Put, a); assertTrue(CellUtil.matchingColumn(aaa, family1,null)); assertFalse(CellUtil.matchingColumn(aaa, family2,qualifier2)); } @@ -72,7 +71,7 @@ public class TestKeyValue extends TestCase { byte [] family2 = Bytes.toBytes("ab"); byte [] qualifier2 = Bytes.toBytes("def"); - KeyValue aaa = new KeyValue(a, family1, qualifier1, 0L, Type.Put, a); + KeyValue aaa = new KeyValue(a, family1, qualifier1, 0L, KeyValue.Type.Put, a); assertFalse(CellUtil.matchingColumn(aaa, family2, qualifier2)); } @@ -301,15 +300,15 @@ public class TestKeyValue extends TestCase { long ts = 1; // 'fa:' - KeyValue kv_0 = new KeyValue(row, fa, qual0, ts, Type.Put); + KeyValue kv_0 = new KeyValue(row, fa, qual0, ts, KeyValue.Type.Put); // 'fami:' - KeyValue kv0_0 = new KeyValue(row, fami, qual0, ts, Type.Put); + KeyValue kv0_0 = new KeyValue(row, fami, qual0, ts, KeyValue.Type.Put); // 'fami:qf1' - KeyValue kv0_1 = new KeyValue(row, fami, qual1, ts, Type.Put); + KeyValue kv0_1 = new KeyValue(row, fami, qual1, ts, KeyValue.Type.Put); // 'fami:qf2' - KeyValue kv0_2 = new KeyValue(row, fami, qual2, ts, Type.Put); + KeyValue kv0_2 = new KeyValue(row, fami, qual2, ts, KeyValue.Type.Put); // 'fami1:' - KeyValue kv1_0 = new KeyValue(row, fami1, qual0, ts, Type.Put); + KeyValue kv1_0 = new KeyValue(row, fami1, qual0, ts, KeyValue.Type.Put); // 'fami:qf1' < 'fami:qf2' assertKVLessWithoutRow(c, 0, kv0_1, kv0_2); @@ -347,14 +346,14 @@ public class TestKeyValue extends TestCase { final KeyValue firstOnRowA = KeyValueUtil.createFirstOnRow(rowA); final KeyValue firstOnRowABufferFamQual = KeyValueUtil.createFirstOnRow(bufferA, offsetA, rowA, 0, rowA.length, family, 0, family.length, qualA, 0, qualA.length); - final KeyValue kvA_1 = new KeyValue(rowA, null, null, ts, Type.Put); - final KeyValue kvA_2 = new KeyValue(rowA, family, qualA, ts, Type.Put); + final KeyValue kvA_1 = new KeyValue(rowA, null, null, ts, KeyValue.Type.Put); + final KeyValue kvA_2 = new KeyValue(rowA, family, qualA, ts, KeyValue.Type.Put); final KeyValue lastOnRowA = KeyValueUtil.createLastOnRow(rowA); final KeyValue firstOnRowB = KeyValueUtil.createFirstOnRow(rowB); final KeyValue firstOnRowBBufferFam = KeyValueUtil.createFirstOnRow(bufferB, offsetB, rowB, 0, rowB.length, family, 0, family.length, null, 0, 0); - final KeyValue kvB = new KeyValue(rowB, family, qualA, ts, Type.Put); + final KeyValue kvB = new KeyValue(rowB, family, qualA, ts, KeyValue.Type.Put); assertKVLess(c, firstOnRowA, firstOnRowB); assertKVLess(c, firstOnRowA, firstOnRowBBufferFam); @@ -740,8 +739,8 @@ public class TestKeyValue extends TestCase { } @Override - public DataType getType() { - return PrivateCellUtil.toDataType(getTypeByte()); + public Type getType() { + return PrivateCellUtil.toType(getTypeByte()); } } } diff --git a/hbase-examples/src/main/java/org/apache/hadoop/hbase/client/example/MultiThreadedClientExample.java b/hbase-examples/src/main/java/org/apache/hadoop/hbase/client/example/MultiThreadedClientExample.java index 53472bb8d14..7401f0b661a 100644 --- a/hbase-examples/src/main/java/org/apache/hadoop/hbase/client/example/MultiThreadedClientExample.java +++ b/hbase-examples/src/main/java/org/apache/hadoop/hbase/client/example/MultiThreadedClientExample.java @@ -31,7 +31,8 @@ import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.TimeUnit; import org.apache.hadoop.conf.Configured; -import org.apache.hadoop.hbase.Cell.DataType; +import org.apache.hadoop.hbase.Cell; +import org.apache.hadoop.hbase.Cell.Type; import org.apache.hadoop.hbase.CellBuilderFactory; import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.TableName; @@ -226,7 +227,7 @@ public class MultiThreadedClientExample extends Configured implements Tool { .setFamily(FAMILY) .setQualifier(QUAL) .setTimestamp(p.getTimeStamp()) - .setType(DataType.Put) + .setType(Cell.Type.Put) .setValue(value) .build()); puts.add(p); @@ -263,7 +264,7 @@ public class MultiThreadedClientExample extends Configured implements Tool { .setFamily(FAMILY) .setQualifier(QUAL) .setTimestamp(p.getTimeStamp()) - .setType(DataType.Put) + .setType(Type.Put) .setValue(value) .build()); t.put(p); diff --git a/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/ValueRewritingObserver.java b/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/ValueRewritingObserver.java index cf7796b16cc..422f4c11c65 100644 --- a/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/ValueRewritingObserver.java +++ b/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/ValueRewritingObserver.java @@ -88,7 +88,7 @@ public class ValueRewritingObserver implements RegionObserver, RegionCoprocessor cellBuilder.setFamily(CellUtil.cloneFamily(c)); cellBuilder.setQualifier(CellUtil.cloneQualifier(c)); cellBuilder.setTimestamp(c.getTimestamp()); - cellBuilder.setType(Cell.DataType.Put); + cellBuilder.setType(Cell.Type.Put); // Make sure each cell gets a unique value byte[] clonedValue = new byte[replacedValue.length]; System.arraycopy(replacedValue, 0, clonedValue, 0, replacedValue.length); diff --git a/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/WriteHeavyIncrementObserver.java b/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/WriteHeavyIncrementObserver.java index 63637b50aa8..d8e3a5d908e 100644 --- a/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/WriteHeavyIncrementObserver.java +++ b/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/WriteHeavyIncrementObserver.java @@ -79,7 +79,7 @@ public class WriteHeavyIncrementObserver implements RegionCoprocessor, RegionObs private Cell createCell(byte[] row, byte[] family, byte[] qualifier, long ts, long value) { return CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY).setRow(row) - .setType(Cell.DataType.Put).setFamily(family).setQualifier(qualifier) + .setType(Cell.Type.Put).setFamily(family).setQualifier(qualifier) .setTimestamp(ts).setValue(Bytes.toBytes(value)).build(); } @@ -249,7 +249,7 @@ public class WriteHeavyIncrementObserver implements RegionCoprocessor, RegionObs .setQualifier(cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength()) .setValue(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength()) - .setType(Cell.DataType.Put).setTimestamp(ts).build()); + .setType(Cell.Type.Put).setTimestamp(ts).build()); } } c.getEnvironment().getRegion().put(put); diff --git a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java index b440fdf3a47..aabcff6784c 100644 --- a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java +++ b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java @@ -38,7 +38,7 @@ import javax.ws.rs.core.UriInfo; import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.hbase.Cell; -import org.apache.hadoop.hbase.Cell.DataType; +import org.apache.hadoop.hbase.Cell.Type; import org.apache.hadoop.hbase.CellBuilderFactory; import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.CellUtil; @@ -246,7 +246,7 @@ public class RowResource extends ResourceBase { .setFamily(parts[0]) .setQualifier(parts[1]) .setTimestamp(cell.getTimestamp()) - .setType(DataType.Put) + .setType(Type.Put) .setValue(cell.getValue()) .build()); } @@ -321,7 +321,7 @@ public class RowResource extends ResourceBase { .setFamily(parts[0]) .setQualifier(parts[1]) .setTimestamp(timestamp) - .setType(DataType.Put) + .setType(Type.Put) .setValue(message) .build()); table = servlet.getTable(tableResource.getName()); @@ -518,7 +518,7 @@ public class RowResource extends ResourceBase { .setFamily(parts[0]) .setQualifier(parts[1]) .setTimestamp(cell.getTimestamp()) - .setType(DataType.Put) + .setType(Type.Put) .setValue(cell.getValue()) .build()); if(Bytes.equals(col, diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodeAssignmentHelper.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodeAssignmentHelper.java index 74f7c69c416..1453690e4e2 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodeAssignmentHelper.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodeAssignmentHelper.java @@ -33,7 +33,7 @@ import java.util.Set; import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.Cell.DataType; +import org.apache.hadoop.hbase.Cell.Type; import org.apache.hadoop.hbase.CellBuilderFactory; import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.HBaseIOException; @@ -184,7 +184,7 @@ public class FavoredNodeAssignmentHelper { .setFamily(HConstants.CATALOG_FAMILY) .setQualifier(FAVOREDNODES_QUALIFIER) .setTimestamp(EnvironmentEdgeManager.currentTime()) - .setType(DataType.Put) + .setType(Type.Put) .setValue(favoredNodes) .build()); LOG.debug("Create the region " + regionInfo.getRegionNameAsString() + diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java index dbf6d394b60..c018383d754 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java @@ -24,7 +24,7 @@ import java.util.NavigableSet; import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.Cell.DataType; +import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellBuilderFactory; import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.CellUtil; @@ -158,7 +158,7 @@ public class TableNamespaceManager { .setFamily(TableDescriptorBuilder.NAMESPACE_FAMILY_INFO_BYTES) .setQualifier(TableDescriptorBuilder.NAMESPACE_COL_DESC_BYTES) .setTimestamp(p.getTimeStamp()) - .setType(DataType.Put) + .setType(Cell.Type.Put) .setValue(ProtobufUtil.toProtoNamespaceDescriptor(ns).toByteArray()) .build()); nsTable.put(p); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionStateStore.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionStateStore.java index a45c9e92e7e..d201e0f05b2 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionStateStore.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionStateStore.java @@ -25,7 +25,6 @@ import java.util.Collections; import java.util.List; import org.apache.hadoop.hbase.Cell; -import org.apache.hadoop.hbase.Cell.DataType; import org.apache.hadoop.hbase.CellBuilderFactory; import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.HConstants; @@ -186,7 +185,7 @@ public class RegionStateStore { .setFamily(HConstants.CATALOG_FAMILY) .setQualifier(getServerNameColumn(replicaId)) .setTimestamp(put.getTimeStamp()) - .setType(DataType.Put) + .setType(Cell.Type.Put) .setValue(Bytes.toBytes(regionLocation.getServerName())) .build()); info.append(", regionLocation=").append(regionLocation); @@ -196,7 +195,7 @@ public class RegionStateStore { .setFamily(HConstants.CATALOG_FAMILY) .setQualifier(getStateColumn(replicaId)) .setTimestamp(put.getTimeStamp()) - .setType(DataType.Put) + .setType(Cell.Type.Put) .setValue(Bytes.toBytes(state.name())) .build()); LOG.info(info.toString()); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlLists.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlLists.java index 7b0e4cdf0d8..1a192ea2d59 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlLists.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlLists.java @@ -35,7 +35,7 @@ import java.util.TreeSet; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.AuthUtil; import org.apache.hadoop.hbase.Cell; -import org.apache.hadoop.hbase.Cell.DataType; +import org.apache.hadoop.hbase.Cell.Type; import org.apache.hadoop.hbase.CellBuilderFactory; import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.CellUtil; @@ -173,7 +173,7 @@ public class AccessControlLists { .setFamily(ACL_LIST_FAMILY) .setQualifier(key) .setTimestamp(p.getTimeStamp()) - .setType(DataType.Put) + .setType(Type.Put) .setValue(value) .build()); if (LOG.isDebugEnabled()) { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/DefaultVisibilityLabelServiceImpl.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/DefaultVisibilityLabelServiceImpl.java index fa7c7a74e01..104c33f9e91 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/DefaultVisibilityLabelServiceImpl.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/DefaultVisibilityLabelServiceImpl.java @@ -44,7 +44,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.ArrayBackedTag; import org.apache.hadoop.hbase.AuthUtil; import org.apache.hadoop.hbase.Cell; -import org.apache.hadoop.hbase.Cell.DataType; +import org.apache.hadoop.hbase.Cell.Type; import org.apache.hadoop.hbase.CellBuilderFactory; import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.CellUtil; @@ -218,7 +218,7 @@ public class DefaultVisibilityLabelServiceImpl implements VisibilityLabelService .setFamily(LABELS_TABLE_FAMILY) .setQualifier(LABEL_QUALIFIER) .setTimestamp(p.getTimeStamp()) - .setType(DataType.Put) + .setType(Type.Put) .setValue(Bytes.toBytes(SYSTEM_LABEL)) .build()); region.put(p); @@ -246,7 +246,7 @@ public class DefaultVisibilityLabelServiceImpl implements VisibilityLabelService .setFamily(LABELS_TABLE_FAMILY) .setQualifier(LABEL_QUALIFIER) .setTimestamp(p.getTimeStamp()) - .setType(DataType.Put) + .setType(Type.Put) .setValue(label) .setTags(TagUtil.fromList(Arrays.asList(LABELS_TABLE_TAGS))) .build()); @@ -286,7 +286,7 @@ public class DefaultVisibilityLabelServiceImpl implements VisibilityLabelService .setFamily(LABELS_TABLE_FAMILY) .setQualifier(user) .setTimestamp(p.getTimeStamp()) - .setType(DataType.Put) + .setType(Cell.Type.Put) .setValue(DUMMY_VALUE) .setTags(TagUtil.fromList(Arrays.asList(LABELS_TABLE_TAGS))) .build()); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiRespectsLimits.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiRespectsLimits.java index 05801146d15..43f2c499df7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiRespectsLimits.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiRespectsLimits.java @@ -24,7 +24,7 @@ import java.util.ArrayList; import java.util.List; import java.util.concurrent.ThreadLocalRandom; -import org.apache.hadoop.hbase.Cell.DataType; +import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellBuilderFactory; import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.CompatibilityFactory; @@ -157,7 +157,7 @@ public class TestMultiRespectsLimits { .setFamily(FAMILY) .setQualifier(col) .setTimestamp(p.getTimeStamp()) - .setType(DataType.Put) + .setType(Cell.Type.Put) .setValue(value) .build()); t.put(p); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestPassCustomCellViaRegionObserver.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestPassCustomCellViaRegionObserver.java index 53abfa09bd3..dbbe1ae3ab4 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestPassCustomCellViaRegionObserver.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestPassCustomCellViaRegionObserver.java @@ -215,7 +215,7 @@ public class TestPassCustomCellViaRegionObserver { } private static Cell createCustomCell(byte[] row, byte[] family, byte[] qualifier, - Cell.DataType type, byte[] value) { + Cell.Type type, byte[] value) { return new Cell() { private byte[] getArray(byte[] array) { @@ -317,28 +317,28 @@ public class TestPassCustomCellViaRegionObserver { } @Override - public DataType getType() { + public Type getType() { return type; } }; } private static Cell createCustomCell(Put put) { - return createCustomCell(put.getRow(), FAMILY, QUALIFIER_FROM_CP, Cell.DataType.Put, VALUE); + return createCustomCell(put.getRow(), FAMILY, QUALIFIER_FROM_CP, Cell.Type.Put, VALUE); } private static Cell createCustomCell(Append append) { - return createCustomCell(append.getRow(), FAMILY, QUALIFIER_FROM_CP, Cell.DataType.Put, + return createCustomCell(append.getRow(), FAMILY, QUALIFIER_FROM_CP, Cell.Type.Put, APPEND_VALUE); } private static Cell createCustomCell(Increment inc) { - return createCustomCell(inc.getRow(), FAMILY, QUALIFIER_FROM_CP, Cell.DataType.Put, VALUE); + return createCustomCell(inc.getRow(), FAMILY, QUALIFIER_FROM_CP, Cell.Type.Put, VALUE); } private static Cell createCustomCell(Delete delete) { return createCustomCell(delete.getRow(), FAMILY, QUALIFIER_FROM_CP, - Cell.DataType.DeleteColumn, null); + Cell.Type.DeleteColumn, null); } public static class RegionObserverImpl implements RegionCoprocessor, RegionObserver { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/MockHStoreFile.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/MockHStoreFile.java index 934c2122102..e1596787a54 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/MockHStoreFile.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/MockHStoreFile.java @@ -190,7 +190,7 @@ public class MockHStoreFile extends HStoreFile { public Optional getLastKey() { if (splitPoint != null) { return Optional.of(CellBuilderFactory.create(CellBuilderType.DEEP_COPY) - .setType(Cell.DataType.Put) + .setType(Cell.Type.Put) .setRow(Arrays.copyOf(splitPoint, splitPoint.length + 1)).build()); } else { return Optional.empty(); @@ -201,7 +201,7 @@ public class MockHStoreFile extends HStoreFile { public Optional midKey() throws IOException { if (splitPoint != null) { return Optional.of(CellBuilderFactory.create(CellBuilderType.DEEP_COPY) - .setType(Cell.DataType.Put).setRow(splitPoint).build()); + .setType(Cell.Type.Put).setRow(splitPoint).build()); } else { return Optional.empty(); } @@ -211,7 +211,7 @@ public class MockHStoreFile extends HStoreFile { public Optional getFirstKey() { if (splitPoint != null) { return Optional.of(CellBuilderFactory.create(CellBuilderType.DEEP_COPY) - .setType(Cell.DataType.Put).setRow(splitPoint, 0, splitPoint.length - 1) + .setType(Cell.Type.Put).setRow(splitPoint, 0, splitPoint.length - 1) .build()); } else { return Optional.empty(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionLifeCycleTracker.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionLifeCycleTracker.java index 40e941deaad..7f4ecca0b24 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionLifeCycleTracker.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionLifeCycleTracker.java @@ -28,7 +28,8 @@ import java.util.ArrayList; import java.util.List; import java.util.Optional; -import org.apache.hadoop.hbase.Cell.DataType; +import org.apache.hadoop.hbase.Cell; +import org.apache.hadoop.hbase.Cell.Type; import org.apache.hadoop.hbase.CellBuilderFactory; import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.HBaseTestingUtility; @@ -154,7 +155,7 @@ public class TestCompactionLifeCycleTracker { .setFamily(CF1) .setQualifier(QUALIFIER) .setTimestamp(HConstants.LATEST_TIMESTAMP) - .setType(DataType.Put) + .setType(Cell.Type.Put) .setValue(Bytes.toBytes(i)) .build())); } @@ -167,7 +168,7 @@ public class TestCompactionLifeCycleTracker { .setFamily(CF1) .setQualifier(QUALIFIER) .setTimestamp(HConstants.LATEST_TIMESTAMP) - .setType(DataType.Put) + .setType(Type.Put) .setValue(Bytes.toBytes(i)) .build())); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFlushLifeCycleTracker.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFlushLifeCycleTracker.java index fc8fe4105bf..8550bdc88d6 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFlushLifeCycleTracker.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFlushLifeCycleTracker.java @@ -28,7 +28,7 @@ import java.io.InterruptedIOException; import java.util.Optional; import java.util.concurrent.CountDownLatch; -import org.apache.hadoop.hbase.Cell.DataType; +import org.apache.hadoop.hbase.Cell.Type; import org.apache.hadoop.hbase.CellBuilderFactory; import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.HBaseTestingUtility; @@ -200,7 +200,7 @@ public class TestFlushLifeCycleTracker { .setFamily(CF) .setQualifier(QUALIFIER) .setTimestamp(HConstants.LATEST_TIMESTAMP) - .setType(DataType.Put) + .setType(Type.Put) .setValue(Bytes.toBytes(i)) .build())); } @@ -234,7 +234,7 @@ public class TestFlushLifeCycleTracker { .setFamily(CF) .setQualifier(QUALIFIER) .setTimestamp(HConstants.LATEST_TIMESTAMP) - .setType(DataType.Put) + .setType(Type.Put) .setValue(Bytes.toBytes(i)) .build())); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java index 0098091699b..4c6bf66bfaf 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java @@ -73,7 +73,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.ArrayBackedTag; import org.apache.hadoop.hbase.CategoryBasedTimeout; import org.apache.hadoop.hbase.Cell; -import org.apache.hadoop.hbase.Cell.DataType; +import org.apache.hadoop.hbase.Cell.Type; import org.apache.hadoop.hbase.CellBuilderFactory; import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.CellUtil; @@ -6281,20 +6281,20 @@ public class TestHRegion { .setRow(a) .setFamily(fam1) .setTimestamp(HConstants.LATEST_TIMESTAMP) - .setType(DataType.Put) + .setType(Cell.Type.Put) .build()), // this is outside the region boundary new Put(c).add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY) .setRow(c) .setFamily(fam1) .setTimestamp(HConstants.LATEST_TIMESTAMP) - .setType(DataType.Put) + .setType(Type.Put) .build()), new Put(b).add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY) .setRow(b) .setFamily(fam1) .setTimestamp(HConstants.LATEST_TIMESTAMP) - .setType(DataType.Put) + .setType(Cell.Type.Put) .build()) }; @@ -6330,13 +6330,13 @@ public class TestHRegion { .setRow(a) .setFamily(fam1) .setTimestamp(HConstants.LATEST_TIMESTAMP) - .setType(DataType.Put) + .setType(Cell.Type.Put) .build()), new Put(b).add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY) .setRow(b) .setFamily(fam1) .setTimestamp(HConstants.LATEST_TIMESTAMP) - .setType(DataType.Put) + .setType(Cell.Type.Put) .build()), }; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java index 2745d3d7877..e3012e730e0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java @@ -1047,13 +1047,13 @@ public class TestHStore { long seqId = 100; long timestamp = System.currentTimeMillis(); Cell cell0 = CellBuilderFactory.create(CellBuilderType.DEEP_COPY).setRow(row).setFamily(family) - .setQualifier(qf1).setTimestamp(timestamp).setType(Cell.DataType.Put) + .setQualifier(qf1).setTimestamp(timestamp).setType(Cell.Type.Put) .setValue(qf1).build(); PrivateCellUtil.setSequenceId(cell0, seqId); testNumberOfMemStoreScannersAfterFlush(Arrays.asList(cell0), Collections.emptyList()); Cell cell1 = CellBuilderFactory.create(CellBuilderType.DEEP_COPY).setRow(row).setFamily(family) - .setQualifier(qf2).setTimestamp(timestamp).setType(Cell.DataType.Put) + .setQualifier(qf2).setTimestamp(timestamp).setType(Cell.Type.Put) .setValue(qf1).build(); PrivateCellUtil.setSequenceId(cell1, seqId); testNumberOfMemStoreScannersAfterFlush(Arrays.asList(cell0), Arrays.asList(cell1)); @@ -1061,7 +1061,7 @@ public class TestHStore { seqId = 101; timestamp = System.currentTimeMillis(); Cell cell2 = CellBuilderFactory.create(CellBuilderType.DEEP_COPY).setRow(row2).setFamily(family) - .setQualifier(qf2).setTimestamp(timestamp).setType(Cell.DataType.Put) + .setQualifier(qf2).setTimestamp(timestamp).setType(Cell.Type.Put) .setValue(qf1).build(); PrivateCellUtil.setSequenceId(cell2, seqId); testNumberOfMemStoreScannersAfterFlush(Arrays.asList(cell0), Arrays.asList(cell1, cell2)); @@ -1116,7 +1116,7 @@ public class TestHStore { private Cell createCell(byte[] row, byte[] qualifier, long ts, long sequenceId, byte[] value) throws IOException { Cell c = CellBuilderFactory.create(CellBuilderType.DEEP_COPY).setRow(row).setFamily(family) - .setQualifier(qualifier).setTimestamp(ts).setType(Cell.DataType.Put) + .setQualifier(qualifier).setTimestamp(ts).setType(Cell.Type.Put) .setValue(value).build(); PrivateCellUtil.setSequenceId(c, sequenceId); return c; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestWALEntrySinkFilter.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestWALEntrySinkFilter.java index 941fa13f973..fea9bc393f8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestWALEntrySinkFilter.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestWALEntrySinkFilter.java @@ -158,7 +158,7 @@ public class TestWALEntrySinkFilter { setRow(bytes). setFamily(bytes). setQualifier(bytes). - setType(Cell.DataType.Put). + setType(Cell.Type.Put). setTimestamp(i). setValue(bytes).build(); cells.add(cell); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/ExpAsStringVisibilityLabelServiceImpl.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/ExpAsStringVisibilityLabelServiceImpl.java index 9d60e1088a4..8be934fa933 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/ExpAsStringVisibilityLabelServiceImpl.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/ExpAsStringVisibilityLabelServiceImpl.java @@ -36,7 +36,6 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.ArrayBackedTag; import org.apache.hadoop.hbase.AuthUtil; import org.apache.hadoop.hbase.Cell; -import org.apache.hadoop.hbase.Cell.DataType; import org.apache.hadoop.hbase.CellBuilder; import org.apache.hadoop.hbase.CellBuilderFactory; import org.apache.hadoop.hbase.CellBuilderType; @@ -112,7 +111,7 @@ public class ExpAsStringVisibilityLabelServiceImpl implements VisibilityLabelSer .setFamily(LABELS_TABLE_FAMILY) .setQualifier(auth) .setTimestamp(p.getTimeStamp()) - .setType(DataType.Put) + .setType(Cell.Type.Put) .setValue(DUMMY_VALUE) .build()); } diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java index ba278474c76..daad446273f 100644 --- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java +++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java @@ -49,7 +49,7 @@ import org.apache.commons.cli.Option; import org.apache.commons.cli.OptionGroup; import org.apache.commons.lang3.ArrayUtils; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.Cell.DataType; +import org.apache.hadoop.hbase.Cell.Type; import org.apache.hadoop.hbase.CellBuilder; import org.apache.hadoop.hbase.CellBuilderFactory; import org.apache.hadoop.hbase.CellBuilderType; @@ -1353,7 +1353,7 @@ public class ThriftServerRunner implements Runnable { .setFamily(famAndQf[0]) .setQualifier(famAndQf[1]) .setTimestamp(put.getTimeStamp()) - .setType(DataType.Put) + .setType(Type.Put) .setValue(m.value != null ? getBytes(m.value) : HConstants.EMPTY_BYTE_ARRAY) .build()); @@ -1421,7 +1421,7 @@ public class ThriftServerRunner implements Runnable { .setFamily(famAndQf[0]) .setQualifier(famAndQf[1]) .setTimestamp(put.getTimeStamp()) - .setType(DataType.Put) + .setType(Type.Put) .setValue(m.value != null ? getBytes(m.value) : HConstants.EMPTY_BYTE_ARRAY) .build()); @@ -1904,7 +1904,7 @@ public class ThriftServerRunner implements Runnable { .setFamily(famAndQf[0]) .setQualifier(famAndQf[1]) .setTimestamp(put.getTimeStamp()) - .setType(DataType.Put) + .setType(Type.Put) .setValue(mput.value != null ? getBytes(mput.value) : HConstants.EMPTY_BYTE_ARRAY) .build()); diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java index ced9a0284e9..8ab5a013584 100644 --- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java +++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java @@ -28,7 +28,6 @@ import java.util.Map; import org.apache.commons.collections4.MapUtils; import org.apache.hadoop.hbase.Cell; -import org.apache.hadoop.hbase.Cell.DataType; import org.apache.hadoop.hbase.CellBuilderFactory; import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.CellUtil; @@ -227,7 +226,7 @@ public class ThriftUtilities { .setFamily(columnValue.getFamily()) .setQualifier(columnValue.getQualifier()) .setTimestamp(columnValue.getTimestamp()) - .setType(DataType.Put) + .setType(Cell.Type.Put) .setValue(columnValue.getValue()) .build()); } else { @@ -236,7 +235,7 @@ public class ThriftUtilities { .setFamily(columnValue.getFamily()) .setQualifier(columnValue.getQualifier()) .setTimestamp(out.getTimeStamp()) - .setType(DataType.Put) + .setType(Cell.Type.Put) .setValue(columnValue.getValue()) .build()); }