HBASE-19626 Rename Cell.DataType to Cell.Type
This commit is contained in:
parent
1050936ce7
commit
53233be5a9
|
@ -35,7 +35,7 @@ import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import org.apache.hadoop.conf.Configuration;
|
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.Connection;
|
||||||
import org.apache.hadoop.hbase.client.ConnectionFactory;
|
import org.apache.hadoop.hbase.client.ConnectionFactory;
|
||||||
import org.apache.hadoop.hbase.client.Consistency;
|
import org.apache.hadoop.hbase.client.Consistency;
|
||||||
|
@ -1358,7 +1358,7 @@ public class MetaTableAccessor {
|
||||||
.setFamily(HConstants.REPLICATION_BARRIER_FAMILY)
|
.setFamily(HConstants.REPLICATION_BARRIER_FAMILY)
|
||||||
.setQualifier(seqBytes)
|
.setQualifier(seqBytes)
|
||||||
.setTimestamp(put.getTimeStamp())
|
.setTimestamp(put.getTimeStamp())
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(seqBytes)
|
.setValue(seqBytes)
|
||||||
.build())
|
.build())
|
||||||
.add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY)
|
.add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY)
|
||||||
|
@ -1366,7 +1366,7 @@ public class MetaTableAccessor {
|
||||||
.setFamily(HConstants.REPLICATION_META_FAMILY)
|
.setFamily(HConstants.REPLICATION_META_FAMILY)
|
||||||
.setQualifier(tableNameCq)
|
.setQualifier(tableNameCq)
|
||||||
.setTimestamp(put.getTimeStamp())
|
.setTimestamp(put.getTimeStamp())
|
||||||
.setType(DataType.Put)
|
.setType(Cell.Type.Put)
|
||||||
.setValue(tableName)
|
.setValue(tableName)
|
||||||
.build());
|
.build());
|
||||||
return put;
|
return put;
|
||||||
|
@ -1380,7 +1380,7 @@ public class MetaTableAccessor {
|
||||||
.setFamily(HConstants.REPLICATION_META_FAMILY)
|
.setFamily(HConstants.REPLICATION_META_FAMILY)
|
||||||
.setQualifier(daughterNameCq)
|
.setQualifier(daughterNameCq)
|
||||||
.setTimestamp(put.getTimeStamp())
|
.setTimestamp(put.getTimeStamp())
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(value)
|
.setValue(value)
|
||||||
.build());
|
.build());
|
||||||
return put;
|
return put;
|
||||||
|
@ -1393,7 +1393,7 @@ public class MetaTableAccessor {
|
||||||
.setFamily(HConstants.REPLICATION_META_FAMILY)
|
.setFamily(HConstants.REPLICATION_META_FAMILY)
|
||||||
.setQualifier(parentNameCq)
|
.setQualifier(parentNameCq)
|
||||||
.setTimestamp(put.getTimeStamp())
|
.setTimestamp(put.getTimeStamp())
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(value)
|
.setValue(value)
|
||||||
.build());
|
.build());
|
||||||
return put;
|
return put;
|
||||||
|
@ -1410,7 +1410,7 @@ public class MetaTableAccessor {
|
||||||
.setFamily(HConstants.CATALOG_FAMILY)
|
.setFamily(HConstants.CATALOG_FAMILY)
|
||||||
.setQualifier(HConstants.SPLITA_QUALIFIER)
|
.setQualifier(HConstants.SPLITA_QUALIFIER)
|
||||||
.setTimestamp(put.getTimeStamp())
|
.setTimestamp(put.getTimeStamp())
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(RegionInfo.toByteArray(splitA))
|
.setValue(RegionInfo.toByteArray(splitA))
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
@ -1420,7 +1420,7 @@ public class MetaTableAccessor {
|
||||||
.setFamily(HConstants.CATALOG_FAMILY)
|
.setFamily(HConstants.CATALOG_FAMILY)
|
||||||
.setQualifier(HConstants.SPLITB_QUALIFIER)
|
.setQualifier(HConstants.SPLITB_QUALIFIER)
|
||||||
.setTimestamp(put.getTimeStamp())
|
.setTimestamp(put.getTimeStamp())
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(RegionInfo.toByteArray(splitB))
|
.setValue(RegionInfo.toByteArray(splitB))
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
@ -1555,7 +1555,7 @@ public class MetaTableAccessor {
|
||||||
.setFamily(HConstants.CATALOG_FAMILY)
|
.setFamily(HConstants.CATALOG_FAMILY)
|
||||||
.setQualifier(getRegionStateColumn())
|
.setQualifier(getRegionStateColumn())
|
||||||
.setTimestamp(put.getTimeStamp())
|
.setTimestamp(put.getTimeStamp())
|
||||||
.setType(DataType.Put)
|
.setType(Cell.Type.Put)
|
||||||
.setValue(Bytes.toBytes(state.name()))
|
.setValue(Bytes.toBytes(state.name()))
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
@ -1667,7 +1667,7 @@ public class MetaTableAccessor {
|
||||||
.setFamily(HConstants.CATALOG_FAMILY)
|
.setFamily(HConstants.CATALOG_FAMILY)
|
||||||
.setQualifier(HConstants.MERGEA_QUALIFIER)
|
.setQualifier(HConstants.MERGEA_QUALIFIER)
|
||||||
.setTimestamp(putOfMerged.getTimeStamp())
|
.setTimestamp(putOfMerged.getTimeStamp())
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(RegionInfo.toByteArray(regionA))
|
.setValue(RegionInfo.toByteArray(regionA))
|
||||||
.build())
|
.build())
|
||||||
.add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY)
|
.add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY)
|
||||||
|
@ -1675,7 +1675,7 @@ public class MetaTableAccessor {
|
||||||
.setFamily(HConstants.CATALOG_FAMILY)
|
.setFamily(HConstants.CATALOG_FAMILY)
|
||||||
.setQualifier(HConstants.MERGEB_QUALIFIER)
|
.setQualifier(HConstants.MERGEB_QUALIFIER)
|
||||||
.setTimestamp(putOfMerged.getTimeStamp())
|
.setTimestamp(putOfMerged.getTimeStamp())
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(RegionInfo.toByteArray(regionB))
|
.setValue(RegionInfo.toByteArray(regionB))
|
||||||
.build());
|
.build());
|
||||||
|
|
||||||
|
@ -1918,7 +1918,7 @@ public class MetaTableAccessor {
|
||||||
.setFamily(HConstants.REPLICATION_POSITION_FAMILY)
|
.setFamily(HConstants.REPLICATION_POSITION_FAMILY)
|
||||||
.setQualifier(Bytes.toBytes(peerId))
|
.setQualifier(Bytes.toBytes(peerId))
|
||||||
.setTimestamp(put.getTimeStamp())
|
.setTimestamp(put.getTimeStamp())
|
||||||
.setType(DataType.Put)
|
.setType(Cell.Type.Put)
|
||||||
.setValue(Bytes.toBytes(Math.abs(entry.getValue())))
|
.setValue(Bytes.toBytes(Math.abs(entry.getValue())))
|
||||||
.build());
|
.build());
|
||||||
puts.add(put);
|
puts.add(put);
|
||||||
|
@ -2052,7 +2052,7 @@ public class MetaTableAccessor {
|
||||||
.setFamily(getCatalogFamily())
|
.setFamily(getCatalogFamily())
|
||||||
.setQualifier(HConstants.REGIONINFO_QUALIFIER)
|
.setQualifier(HConstants.REGIONINFO_QUALIFIER)
|
||||||
.setTimestamp(p.getTimeStamp())
|
.setTimestamp(p.getTimeStamp())
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(RegionInfo.toByteArray(hri))
|
.setValue(RegionInfo.toByteArray(hri))
|
||||||
.build());
|
.build());
|
||||||
return p;
|
return p;
|
||||||
|
@ -2069,7 +2069,7 @@ public class MetaTableAccessor {
|
||||||
.setFamily(getCatalogFamily())
|
.setFamily(getCatalogFamily())
|
||||||
.setQualifier(getServerColumn(replicaId))
|
.setQualifier(getServerColumn(replicaId))
|
||||||
.setTimestamp(time)
|
.setTimestamp(time)
|
||||||
.setType(DataType.Put)
|
.setType(Cell.Type.Put)
|
||||||
.setValue(Bytes.toBytes(sn.getAddress().toString()))
|
.setValue(Bytes.toBytes(sn.getAddress().toString()))
|
||||||
.build())
|
.build())
|
||||||
.add(builder.clear()
|
.add(builder.clear()
|
||||||
|
@ -2077,7 +2077,7 @@ public class MetaTableAccessor {
|
||||||
.setFamily(getCatalogFamily())
|
.setFamily(getCatalogFamily())
|
||||||
.setQualifier(getStartCodeColumn(replicaId))
|
.setQualifier(getStartCodeColumn(replicaId))
|
||||||
.setTimestamp(time)
|
.setTimestamp(time)
|
||||||
.setType(DataType.Put)
|
.setType(Cell.Type.Put)
|
||||||
.setValue(Bytes.toBytes(sn.getStartcode()))
|
.setValue(Bytes.toBytes(sn.getStartcode()))
|
||||||
.build())
|
.build())
|
||||||
.add(builder.clear()
|
.add(builder.clear()
|
||||||
|
@ -2085,7 +2085,7 @@ public class MetaTableAccessor {
|
||||||
.setFamily(getCatalogFamily())
|
.setFamily(getCatalogFamily())
|
||||||
.setQualifier(getSeqNumColumn(replicaId))
|
.setQualifier(getSeqNumColumn(replicaId))
|
||||||
.setTimestamp(time)
|
.setTimestamp(time)
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(Bytes.toBytes(openSeqNum))
|
.setValue(Bytes.toBytes(openSeqNum))
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
@ -2098,21 +2098,21 @@ public class MetaTableAccessor {
|
||||||
.setFamily(getCatalogFamily())
|
.setFamily(getCatalogFamily())
|
||||||
.setQualifier(getServerColumn(replicaId))
|
.setQualifier(getServerColumn(replicaId))
|
||||||
.setTimestamp(now)
|
.setTimestamp(now)
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.build())
|
.build())
|
||||||
.add(builder.clear()
|
.add(builder.clear()
|
||||||
.setRow(p.getRow())
|
.setRow(p.getRow())
|
||||||
.setFamily(getCatalogFamily())
|
.setFamily(getCatalogFamily())
|
||||||
.setQualifier(getStartCodeColumn(replicaId))
|
.setQualifier(getStartCodeColumn(replicaId))
|
||||||
.setTimestamp(now)
|
.setTimestamp(now)
|
||||||
.setType(DataType.Put)
|
.setType(Cell.Type.Put)
|
||||||
.build())
|
.build())
|
||||||
.add(builder.clear()
|
.add(builder.clear()
|
||||||
.setRow(p.getRow())
|
.setRow(p.getRow())
|
||||||
.setFamily(getCatalogFamily())
|
.setFamily(getCatalogFamily())
|
||||||
.setQualifier(getSeqNumColumn(replicaId))
|
.setQualifier(getSeqNumColumn(replicaId))
|
||||||
.setTimestamp(now)
|
.setTimestamp(now)
|
||||||
.setType(DataType.Put)
|
.setType(Cell.Type.Put)
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2141,7 +2141,7 @@ public class MetaTableAccessor {
|
||||||
.setFamily(HConstants.CATALOG_FAMILY)
|
.setFamily(HConstants.CATALOG_FAMILY)
|
||||||
.setQualifier(getSeqNumColumn(replicaId))
|
.setQualifier(getSeqNumColumn(replicaId))
|
||||||
.setTimestamp(time)
|
.setTimestamp(time)
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(Bytes.toBytes(openSeqNum))
|
.setValue(Bytes.toBytes(openSeqNum))
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,7 +136,7 @@ public class Append extends Mutation {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct the Append with user defined data. NOTED:
|
* 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.
|
* 2) the row of each cell must be same with passed row.
|
||||||
* @param row row. CAN'T be null
|
* @param row row. CAN'T be null
|
||||||
* @param ts timestamp
|
* @param ts timestamp
|
||||||
|
|
|
@ -143,7 +143,7 @@ public class Delete extends Mutation implements Comparable<Row> {
|
||||||
/**
|
/**
|
||||||
* Construct the Delete with user defined data. NOTED:
|
* Construct the Delete with user defined data. NOTED:
|
||||||
* 1) all cells in the familyMap must have the delete type.
|
* 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.
|
* 2) the row of each cell must be same with passed row.
|
||||||
* @param row row. CAN'T be null
|
* @param row row. CAN'T be null
|
||||||
* @param ts timestamp
|
* @param ts timestamp
|
||||||
|
|
|
@ -81,7 +81,7 @@ public class Increment extends Mutation implements Comparable<Row> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct the Increment with user defined data. NOTED:
|
* 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.
|
* 2) the row of each cell must be same with passed row.
|
||||||
* @param row row. CAN'T be null
|
* @param row row. CAN'T be null
|
||||||
* @param ts timestamp
|
* @param ts timestamp
|
||||||
|
|
|
@ -157,7 +157,7 @@ public class Put extends Mutation implements HeapSize, Comparable<Row> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct the Put with user defined data. NOTED:
|
* 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.
|
* 2) the row of each cell must be same with passed row.
|
||||||
* @param row row. CAN'T be null
|
* @param row row. CAN'T be null
|
||||||
* @param ts timestamp
|
* @param ts timestamp
|
||||||
|
|
|
@ -198,7 +198,7 @@ public class KeyOnlyFilter extends FilterBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DataType getType() {
|
public Type getType() {
|
||||||
return cell.getType();
|
return cell.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -334,7 +334,7 @@ public class KeyOnlyFilter extends FilterBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DataType getType() {
|
public Type getType() {
|
||||||
return cell.getType();
|
return cell.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ import java.util.function.Function;
|
||||||
|
|
||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.hbase.Cell;
|
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.CellBuilderType;
|
||||||
import org.apache.hadoop.hbase.CellScanner;
|
import org.apache.hadoop.hbase.CellScanner;
|
||||||
import org.apache.hadoop.hbase.CellUtil;
|
import org.apache.hadoop.hbase.CellUtil;
|
||||||
|
@ -536,7 +536,7 @@ public final class ProtobufUtil {
|
||||||
.setFamily(family)
|
.setFamily(family)
|
||||||
.setQualifier(qv.hasQualifier() ? qv.getQualifier().toByteArray() : null)
|
.setQualifier(qv.hasQualifier() ? qv.getQualifier().toByteArray() : null)
|
||||||
.setTimestamp(ts)
|
.setTimestamp(ts)
|
||||||
.setType(DataType.Put)
|
.setType(Cell.Type.Put)
|
||||||
.setValue(qv.hasValue() ? qv.getValue().toByteArray() : null)
|
.setValue(qv.hasValue() ? qv.getValue().toByteArray() : null)
|
||||||
.setTags(allTagsBytes)
|
.setTags(allTagsBytes)
|
||||||
.build());
|
.build());
|
||||||
|
@ -556,7 +556,7 @@ public final class ProtobufUtil {
|
||||||
.setFamily(family)
|
.setFamily(family)
|
||||||
.setQualifier(qv.hasQualifier() ? qv.getQualifier().toByteArray() : null)
|
.setQualifier(qv.hasQualifier() ? qv.getQualifier().toByteArray() : null)
|
||||||
.setTimestamp(ts)
|
.setTimestamp(ts)
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(qv.hasValue() ? qv.getValue().toByteArray() : null)
|
.setValue(qv.hasValue() ? qv.getValue().toByteArray() : null)
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ import org.apache.hadoop.hbase.ByteBufferExtendedCell;
|
||||||
import org.apache.hadoop.hbase.CacheEvictionStats;
|
import org.apache.hadoop.hbase.CacheEvictionStats;
|
||||||
import org.apache.hadoop.hbase.CacheEvictionStatsBuilder;
|
import org.apache.hadoop.hbase.CacheEvictionStatsBuilder;
|
||||||
import org.apache.hadoop.hbase.Cell;
|
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.CellBuilderType;
|
||||||
import org.apache.hadoop.hbase.CellScanner;
|
import org.apache.hadoop.hbase.CellScanner;
|
||||||
import org.apache.hadoop.hbase.CellUtil;
|
import org.apache.hadoop.hbase.CellUtil;
|
||||||
|
@ -670,7 +670,7 @@ public final class ProtobufUtil {
|
||||||
.setFamily(family)
|
.setFamily(family)
|
||||||
.setQualifier(qv.hasQualifier() ? qv.getQualifier().toByteArray() : null)
|
.setQualifier(qv.hasQualifier() ? qv.getQualifier().toByteArray() : null)
|
||||||
.setTimestamp(ts)
|
.setTimestamp(ts)
|
||||||
.setType(DataType.Put)
|
.setType(Cell.Type.Put)
|
||||||
.setValue(qv.hasValue() ? qv.getValue().toByteArray() : null)
|
.setValue(qv.hasValue() ? qv.getValue().toByteArray() : null)
|
||||||
.setTags(allTagsBytes)
|
.setTags(allTagsBytes)
|
||||||
.build());
|
.build());
|
||||||
|
@ -690,7 +690,7 @@ public final class ProtobufUtil {
|
||||||
.setFamily(family)
|
.setFamily(family)
|
||||||
.setQualifier(qv.hasQualifier() ? qv.getQualifier().toByteArray() : null)
|
.setQualifier(qv.hasQualifier() ? qv.getQualifier().toByteArray() : null)
|
||||||
.setTimestamp(ts)
|
.setTimestamp(ts)
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(qv.hasValue() ? qv.getValue().toByteArray() : null)
|
.setValue(qv.hasValue() ? qv.getValue().toByteArray() : null)
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ import static org.junit.Assert.assertTrue;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.hadoop.hbase.Cell;
|
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.CellBuilderFactory;
|
||||||
import org.apache.hadoop.hbase.CellBuilderType;
|
import org.apache.hadoop.hbase.CellBuilderType;
|
||||||
import org.apache.hadoop.hbase.CellUtil;
|
import org.apache.hadoop.hbase.CellUtil;
|
||||||
|
@ -50,7 +50,7 @@ public class TestMutation {
|
||||||
.setRow(origin.getRow())
|
.setRow(origin.getRow())
|
||||||
.setFamily(family)
|
.setFamily(family)
|
||||||
.setQualifier(Bytes.toBytes("q"))
|
.setQualifier(Bytes.toBytes("q"))
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(Bytes.toBytes(100))
|
.setValue(Bytes.toBytes(100))
|
||||||
.build());
|
.build());
|
||||||
origin.addColumn(family, Bytes.toBytes("q0"), Bytes.toBytes("value"));
|
origin.addColumn(family, Bytes.toBytes("q0"), Bytes.toBytes("value"));
|
||||||
|
@ -73,7 +73,7 @@ public class TestMutation {
|
||||||
.setRow(origin.getRow())
|
.setRow(origin.getRow())
|
||||||
.setFamily(family)
|
.setFamily(family)
|
||||||
.setQualifier(Bytes.toBytes("q"))
|
.setQualifier(Bytes.toBytes("q"))
|
||||||
.setType(DataType.Put)
|
.setType(Cell.Type.Put)
|
||||||
.setValue(Bytes.toBytes(100))
|
.setValue(Bytes.toBytes(100))
|
||||||
.build());
|
.build());
|
||||||
origin.addColumn(family, Bytes.toBytes("q0"), 4);
|
origin.addColumn(family, Bytes.toBytes("q0"), 4);
|
||||||
|
@ -96,7 +96,7 @@ public class TestMutation {
|
||||||
.setRow(origin.getRow())
|
.setRow(origin.getRow())
|
||||||
.setFamily(family)
|
.setFamily(family)
|
||||||
.setQualifier(Bytes.toBytes("q"))
|
.setQualifier(Bytes.toBytes("q"))
|
||||||
.setType(DataType.Delete)
|
.setType(Type.Delete)
|
||||||
.build());
|
.build());
|
||||||
origin.addColumn(family, Bytes.toBytes("q0"));
|
origin.addColumn(family, Bytes.toBytes("q0"));
|
||||||
origin.addColumns(family, Bytes.toBytes("q1"));
|
origin.addColumns(family, Bytes.toBytes("q1"));
|
||||||
|
@ -121,7 +121,7 @@ public class TestMutation {
|
||||||
.setRow(origin.getRow())
|
.setRow(origin.getRow())
|
||||||
.setFamily(family)
|
.setFamily(family)
|
||||||
.setQualifier(Bytes.toBytes("q"))
|
.setQualifier(Bytes.toBytes("q"))
|
||||||
.setType(DataType.Put)
|
.setType(Cell.Type.Put)
|
||||||
.setValue(Bytes.toBytes("value"))
|
.setValue(Bytes.toBytes("value"))
|
||||||
.build());
|
.build());
|
||||||
origin.addColumn(family, Bytes.toBytes("q0"), Bytes.toBytes("V-01"));
|
origin.addColumn(family, Bytes.toBytes("q0"), Bytes.toBytes("V-01"));
|
||||||
|
@ -202,7 +202,7 @@ public class TestMutation {
|
||||||
.setFamily(family)
|
.setFamily(family)
|
||||||
.setQualifier(qualifier0)
|
.setQualifier(qualifier0)
|
||||||
.setTimestamp(put.getTimeStamp())
|
.setTimestamp(put.getTimeStamp())
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(value0)
|
.setValue(value0)
|
||||||
.build())
|
.build())
|
||||||
.add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY)
|
.add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY)
|
||||||
|
@ -210,7 +210,7 @@ public class TestMutation {
|
||||||
.setFamily(family)
|
.setFamily(family)
|
||||||
.setQualifier(qualifier1)
|
.setQualifier(qualifier1)
|
||||||
.setTimestamp(ts1)
|
.setTimestamp(ts1)
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(value1)
|
.setValue(value1)
|
||||||
.build());
|
.build());
|
||||||
|
|
||||||
|
|
|
@ -179,7 +179,7 @@ public class TestHBaseRpcControllerImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DataType getType() {
|
public Type getType() {
|
||||||
// unused
|
// unused
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,8 +152,8 @@ public class ByteBufferKeyOnlyKeyValue extends ByteBufferExtendedCell {
|
||||||
return ByteBufferUtils.toByte(this.buf, this.offset + this.length - 1);
|
return ByteBufferUtils.toByte(this.buf, this.offset + this.length - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DataType getType() {
|
public Type getType() {
|
||||||
return PrivateCellUtil.toDataType(getTypeByte());
|
return PrivateCellUtil.toType(getTypeByte());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -201,15 +201,15 @@ public interface Cell {
|
||||||
int getTagsLength();
|
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
|
* @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}.
|
* 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),
|
Put((byte) 4),
|
||||||
|
|
||||||
Delete((byte) 8),
|
Delete((byte) 8),
|
||||||
|
@ -222,7 +222,7 @@ public interface Cell {
|
||||||
|
|
||||||
private final byte code;
|
private final byte code;
|
||||||
|
|
||||||
DataType(final byte c) {
|
Type(final byte c) {
|
||||||
this.code = c;
|
this.code = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ public interface CellBuilder {
|
||||||
|
|
||||||
CellBuilder setTimestamp(final long timestamp);
|
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);
|
||||||
CellBuilder setValue(final byte[] value, final int vOffset, final int vLength);
|
CellBuilder setValue(final byte[] value, final int vOffset, final int vLength);
|
||||||
|
|
|
@ -169,8 +169,8 @@ public interface ExtendedCell extends RawCell, HeapSize, Cloneable {
|
||||||
* {@link KeyValue.Type#Minimum}
|
* {@link KeyValue.Type#Minimum}
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
default DataType getType() {
|
default Type getType() {
|
||||||
return PrivateCellUtil.toDataType(getTypeByte());
|
return PrivateCellUtil.toType(getTypeByte());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -49,7 +49,7 @@ public interface ExtendedCellBuilder extends RawCellBuilder {
|
||||||
ExtendedCellBuilder setTimestamp(final long timestamp);
|
ExtendedCellBuilder setTimestamp(final long timestamp);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
ExtendedCellBuilder setType(final Cell.DataType type);
|
ExtendedCellBuilder setType(final Cell.Type type);
|
||||||
|
|
||||||
ExtendedCellBuilder setType(final byte type);
|
ExtendedCellBuilder setType(final byte type);
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ public abstract class ExtendedCellBuilderImpl implements ExtendedCellBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ExtendedCellBuilder setType(final Cell.DataType type) {
|
public ExtendedCellBuilder setType(final Cell.Type type) {
|
||||||
this.type = PrivateCellUtil.toTypeByte(type);
|
this.type = PrivateCellUtil.toTypeByte(type);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,6 @@ import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import org.apache.hadoop.hbase.KeyValue.Type;
|
|
||||||
import org.apache.hadoop.hbase.filter.ByteArrayComparable;
|
import org.apache.hadoop.hbase.filter.ByteArrayComparable;
|
||||||
import org.apache.hadoop.hbase.io.HeapSize;
|
import org.apache.hadoop.hbase.io.HeapSize;
|
||||||
import org.apache.hadoop.hbase.io.TagCompressionContext;
|
import org.apache.hadoop.hbase.io.TagCompressionContext;
|
||||||
|
@ -799,30 +798,30 @@ public final class PrivateCellUtil {
|
||||||
* or a {@link KeyValue.Type#DeleteColumn} KeyValue type.
|
* or a {@link KeyValue.Type#DeleteColumn} KeyValue type.
|
||||||
*/
|
*/
|
||||||
public static boolean isDelete(final byte 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.
|
* @return True if this cell is a {@link KeyValue.Type#Delete} type.
|
||||||
*/
|
*/
|
||||||
public static boolean isDeleteType(Cell cell) {
|
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) {
|
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) {
|
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) {
|
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) {
|
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) {
|
public static boolean isDeleteColumnOrFamily(Cell cell) {
|
||||||
int t = cell.getTypeByte();
|
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) {
|
public static byte[] cloneTags(Cell cell) {
|
||||||
|
@ -1166,11 +1165,11 @@ public final class PrivateCellUtil {
|
||||||
// "lexicographically last column" (it would be infinitely long). The
|
// "lexicographically last column" (it would be infinitely long). The
|
||||||
// "maximum" key type does not need this behavior.
|
// "maximum" key type does not need this behavior.
|
||||||
if (nextIndexedCell.getFamilyLength() + nextIndexedCell.getQualifierLength() == 0
|
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
|
// left is "bigger", i.e. it appears later in the sorted order
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (flen + clen == 0 && type == Type.Minimum.getCode()) {
|
if (flen + clen == 0 && type == KeyValue.Type.Minimum.getCode()) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1254,19 +1253,19 @@ public final class PrivateCellUtil {
|
||||||
cell.getQualifierLength());
|
cell.getQualifierLength());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Cell.DataType toDataType(byte type) {
|
public static Cell.Type toType(byte type) {
|
||||||
Type codeToType = KeyValue.Type.codeToType(type);
|
KeyValue.Type codeToType = KeyValue.Type.codeToType(type);
|
||||||
switch (codeToType) {
|
switch (codeToType) {
|
||||||
case Put: return Cell.DataType.Put;
|
case Put: return Cell.Type.Put;
|
||||||
case Delete: return Cell.DataType.Delete;
|
case Delete: return Cell.Type.Delete;
|
||||||
case DeleteColumn: return Cell.DataType.DeleteColumn;
|
case DeleteColumn: return Cell.Type.DeleteColumn;
|
||||||
case DeleteFamily: return Cell.DataType.DeleteFamily;
|
case DeleteFamily: return Cell.Type.DeleteFamily;
|
||||||
case DeleteFamilyVersion: return Cell.DataType.DeleteFamilyVersion;
|
case DeleteFamilyVersion: return Cell.Type.DeleteFamilyVersion;
|
||||||
default: throw new UnsupportedOperationException("Invalid type of cell "+type);
|
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) {
|
switch (type) {
|
||||||
case Put: return KeyValue.Type.Put;
|
case Put: return KeyValue.Type.Put;
|
||||||
case Delete: return KeyValue.Type.Delete;
|
case Delete: return KeyValue.Type.Delete;
|
||||||
|
@ -1590,11 +1589,11 @@ public final class PrivateCellUtil {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte getTypeByte() {
|
public byte getTypeByte() {
|
||||||
return Type.Maximum.getCode();
|
return KeyValue.Type.Maximum.getCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DataType getType() {
|
public Type getType() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1645,11 +1644,11 @@ public final class PrivateCellUtil {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte getTypeByte() {
|
public byte getTypeByte() {
|
||||||
return Type.Maximum.getCode();
|
return KeyValue.Type.Maximum.getCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DataType getType() {
|
public Type getType() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1700,11 +1699,11 @@ public final class PrivateCellUtil {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte getTypeByte() {
|
public byte getTypeByte() {
|
||||||
return Type.Minimum.getCode();
|
return KeyValue.Type.Minimum.getCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DataType getType() {
|
public Type getType() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1935,11 +1934,11 @@ public final class PrivateCellUtil {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte getTypeByte() {
|
public byte getTypeByte() {
|
||||||
return Type.Minimum.getCode();
|
return KeyValue.Type.Minimum.getCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DataType getType() {
|
public Type getType() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2125,12 +2124,12 @@ public final class PrivateCellUtil {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte getTypeByte() {
|
public byte getTypeByte() {
|
||||||
return Type.DeleteFamily.getCode();
|
return KeyValue.Type.DeleteFamily.getCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DataType getType() {
|
public Type getType() {
|
||||||
return DataType.DeleteFamily;
|
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
|
// for specifying the last key/value in a given row, because there is no
|
||||||
// "lexicographically last column" (it would be infinitely long). The
|
// "lexicographically last column" (it would be infinitely long). The
|
||||||
// "maximum" key type does not need this behavior.
|
// "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
|
// left is "bigger", i.e. it appears later in the sorted order
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (rcolumnlength == 0 && rtype == Type.Minimum.getCode()) {
|
if (rcolumnlength == 0 && rtype == KeyValue.Type.Minimum.getCode()) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2683,11 +2682,11 @@ public final class PrivateCellUtil {
|
||||||
public static Cell createNextOnRowCol(Cell cell) {
|
public static Cell createNextOnRowCol(Cell cell) {
|
||||||
long ts = cell.getTimestamp();
|
long ts = cell.getTimestamp();
|
||||||
byte type = cell.getTypeByte();
|
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();
|
type = KeyValue.Type.values()[KeyValue.Type.codeToType(type).ordinal() - 1].getCode();
|
||||||
} else if (ts != HConstants.OLDEST_TIMESTAMP) {
|
} else if (ts != HConstants.OLDEST_TIMESTAMP) {
|
||||||
ts = ts - 1;
|
ts = ts - 1;
|
||||||
type = Type.Maximum.getCode();
|
type = KeyValue.Type.Maximum.getCode();
|
||||||
} else {
|
} else {
|
||||||
return cell;
|
return cell;
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ public interface RawCellBuilder extends CellBuilder {
|
||||||
RawCellBuilder setTimestamp(final long timestamp);
|
RawCellBuilder setTimestamp(final long timestamp);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
RawCellBuilder setType(final Cell.DataType type);
|
RawCellBuilder setType(final Cell.Type type);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
RawCellBuilder setValue(final byte[] value);
|
RawCellBuilder setValue(final byte[] value);
|
||||||
|
|
|
@ -41,7 +41,7 @@ public class TestCellBuilder {
|
||||||
.setRow(row)
|
.setRow(row)
|
||||||
.setFamily(family)
|
.setFamily(family)
|
||||||
.setQualifier(qualifier)
|
.setQualifier(qualifier)
|
||||||
.setType(Cell.DataType.Put)
|
.setType(Cell.Type.Put)
|
||||||
.setValue(value)
|
.setValue(value)
|
||||||
.build();
|
.build();
|
||||||
row[0] = NEW_DATA;
|
row[0] = NEW_DATA;
|
||||||
|
@ -64,7 +64,7 @@ public class TestCellBuilder {
|
||||||
.setRow(row)
|
.setRow(row)
|
||||||
.setFamily(family)
|
.setFamily(family)
|
||||||
.setQualifier(qualifier)
|
.setQualifier(qualifier)
|
||||||
.setType(Cell.DataType.Put)
|
.setType(Cell.Type.Put)
|
||||||
.setValue(value)
|
.setValue(value)
|
||||||
.build();
|
.build();
|
||||||
row[0] = NEW_DATA;
|
row[0] = NEW_DATA;
|
||||||
|
|
|
@ -30,8 +30,6 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.NavigableMap;
|
import java.util.NavigableMap;
|
||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
|
|
||||||
import org.apache.hadoop.hbase.KeyValue.Type;
|
|
||||||
import org.apache.hadoop.hbase.testclassification.MiscTests;
|
import org.apache.hadoop.hbase.testclassification.MiscTests;
|
||||||
import org.apache.hadoop.hbase.testclassification.SmallTests;
|
import org.apache.hadoop.hbase.testclassification.SmallTests;
|
||||||
import org.apache.hadoop.hbase.util.Bytes;
|
import org.apache.hadoop.hbase.util.Bytes;
|
||||||
|
@ -199,8 +197,8 @@ public class TestCellUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DataType getType() {
|
public Type getType() {
|
||||||
return PrivateCellUtil.toDataType(getTypeByte());
|
return PrivateCellUtil.toType(getTypeByte());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -352,7 +350,7 @@ public class TestCellUtil {
|
||||||
+ kv6.getFamilyLength() + kv6.getQualifierLength() + 7,
|
+ kv6.getFamilyLength() + kv6.getQualifierLength() + 7,
|
||||||
PrivateCellUtil.findCommonPrefixInFlatKey(kv6, kv7, true, true));
|
PrivateCellUtil.findCommonPrefixInFlatKey(kv6, kv7, true, true));
|
||||||
// rk, cf, q and ts are same. Only type differs
|
// 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
|
Assert.assertEquals(KeyValue.ROW_LENGTH_SIZE + kv6.getRowLength() + KeyValue.FAMILY_LENGTH_SIZE
|
||||||
+ kv6.getFamilyLength() + kv6.getQualifierLength() + KeyValue.TIMESTAMP_SIZE,
|
+ kv6.getFamilyLength() + kv6.getQualifierLength() + KeyValue.TIMESTAMP_SIZE,
|
||||||
PrivateCellUtil.findCommonPrefixInFlatKey(kv6, kv8, true, true));
|
PrivateCellUtil.findCommonPrefixInFlatKey(kv6, kv8, true, true));
|
||||||
|
@ -393,7 +391,7 @@ public class TestCellUtil {
|
||||||
String family = "test.family";
|
String family = "test.family";
|
||||||
String qualifier = "test.qualifier";
|
String qualifier = "test.qualifier";
|
||||||
long timestamp = 42;
|
long timestamp = 42;
|
||||||
Type type = Type.Put;
|
KeyValue.Type type = KeyValue.Type.Put;
|
||||||
String value = "test.value";
|
String value = "test.value";
|
||||||
long seqId = 1042;
|
long seqId = 1042;
|
||||||
|
|
||||||
|
@ -428,7 +426,8 @@ public class TestCellUtil {
|
||||||
byte[] q = Bytes.toBytes("qual1");
|
byte[] q = Bytes.toBytes("qual1");
|
||||||
byte[] v = Bytes.toBytes("val1");
|
byte[] v = Bytes.toBytes("val1");
|
||||||
byte[] tags = Bytes.toBytes("tag1");
|
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());
|
ByteBuffer buffer = ByteBuffer.wrap(kv.getBuffer());
|
||||||
Cell bbCell = new ByteBufferKeyValue(buffer, 0, buffer.remaining());
|
Cell bbCell = new ByteBufferKeyValue(buffer, 0, buffer.remaining());
|
||||||
byte[] rDest = CellUtil.cloneRow(bbCell);
|
byte[] rDest = CellUtil.cloneRow(bbCell);
|
||||||
|
@ -452,10 +451,11 @@ public class TestCellUtil {
|
||||||
byte[] q2 = Bytes.toBytes("qual2");
|
byte[] q2 = Bytes.toBytes("qual2");
|
||||||
byte[] v = Bytes.toBytes("val1");
|
byte[] v = Bytes.toBytes("val1");
|
||||||
byte[] tags = Bytes.toBytes("tag1");
|
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());
|
ByteBuffer buffer = ByteBuffer.wrap(kv.getBuffer());
|
||||||
Cell bbCell1 = new ByteBufferKeyValue(buffer, 0, buffer.remaining());
|
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());
|
buffer = ByteBuffer.wrap(kv.getBuffer());
|
||||||
Cell bbCell2 = new ByteBufferKeyValue(buffer, 0, buffer.remaining());
|
Cell bbCell2 = new ByteBufferKeyValue(buffer, 0, buffer.remaining());
|
||||||
assertTrue(CellUtil.matchingRows(bbCell1, bbCell2));
|
assertTrue(CellUtil.matchingRows(bbCell1, bbCell2));
|
||||||
|
@ -512,7 +512,8 @@ public class TestCellUtil {
|
||||||
byte[] q2 = Bytes.toBytes("qual2");
|
byte[] q2 = Bytes.toBytes("qual2");
|
||||||
byte[] v = Bytes.toBytes("val1");
|
byte[] v = Bytes.toBytes("val1");
|
||||||
byte[] tags = Bytes.toBytes("tag1");
|
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);
|
NonExtendedCell nonExtCell = new NonExtendedCell(kv);
|
||||||
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||||
int writeCell = PrivateCellUtil.writeCell(nonExtCell, os, true);
|
int writeCell = PrivateCellUtil.writeCell(nonExtCell, os, true);
|
||||||
|
@ -619,8 +620,8 @@ public class TestCellUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DataType getType() {
|
public Type getType() {
|
||||||
return PrivateCellUtil.toDataType(getTypeByte());
|
return PrivateCellUtil.toType(getTypeByte());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,6 @@ import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.TreeSet;
|
import java.util.TreeSet;
|
||||||
|
|
||||||
import org.apache.hadoop.hbase.KeyValue.Type;
|
|
||||||
import org.apache.hadoop.hbase.util.ByteBufferUtils;
|
import org.apache.hadoop.hbase.util.ByteBufferUtils;
|
||||||
import org.apache.hadoop.hbase.util.Bytes;
|
import org.apache.hadoop.hbase.util.Bytes;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
@ -49,14 +48,14 @@ public class TestKeyValue extends TestCase {
|
||||||
byte [] family2 = Bytes.toBytes("abcd");
|
byte [] family2 = Bytes.toBytes("abcd");
|
||||||
byte [] qualifier2 = Bytes.toBytes("ef");
|
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));
|
assertFalse(CellUtil.matchingColumn(aaa, family2, qualifier2));
|
||||||
assertTrue(CellUtil.matchingColumn(aaa, family1, qualifier1));
|
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));
|
assertFalse(CellUtil.matchingColumn(aaa, family1, qualifier1));
|
||||||
assertTrue(CellUtil.matchingColumn(aaa, family2,qualifier2));
|
assertTrue(CellUtil.matchingColumn(aaa, family2,qualifier2));
|
||||||
byte [] nullQualifier = new byte[0];
|
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));
|
assertTrue(CellUtil.matchingColumn(aaa, family1,null));
|
||||||
assertFalse(CellUtil.matchingColumn(aaa, family2,qualifier2));
|
assertFalse(CellUtil.matchingColumn(aaa, family2,qualifier2));
|
||||||
}
|
}
|
||||||
|
@ -72,7 +71,7 @@ public class TestKeyValue extends TestCase {
|
||||||
byte [] family2 = Bytes.toBytes("ab");
|
byte [] family2 = Bytes.toBytes("ab");
|
||||||
byte [] qualifier2 = Bytes.toBytes("def");
|
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));
|
assertFalse(CellUtil.matchingColumn(aaa, family2, qualifier2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -301,15 +300,15 @@ public class TestKeyValue extends TestCase {
|
||||||
long ts = 1;
|
long ts = 1;
|
||||||
|
|
||||||
// 'fa:'
|
// '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:'
|
// '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'
|
// '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'
|
// '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:'
|
// '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'
|
// 'fami:qf1' < 'fami:qf2'
|
||||||
assertKVLessWithoutRow(c, 0, kv0_1, kv0_2);
|
assertKVLessWithoutRow(c, 0, kv0_1, kv0_2);
|
||||||
|
@ -347,14 +346,14 @@ public class TestKeyValue extends TestCase {
|
||||||
final KeyValue firstOnRowA = KeyValueUtil.createFirstOnRow(rowA);
|
final KeyValue firstOnRowA = KeyValueUtil.createFirstOnRow(rowA);
|
||||||
final KeyValue firstOnRowABufferFamQual = KeyValueUtil.createFirstOnRow(bufferA, offsetA,
|
final KeyValue firstOnRowABufferFamQual = KeyValueUtil.createFirstOnRow(bufferA, offsetA,
|
||||||
rowA, 0, rowA.length, family, 0, family.length, qualA, 0, qualA.length);
|
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_1 = new KeyValue(rowA, null, null, ts, KeyValue.Type.Put);
|
||||||
final KeyValue kvA_2 = new KeyValue(rowA, family, qualA, ts, Type.Put);
|
final KeyValue kvA_2 = new KeyValue(rowA, family, qualA, ts, KeyValue.Type.Put);
|
||||||
|
|
||||||
final KeyValue lastOnRowA = KeyValueUtil.createLastOnRow(rowA);
|
final KeyValue lastOnRowA = KeyValueUtil.createLastOnRow(rowA);
|
||||||
final KeyValue firstOnRowB = KeyValueUtil.createFirstOnRow(rowB);
|
final KeyValue firstOnRowB = KeyValueUtil.createFirstOnRow(rowB);
|
||||||
final KeyValue firstOnRowBBufferFam = KeyValueUtil.createFirstOnRow(bufferB, offsetB,
|
final KeyValue firstOnRowBBufferFam = KeyValueUtil.createFirstOnRow(bufferB, offsetB,
|
||||||
rowB, 0, rowB.length, family, 0, family.length, null, 0, 0);
|
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, firstOnRowB);
|
||||||
assertKVLess(c, firstOnRowA, firstOnRowBBufferFam);
|
assertKVLess(c, firstOnRowA, firstOnRowBBufferFam);
|
||||||
|
@ -740,8 +739,8 @@ public class TestKeyValue extends TestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DataType getType() {
|
public Type getType() {
|
||||||
return PrivateCellUtil.toDataType(getTypeByte());
|
return PrivateCellUtil.toType(getTypeByte());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,8 @@ import java.util.concurrent.ThreadLocalRandom;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.apache.hadoop.conf.Configured;
|
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.CellBuilderFactory;
|
||||||
import org.apache.hadoop.hbase.CellBuilderType;
|
import org.apache.hadoop.hbase.CellBuilderType;
|
||||||
import org.apache.hadoop.hbase.TableName;
|
import org.apache.hadoop.hbase.TableName;
|
||||||
|
@ -226,7 +227,7 @@ public class MultiThreadedClientExample extends Configured implements Tool {
|
||||||
.setFamily(FAMILY)
|
.setFamily(FAMILY)
|
||||||
.setQualifier(QUAL)
|
.setQualifier(QUAL)
|
||||||
.setTimestamp(p.getTimeStamp())
|
.setTimestamp(p.getTimeStamp())
|
||||||
.setType(DataType.Put)
|
.setType(Cell.Type.Put)
|
||||||
.setValue(value)
|
.setValue(value)
|
||||||
.build());
|
.build());
|
||||||
puts.add(p);
|
puts.add(p);
|
||||||
|
@ -263,7 +264,7 @@ public class MultiThreadedClientExample extends Configured implements Tool {
|
||||||
.setFamily(FAMILY)
|
.setFamily(FAMILY)
|
||||||
.setQualifier(QUAL)
|
.setQualifier(QUAL)
|
||||||
.setTimestamp(p.getTimeStamp())
|
.setTimestamp(p.getTimeStamp())
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(value)
|
.setValue(value)
|
||||||
.build());
|
.build());
|
||||||
t.put(p);
|
t.put(p);
|
||||||
|
|
|
@ -88,7 +88,7 @@ public class ValueRewritingObserver implements RegionObserver, RegionCoprocessor
|
||||||
cellBuilder.setFamily(CellUtil.cloneFamily(c));
|
cellBuilder.setFamily(CellUtil.cloneFamily(c));
|
||||||
cellBuilder.setQualifier(CellUtil.cloneQualifier(c));
|
cellBuilder.setQualifier(CellUtil.cloneQualifier(c));
|
||||||
cellBuilder.setTimestamp(c.getTimestamp());
|
cellBuilder.setTimestamp(c.getTimestamp());
|
||||||
cellBuilder.setType(Cell.DataType.Put);
|
cellBuilder.setType(Cell.Type.Put);
|
||||||
// Make sure each cell gets a unique value
|
// Make sure each cell gets a unique value
|
||||||
byte[] clonedValue = new byte[replacedValue.length];
|
byte[] clonedValue = new byte[replacedValue.length];
|
||||||
System.arraycopy(replacedValue, 0, clonedValue, 0, replacedValue.length);
|
System.arraycopy(replacedValue, 0, clonedValue, 0, replacedValue.length);
|
||||||
|
|
|
@ -79,7 +79,7 @@ public class WriteHeavyIncrementObserver implements RegionCoprocessor, RegionObs
|
||||||
|
|
||||||
private Cell createCell(byte[] row, byte[] family, byte[] qualifier, long ts, long value) {
|
private Cell createCell(byte[] row, byte[] family, byte[] qualifier, long ts, long value) {
|
||||||
return CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY).setRow(row)
|
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();
|
.setTimestamp(ts).setValue(Bytes.toBytes(value)).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -249,7 +249,7 @@ public class WriteHeavyIncrementObserver implements RegionCoprocessor, RegionObs
|
||||||
.setQualifier(cell.getQualifierArray(), cell.getQualifierOffset(),
|
.setQualifier(cell.getQualifierArray(), cell.getQualifierOffset(),
|
||||||
cell.getQualifierLength())
|
cell.getQualifierLength())
|
||||||
.setValue(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength())
|
.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);
|
c.getEnvironment().getRegion().put(put);
|
||||||
|
|
|
@ -38,7 +38,7 @@ import javax.ws.rs.core.UriInfo;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.hadoop.hbase.Cell;
|
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.CellBuilderFactory;
|
||||||
import org.apache.hadoop.hbase.CellBuilderType;
|
import org.apache.hadoop.hbase.CellBuilderType;
|
||||||
import org.apache.hadoop.hbase.CellUtil;
|
import org.apache.hadoop.hbase.CellUtil;
|
||||||
|
@ -246,7 +246,7 @@ public class RowResource extends ResourceBase {
|
||||||
.setFamily(parts[0])
|
.setFamily(parts[0])
|
||||||
.setQualifier(parts[1])
|
.setQualifier(parts[1])
|
||||||
.setTimestamp(cell.getTimestamp())
|
.setTimestamp(cell.getTimestamp())
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(cell.getValue())
|
.setValue(cell.getValue())
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
@ -321,7 +321,7 @@ public class RowResource extends ResourceBase {
|
||||||
.setFamily(parts[0])
|
.setFamily(parts[0])
|
||||||
.setQualifier(parts[1])
|
.setQualifier(parts[1])
|
||||||
.setTimestamp(timestamp)
|
.setTimestamp(timestamp)
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(message)
|
.setValue(message)
|
||||||
.build());
|
.build());
|
||||||
table = servlet.getTable(tableResource.getName());
|
table = servlet.getTable(tableResource.getName());
|
||||||
|
@ -518,7 +518,7 @@ public class RowResource extends ResourceBase {
|
||||||
.setFamily(parts[0])
|
.setFamily(parts[0])
|
||||||
.setQualifier(parts[1])
|
.setQualifier(parts[1])
|
||||||
.setTimestamp(cell.getTimestamp())
|
.setTimestamp(cell.getTimestamp())
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(cell.getValue())
|
.setValue(cell.getValue())
|
||||||
.build());
|
.build());
|
||||||
if(Bytes.equals(col,
|
if(Bytes.equals(col,
|
||||||
|
|
|
@ -33,7 +33,7 @@ import java.util.Set;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.hadoop.conf.Configuration;
|
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.CellBuilderFactory;
|
||||||
import org.apache.hadoop.hbase.CellBuilderType;
|
import org.apache.hadoop.hbase.CellBuilderType;
|
||||||
import org.apache.hadoop.hbase.HBaseIOException;
|
import org.apache.hadoop.hbase.HBaseIOException;
|
||||||
|
@ -184,7 +184,7 @@ public class FavoredNodeAssignmentHelper {
|
||||||
.setFamily(HConstants.CATALOG_FAMILY)
|
.setFamily(HConstants.CATALOG_FAMILY)
|
||||||
.setQualifier(FAVOREDNODES_QUALIFIER)
|
.setQualifier(FAVOREDNODES_QUALIFIER)
|
||||||
.setTimestamp(EnvironmentEdgeManager.currentTime())
|
.setTimestamp(EnvironmentEdgeManager.currentTime())
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(favoredNodes)
|
.setValue(favoredNodes)
|
||||||
.build());
|
.build());
|
||||||
LOG.debug("Create the region " + regionInfo.getRegionNameAsString() +
|
LOG.debug("Create the region " + regionInfo.getRegionNameAsString() +
|
||||||
|
|
|
@ -24,7 +24,7 @@ import java.util.NavigableSet;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.hadoop.conf.Configuration;
|
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.CellBuilderFactory;
|
||||||
import org.apache.hadoop.hbase.CellBuilderType;
|
import org.apache.hadoop.hbase.CellBuilderType;
|
||||||
import org.apache.hadoop.hbase.CellUtil;
|
import org.apache.hadoop.hbase.CellUtil;
|
||||||
|
@ -158,7 +158,7 @@ public class TableNamespaceManager {
|
||||||
.setFamily(TableDescriptorBuilder.NAMESPACE_FAMILY_INFO_BYTES)
|
.setFamily(TableDescriptorBuilder.NAMESPACE_FAMILY_INFO_BYTES)
|
||||||
.setQualifier(TableDescriptorBuilder.NAMESPACE_COL_DESC_BYTES)
|
.setQualifier(TableDescriptorBuilder.NAMESPACE_COL_DESC_BYTES)
|
||||||
.setTimestamp(p.getTimeStamp())
|
.setTimestamp(p.getTimeStamp())
|
||||||
.setType(DataType.Put)
|
.setType(Cell.Type.Put)
|
||||||
.setValue(ProtobufUtil.toProtoNamespaceDescriptor(ns).toByteArray())
|
.setValue(ProtobufUtil.toProtoNamespaceDescriptor(ns).toByteArray())
|
||||||
.build());
|
.build());
|
||||||
nsTable.put(p);
|
nsTable.put(p);
|
||||||
|
|
|
@ -25,7 +25,6 @@ import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.hadoop.hbase.Cell;
|
import org.apache.hadoop.hbase.Cell;
|
||||||
import org.apache.hadoop.hbase.Cell.DataType;
|
|
||||||
import org.apache.hadoop.hbase.CellBuilderFactory;
|
import org.apache.hadoop.hbase.CellBuilderFactory;
|
||||||
import org.apache.hadoop.hbase.CellBuilderType;
|
import org.apache.hadoop.hbase.CellBuilderType;
|
||||||
import org.apache.hadoop.hbase.HConstants;
|
import org.apache.hadoop.hbase.HConstants;
|
||||||
|
@ -186,7 +185,7 @@ public class RegionStateStore {
|
||||||
.setFamily(HConstants.CATALOG_FAMILY)
|
.setFamily(HConstants.CATALOG_FAMILY)
|
||||||
.setQualifier(getServerNameColumn(replicaId))
|
.setQualifier(getServerNameColumn(replicaId))
|
||||||
.setTimestamp(put.getTimeStamp())
|
.setTimestamp(put.getTimeStamp())
|
||||||
.setType(DataType.Put)
|
.setType(Cell.Type.Put)
|
||||||
.setValue(Bytes.toBytes(regionLocation.getServerName()))
|
.setValue(Bytes.toBytes(regionLocation.getServerName()))
|
||||||
.build());
|
.build());
|
||||||
info.append(", regionLocation=").append(regionLocation);
|
info.append(", regionLocation=").append(regionLocation);
|
||||||
|
@ -196,7 +195,7 @@ public class RegionStateStore {
|
||||||
.setFamily(HConstants.CATALOG_FAMILY)
|
.setFamily(HConstants.CATALOG_FAMILY)
|
||||||
.setQualifier(getStateColumn(replicaId))
|
.setQualifier(getStateColumn(replicaId))
|
||||||
.setTimestamp(put.getTimeStamp())
|
.setTimestamp(put.getTimeStamp())
|
||||||
.setType(DataType.Put)
|
.setType(Cell.Type.Put)
|
||||||
.setValue(Bytes.toBytes(state.name()))
|
.setValue(Bytes.toBytes(state.name()))
|
||||||
.build());
|
.build());
|
||||||
LOG.info(info.toString());
|
LOG.info(info.toString());
|
||||||
|
|
|
@ -35,7 +35,7 @@ import java.util.TreeSet;
|
||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.hbase.AuthUtil;
|
import org.apache.hadoop.hbase.AuthUtil;
|
||||||
import org.apache.hadoop.hbase.Cell;
|
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.CellBuilderFactory;
|
||||||
import org.apache.hadoop.hbase.CellBuilderType;
|
import org.apache.hadoop.hbase.CellBuilderType;
|
||||||
import org.apache.hadoop.hbase.CellUtil;
|
import org.apache.hadoop.hbase.CellUtil;
|
||||||
|
@ -173,7 +173,7 @@ public class AccessControlLists {
|
||||||
.setFamily(ACL_LIST_FAMILY)
|
.setFamily(ACL_LIST_FAMILY)
|
||||||
.setQualifier(key)
|
.setQualifier(key)
|
||||||
.setTimestamp(p.getTimeStamp())
|
.setTimestamp(p.getTimeStamp())
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(value)
|
.setValue(value)
|
||||||
.build());
|
.build());
|
||||||
if (LOG.isDebugEnabled()) {
|
if (LOG.isDebugEnabled()) {
|
||||||
|
|
|
@ -44,7 +44,7 @@ import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.hbase.ArrayBackedTag;
|
import org.apache.hadoop.hbase.ArrayBackedTag;
|
||||||
import org.apache.hadoop.hbase.AuthUtil;
|
import org.apache.hadoop.hbase.AuthUtil;
|
||||||
import org.apache.hadoop.hbase.Cell;
|
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.CellBuilderFactory;
|
||||||
import org.apache.hadoop.hbase.CellBuilderType;
|
import org.apache.hadoop.hbase.CellBuilderType;
|
||||||
import org.apache.hadoop.hbase.CellUtil;
|
import org.apache.hadoop.hbase.CellUtil;
|
||||||
|
@ -218,7 +218,7 @@ public class DefaultVisibilityLabelServiceImpl implements VisibilityLabelService
|
||||||
.setFamily(LABELS_TABLE_FAMILY)
|
.setFamily(LABELS_TABLE_FAMILY)
|
||||||
.setQualifier(LABEL_QUALIFIER)
|
.setQualifier(LABEL_QUALIFIER)
|
||||||
.setTimestamp(p.getTimeStamp())
|
.setTimestamp(p.getTimeStamp())
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(Bytes.toBytes(SYSTEM_LABEL))
|
.setValue(Bytes.toBytes(SYSTEM_LABEL))
|
||||||
.build());
|
.build());
|
||||||
region.put(p);
|
region.put(p);
|
||||||
|
@ -246,7 +246,7 @@ public class DefaultVisibilityLabelServiceImpl implements VisibilityLabelService
|
||||||
.setFamily(LABELS_TABLE_FAMILY)
|
.setFamily(LABELS_TABLE_FAMILY)
|
||||||
.setQualifier(LABEL_QUALIFIER)
|
.setQualifier(LABEL_QUALIFIER)
|
||||||
.setTimestamp(p.getTimeStamp())
|
.setTimestamp(p.getTimeStamp())
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(label)
|
.setValue(label)
|
||||||
.setTags(TagUtil.fromList(Arrays.asList(LABELS_TABLE_TAGS)))
|
.setTags(TagUtil.fromList(Arrays.asList(LABELS_TABLE_TAGS)))
|
||||||
.build());
|
.build());
|
||||||
|
@ -286,7 +286,7 @@ public class DefaultVisibilityLabelServiceImpl implements VisibilityLabelService
|
||||||
.setFamily(LABELS_TABLE_FAMILY)
|
.setFamily(LABELS_TABLE_FAMILY)
|
||||||
.setQualifier(user)
|
.setQualifier(user)
|
||||||
.setTimestamp(p.getTimeStamp())
|
.setTimestamp(p.getTimeStamp())
|
||||||
.setType(DataType.Put)
|
.setType(Cell.Type.Put)
|
||||||
.setValue(DUMMY_VALUE)
|
.setValue(DUMMY_VALUE)
|
||||||
.setTags(TagUtil.fromList(Arrays.asList(LABELS_TABLE_TAGS)))
|
.setTags(TagUtil.fromList(Arrays.asList(LABELS_TABLE_TAGS)))
|
||||||
.build());
|
.build());
|
||||||
|
|
|
@ -24,7 +24,7 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.ThreadLocalRandom;
|
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.CellBuilderFactory;
|
||||||
import org.apache.hadoop.hbase.CellBuilderType;
|
import org.apache.hadoop.hbase.CellBuilderType;
|
||||||
import org.apache.hadoop.hbase.CompatibilityFactory;
|
import org.apache.hadoop.hbase.CompatibilityFactory;
|
||||||
|
@ -157,7 +157,7 @@ public class TestMultiRespectsLimits {
|
||||||
.setFamily(FAMILY)
|
.setFamily(FAMILY)
|
||||||
.setQualifier(col)
|
.setQualifier(col)
|
||||||
.setTimestamp(p.getTimeStamp())
|
.setTimestamp(p.getTimeStamp())
|
||||||
.setType(DataType.Put)
|
.setType(Cell.Type.Put)
|
||||||
.setValue(value)
|
.setValue(value)
|
||||||
.build());
|
.build());
|
||||||
t.put(p);
|
t.put(p);
|
||||||
|
|
|
@ -215,7 +215,7 @@ public class TestPassCustomCellViaRegionObserver {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Cell createCustomCell(byte[] row, byte[] family, byte[] qualifier,
|
private static Cell createCustomCell(byte[] row, byte[] family, byte[] qualifier,
|
||||||
Cell.DataType type, byte[] value) {
|
Cell.Type type, byte[] value) {
|
||||||
return new Cell() {
|
return new Cell() {
|
||||||
|
|
||||||
private byte[] getArray(byte[] array) {
|
private byte[] getArray(byte[] array) {
|
||||||
|
@ -317,28 +317,28 @@ public class TestPassCustomCellViaRegionObserver {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DataType getType() {
|
public Type getType() {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Cell createCustomCell(Put put) {
|
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) {
|
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);
|
APPEND_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Cell createCustomCell(Increment inc) {
|
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) {
|
private static Cell createCustomCell(Delete delete) {
|
||||||
return createCustomCell(delete.getRow(), FAMILY, QUALIFIER_FROM_CP,
|
return createCustomCell(delete.getRow(), FAMILY, QUALIFIER_FROM_CP,
|
||||||
Cell.DataType.DeleteColumn, null);
|
Cell.Type.DeleteColumn, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class RegionObserverImpl implements RegionCoprocessor, RegionObserver {
|
public static class RegionObserverImpl implements RegionCoprocessor, RegionObserver {
|
||||||
|
|
|
@ -190,7 +190,7 @@ public class MockHStoreFile extends HStoreFile {
|
||||||
public Optional<Cell> getLastKey() {
|
public Optional<Cell> getLastKey() {
|
||||||
if (splitPoint != null) {
|
if (splitPoint != null) {
|
||||||
return Optional.of(CellBuilderFactory.create(CellBuilderType.DEEP_COPY)
|
return Optional.of(CellBuilderFactory.create(CellBuilderType.DEEP_COPY)
|
||||||
.setType(Cell.DataType.Put)
|
.setType(Cell.Type.Put)
|
||||||
.setRow(Arrays.copyOf(splitPoint, splitPoint.length + 1)).build());
|
.setRow(Arrays.copyOf(splitPoint, splitPoint.length + 1)).build());
|
||||||
} else {
|
} else {
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
|
@ -201,7 +201,7 @@ public class MockHStoreFile extends HStoreFile {
|
||||||
public Optional<Cell> midKey() throws IOException {
|
public Optional<Cell> midKey() throws IOException {
|
||||||
if (splitPoint != null) {
|
if (splitPoint != null) {
|
||||||
return Optional.of(CellBuilderFactory.create(CellBuilderType.DEEP_COPY)
|
return Optional.of(CellBuilderFactory.create(CellBuilderType.DEEP_COPY)
|
||||||
.setType(Cell.DataType.Put).setRow(splitPoint).build());
|
.setType(Cell.Type.Put).setRow(splitPoint).build());
|
||||||
} else {
|
} else {
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
|
@ -211,7 +211,7 @@ public class MockHStoreFile extends HStoreFile {
|
||||||
public Optional<Cell> getFirstKey() {
|
public Optional<Cell> getFirstKey() {
|
||||||
if (splitPoint != null) {
|
if (splitPoint != null) {
|
||||||
return Optional.of(CellBuilderFactory.create(CellBuilderType.DEEP_COPY)
|
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());
|
.build());
|
||||||
} else {
|
} else {
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
|
|
|
@ -28,7 +28,8 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
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.CellBuilderFactory;
|
||||||
import org.apache.hadoop.hbase.CellBuilderType;
|
import org.apache.hadoop.hbase.CellBuilderType;
|
||||||
import org.apache.hadoop.hbase.HBaseTestingUtility;
|
import org.apache.hadoop.hbase.HBaseTestingUtility;
|
||||||
|
@ -154,7 +155,7 @@ public class TestCompactionLifeCycleTracker {
|
||||||
.setFamily(CF1)
|
.setFamily(CF1)
|
||||||
.setQualifier(QUALIFIER)
|
.setQualifier(QUALIFIER)
|
||||||
.setTimestamp(HConstants.LATEST_TIMESTAMP)
|
.setTimestamp(HConstants.LATEST_TIMESTAMP)
|
||||||
.setType(DataType.Put)
|
.setType(Cell.Type.Put)
|
||||||
.setValue(Bytes.toBytes(i))
|
.setValue(Bytes.toBytes(i))
|
||||||
.build()));
|
.build()));
|
||||||
}
|
}
|
||||||
|
@ -167,7 +168,7 @@ public class TestCompactionLifeCycleTracker {
|
||||||
.setFamily(CF1)
|
.setFamily(CF1)
|
||||||
.setQualifier(QUALIFIER)
|
.setQualifier(QUALIFIER)
|
||||||
.setTimestamp(HConstants.LATEST_TIMESTAMP)
|
.setTimestamp(HConstants.LATEST_TIMESTAMP)
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(Bytes.toBytes(i))
|
.setValue(Bytes.toBytes(i))
|
||||||
.build()));
|
.build()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ import java.io.InterruptedIOException;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.concurrent.CountDownLatch;
|
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.CellBuilderFactory;
|
||||||
import org.apache.hadoop.hbase.CellBuilderType;
|
import org.apache.hadoop.hbase.CellBuilderType;
|
||||||
import org.apache.hadoop.hbase.HBaseTestingUtility;
|
import org.apache.hadoop.hbase.HBaseTestingUtility;
|
||||||
|
@ -200,7 +200,7 @@ public class TestFlushLifeCycleTracker {
|
||||||
.setFamily(CF)
|
.setFamily(CF)
|
||||||
.setQualifier(QUALIFIER)
|
.setQualifier(QUALIFIER)
|
||||||
.setTimestamp(HConstants.LATEST_TIMESTAMP)
|
.setTimestamp(HConstants.LATEST_TIMESTAMP)
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(Bytes.toBytes(i))
|
.setValue(Bytes.toBytes(i))
|
||||||
.build()));
|
.build()));
|
||||||
}
|
}
|
||||||
|
@ -234,7 +234,7 @@ public class TestFlushLifeCycleTracker {
|
||||||
.setFamily(CF)
|
.setFamily(CF)
|
||||||
.setQualifier(QUALIFIER)
|
.setQualifier(QUALIFIER)
|
||||||
.setTimestamp(HConstants.LATEST_TIMESTAMP)
|
.setTimestamp(HConstants.LATEST_TIMESTAMP)
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(Bytes.toBytes(i))
|
.setValue(Bytes.toBytes(i))
|
||||||
.build()));
|
.build()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,7 @@ import org.apache.hadoop.fs.Path;
|
||||||
import org.apache.hadoop.hbase.ArrayBackedTag;
|
import org.apache.hadoop.hbase.ArrayBackedTag;
|
||||||
import org.apache.hadoop.hbase.CategoryBasedTimeout;
|
import org.apache.hadoop.hbase.CategoryBasedTimeout;
|
||||||
import org.apache.hadoop.hbase.Cell;
|
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.CellBuilderFactory;
|
||||||
import org.apache.hadoop.hbase.CellBuilderType;
|
import org.apache.hadoop.hbase.CellBuilderType;
|
||||||
import org.apache.hadoop.hbase.CellUtil;
|
import org.apache.hadoop.hbase.CellUtil;
|
||||||
|
@ -6281,20 +6281,20 @@ public class TestHRegion {
|
||||||
.setRow(a)
|
.setRow(a)
|
||||||
.setFamily(fam1)
|
.setFamily(fam1)
|
||||||
.setTimestamp(HConstants.LATEST_TIMESTAMP)
|
.setTimestamp(HConstants.LATEST_TIMESTAMP)
|
||||||
.setType(DataType.Put)
|
.setType(Cell.Type.Put)
|
||||||
.build()),
|
.build()),
|
||||||
// this is outside the region boundary
|
// this is outside the region boundary
|
||||||
new Put(c).add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY)
|
new Put(c).add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY)
|
||||||
.setRow(c)
|
.setRow(c)
|
||||||
.setFamily(fam1)
|
.setFamily(fam1)
|
||||||
.setTimestamp(HConstants.LATEST_TIMESTAMP)
|
.setTimestamp(HConstants.LATEST_TIMESTAMP)
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.build()),
|
.build()),
|
||||||
new Put(b).add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY)
|
new Put(b).add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY)
|
||||||
.setRow(b)
|
.setRow(b)
|
||||||
.setFamily(fam1)
|
.setFamily(fam1)
|
||||||
.setTimestamp(HConstants.LATEST_TIMESTAMP)
|
.setTimestamp(HConstants.LATEST_TIMESTAMP)
|
||||||
.setType(DataType.Put)
|
.setType(Cell.Type.Put)
|
||||||
.build())
|
.build())
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -6330,13 +6330,13 @@ public class TestHRegion {
|
||||||
.setRow(a)
|
.setRow(a)
|
||||||
.setFamily(fam1)
|
.setFamily(fam1)
|
||||||
.setTimestamp(HConstants.LATEST_TIMESTAMP)
|
.setTimestamp(HConstants.LATEST_TIMESTAMP)
|
||||||
.setType(DataType.Put)
|
.setType(Cell.Type.Put)
|
||||||
.build()),
|
.build()),
|
||||||
new Put(b).add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY)
|
new Put(b).add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY)
|
||||||
.setRow(b)
|
.setRow(b)
|
||||||
.setFamily(fam1)
|
.setFamily(fam1)
|
||||||
.setTimestamp(HConstants.LATEST_TIMESTAMP)
|
.setTimestamp(HConstants.LATEST_TIMESTAMP)
|
||||||
.setType(DataType.Put)
|
.setType(Cell.Type.Put)
|
||||||
.build()),
|
.build()),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1047,13 +1047,13 @@ public class TestHStore {
|
||||||
long seqId = 100;
|
long seqId = 100;
|
||||||
long timestamp = System.currentTimeMillis();
|
long timestamp = System.currentTimeMillis();
|
||||||
Cell cell0 = CellBuilderFactory.create(CellBuilderType.DEEP_COPY).setRow(row).setFamily(family)
|
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();
|
.setValue(qf1).build();
|
||||||
PrivateCellUtil.setSequenceId(cell0, seqId);
|
PrivateCellUtil.setSequenceId(cell0, seqId);
|
||||||
testNumberOfMemStoreScannersAfterFlush(Arrays.asList(cell0), Collections.emptyList());
|
testNumberOfMemStoreScannersAfterFlush(Arrays.asList(cell0), Collections.emptyList());
|
||||||
|
|
||||||
Cell cell1 = CellBuilderFactory.create(CellBuilderType.DEEP_COPY).setRow(row).setFamily(family)
|
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();
|
.setValue(qf1).build();
|
||||||
PrivateCellUtil.setSequenceId(cell1, seqId);
|
PrivateCellUtil.setSequenceId(cell1, seqId);
|
||||||
testNumberOfMemStoreScannersAfterFlush(Arrays.asList(cell0), Arrays.asList(cell1));
|
testNumberOfMemStoreScannersAfterFlush(Arrays.asList(cell0), Arrays.asList(cell1));
|
||||||
|
@ -1061,7 +1061,7 @@ public class TestHStore {
|
||||||
seqId = 101;
|
seqId = 101;
|
||||||
timestamp = System.currentTimeMillis();
|
timestamp = System.currentTimeMillis();
|
||||||
Cell cell2 = CellBuilderFactory.create(CellBuilderType.DEEP_COPY).setRow(row2).setFamily(family)
|
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();
|
.setValue(qf1).build();
|
||||||
PrivateCellUtil.setSequenceId(cell2, seqId);
|
PrivateCellUtil.setSequenceId(cell2, seqId);
|
||||||
testNumberOfMemStoreScannersAfterFlush(Arrays.asList(cell0), Arrays.asList(cell1, cell2));
|
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)
|
private Cell createCell(byte[] row, byte[] qualifier, long ts, long sequenceId, byte[] value)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
Cell c = CellBuilderFactory.create(CellBuilderType.DEEP_COPY).setRow(row).setFamily(family)
|
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();
|
.setValue(value).build();
|
||||||
PrivateCellUtil.setSequenceId(c, sequenceId);
|
PrivateCellUtil.setSequenceId(c, sequenceId);
|
||||||
return c;
|
return c;
|
||||||
|
|
|
@ -158,7 +158,7 @@ public class TestWALEntrySinkFilter {
|
||||||
setRow(bytes).
|
setRow(bytes).
|
||||||
setFamily(bytes).
|
setFamily(bytes).
|
||||||
setQualifier(bytes).
|
setQualifier(bytes).
|
||||||
setType(Cell.DataType.Put).
|
setType(Cell.Type.Put).
|
||||||
setTimestamp(i).
|
setTimestamp(i).
|
||||||
setValue(bytes).build();
|
setValue(bytes).build();
|
||||||
cells.add(cell);
|
cells.add(cell);
|
||||||
|
|
|
@ -36,7 +36,6 @@ import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.hbase.ArrayBackedTag;
|
import org.apache.hadoop.hbase.ArrayBackedTag;
|
||||||
import org.apache.hadoop.hbase.AuthUtil;
|
import org.apache.hadoop.hbase.AuthUtil;
|
||||||
import org.apache.hadoop.hbase.Cell;
|
import org.apache.hadoop.hbase.Cell;
|
||||||
import org.apache.hadoop.hbase.Cell.DataType;
|
|
||||||
import org.apache.hadoop.hbase.CellBuilder;
|
import org.apache.hadoop.hbase.CellBuilder;
|
||||||
import org.apache.hadoop.hbase.CellBuilderFactory;
|
import org.apache.hadoop.hbase.CellBuilderFactory;
|
||||||
import org.apache.hadoop.hbase.CellBuilderType;
|
import org.apache.hadoop.hbase.CellBuilderType;
|
||||||
|
@ -112,7 +111,7 @@ public class ExpAsStringVisibilityLabelServiceImpl implements VisibilityLabelSer
|
||||||
.setFamily(LABELS_TABLE_FAMILY)
|
.setFamily(LABELS_TABLE_FAMILY)
|
||||||
.setQualifier(auth)
|
.setQualifier(auth)
|
||||||
.setTimestamp(p.getTimeStamp())
|
.setTimestamp(p.getTimeStamp())
|
||||||
.setType(DataType.Put)
|
.setType(Cell.Type.Put)
|
||||||
.setValue(DUMMY_VALUE)
|
.setValue(DUMMY_VALUE)
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ import org.apache.commons.cli.Option;
|
||||||
import org.apache.commons.cli.OptionGroup;
|
import org.apache.commons.cli.OptionGroup;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import org.apache.hadoop.conf.Configuration;
|
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.CellBuilder;
|
||||||
import org.apache.hadoop.hbase.CellBuilderFactory;
|
import org.apache.hadoop.hbase.CellBuilderFactory;
|
||||||
import org.apache.hadoop.hbase.CellBuilderType;
|
import org.apache.hadoop.hbase.CellBuilderType;
|
||||||
|
@ -1353,7 +1353,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
.setFamily(famAndQf[0])
|
.setFamily(famAndQf[0])
|
||||||
.setQualifier(famAndQf[1])
|
.setQualifier(famAndQf[1])
|
||||||
.setTimestamp(put.getTimeStamp())
|
.setTimestamp(put.getTimeStamp())
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(m.value != null ? getBytes(m.value)
|
.setValue(m.value != null ? getBytes(m.value)
|
||||||
: HConstants.EMPTY_BYTE_ARRAY)
|
: HConstants.EMPTY_BYTE_ARRAY)
|
||||||
.build());
|
.build());
|
||||||
|
@ -1421,7 +1421,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
.setFamily(famAndQf[0])
|
.setFamily(famAndQf[0])
|
||||||
.setQualifier(famAndQf[1])
|
.setQualifier(famAndQf[1])
|
||||||
.setTimestamp(put.getTimeStamp())
|
.setTimestamp(put.getTimeStamp())
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(m.value != null ? getBytes(m.value)
|
.setValue(m.value != null ? getBytes(m.value)
|
||||||
: HConstants.EMPTY_BYTE_ARRAY)
|
: HConstants.EMPTY_BYTE_ARRAY)
|
||||||
.build());
|
.build());
|
||||||
|
@ -1904,7 +1904,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
.setFamily(famAndQf[0])
|
.setFamily(famAndQf[0])
|
||||||
.setQualifier(famAndQf[1])
|
.setQualifier(famAndQf[1])
|
||||||
.setTimestamp(put.getTimeStamp())
|
.setTimestamp(put.getTimeStamp())
|
||||||
.setType(DataType.Put)
|
.setType(Type.Put)
|
||||||
.setValue(mput.value != null ? getBytes(mput.value)
|
.setValue(mput.value != null ? getBytes(mput.value)
|
||||||
: HConstants.EMPTY_BYTE_ARRAY)
|
: HConstants.EMPTY_BYTE_ARRAY)
|
||||||
.build());
|
.build());
|
||||||
|
|
|
@ -28,7 +28,6 @@ import java.util.Map;
|
||||||
|
|
||||||
import org.apache.commons.collections4.MapUtils;
|
import org.apache.commons.collections4.MapUtils;
|
||||||
import org.apache.hadoop.hbase.Cell;
|
import org.apache.hadoop.hbase.Cell;
|
||||||
import org.apache.hadoop.hbase.Cell.DataType;
|
|
||||||
import org.apache.hadoop.hbase.CellBuilderFactory;
|
import org.apache.hadoop.hbase.CellBuilderFactory;
|
||||||
import org.apache.hadoop.hbase.CellBuilderType;
|
import org.apache.hadoop.hbase.CellBuilderType;
|
||||||
import org.apache.hadoop.hbase.CellUtil;
|
import org.apache.hadoop.hbase.CellUtil;
|
||||||
|
@ -227,7 +226,7 @@ public class ThriftUtilities {
|
||||||
.setFamily(columnValue.getFamily())
|
.setFamily(columnValue.getFamily())
|
||||||
.setQualifier(columnValue.getQualifier())
|
.setQualifier(columnValue.getQualifier())
|
||||||
.setTimestamp(columnValue.getTimestamp())
|
.setTimestamp(columnValue.getTimestamp())
|
||||||
.setType(DataType.Put)
|
.setType(Cell.Type.Put)
|
||||||
.setValue(columnValue.getValue())
|
.setValue(columnValue.getValue())
|
||||||
.build());
|
.build());
|
||||||
} else {
|
} else {
|
||||||
|
@ -236,7 +235,7 @@ public class ThriftUtilities {
|
||||||
.setFamily(columnValue.getFamily())
|
.setFamily(columnValue.getFamily())
|
||||||
.setQualifier(columnValue.getQualifier())
|
.setQualifier(columnValue.getQualifier())
|
||||||
.setTimestamp(out.getTimeStamp())
|
.setTimestamp(out.getTimeStamp())
|
||||||
.setType(DataType.Put)
|
.setType(Cell.Type.Put)
|
||||||
.setValue(columnValue.getValue())
|
.setValue(columnValue.getValue())
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue