HBASE-22748 Removed deprecated methods from Put

Signed-off-by: stack <stack@apache.org>
This commit is contained in:
Jan Hentschel 2019-07-29 08:50:16 +02:00 committed by GitHub
parent 7294af8b15
commit e273d0bc3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 59 deletions

View File

@ -27,7 +27,6 @@ import java.util.NavigableMap;
import java.util.UUID;
import org.apache.hadoop.hbase.Cell;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.IndividualBytesFieldCell;
import org.apache.hadoop.hbase.KeyValue;
import org.apache.hadoop.hbase.io.HeapSize;
import org.apache.hadoop.hbase.security.access.Permission;
@ -178,18 +177,6 @@ public class Put extends Mutation implements HeapSize {
return addColumn(family, qualifier, this.ts, value);
}
/**
* See {@link #addColumn(byte[], byte[], byte[])}. This version expects
* that the underlying arrays won't change. It's intended
* for usage internal HBase to and for advanced client applications.
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0.
* Use {@link #add(Cell)} and {@link org.apache.hadoop.hbase.CellBuilder} instead
*/
@Deprecated
public Put addImmutable(byte [] family, byte [] qualifier, byte [] value) {
return addImmutable(family, qualifier, this.ts, value);
}
/**
* Add the specified column and value, with the specified timestamp as
* its version to this Put operation.
@ -209,30 +196,6 @@ public class Put extends Mutation implements HeapSize {
return this;
}
/**
* See {@link #addColumn(byte[], byte[], long, byte[])}. This version expects
* that the underlying arrays won't change. It's intended
* for usage internal HBase to and for advanced client applications.
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0.
* Use {@link #add(Cell)} and {@link org.apache.hadoop.hbase.CellBuilder} instead
*/
@Deprecated
public Put addImmutable(byte [] family, byte [] qualifier, long ts, byte [] value) {
// Family can not be null, otherwise NullPointerException is thrown when putting the cell into familyMap
if (family == null) {
throw new IllegalArgumentException("Family cannot be null");
}
// Check timestamp
if (ts < 0) {
throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts);
}
List<Cell> list = getCellList(family);
list.add(new IndividualBytesFieldCell(this.row, family, qualifier, ts, KeyValue.Type.Put, value));
return this;
}
/**
* Add the specified column and value, with the specified timestamp as
* its version to this Put operation.
@ -252,24 +215,6 @@ public class Put extends Mutation implements HeapSize {
return this;
}
/**
* See {@link #addColumn(byte[], ByteBuffer, long, ByteBuffer)}. This version expects
* that the underlying arrays won't change. It's intended
* for usage internal HBase to and for advanced client applications.
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0.
* Use {@link #add(Cell)} and {@link org.apache.hadoop.hbase.CellBuilder} instead
*/
@Deprecated
public Put addImmutable(byte[] family, ByteBuffer qualifier, long ts, ByteBuffer value) {
if (ts < 0) {
throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts);
}
List<Cell> list = getCellList(family);
KeyValue kv = createPutKeyValue(family, qualifier, ts, value, null);
list.add(kv);
return this;
}
/**
* Add the specified KeyValue to this Put operation. Operation assumes that
* the passed KeyValue is immutable and its backing array will not be modified

View File

@ -698,8 +698,7 @@ public class RemoteHTable implements Table {
private boolean doCheckAndDelete(byte[] row, byte[] family, byte[] qualifier, byte[] value,
Delete delete) throws IOException {
Put put = new Put(row);
put.setFamilyCellMap(delete.getFamilyCellMap());
Put put = new Put(row, HConstants.LATEST_TIMESTAMP, delete.getFamilyCellMap());
// column to check-the-value
put.add(new KeyValue(row, family, qualifier, value));
CellSetModel model = buildModelFromPut(put);

View File

@ -4488,8 +4488,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
familyMap = new TreeMap<>(Bytes.BYTES_COMPARATOR);
familyMap.put(family, edits);
Put p = new Put(row);
p.setFamilyCellMap(familyMap);
Put p = new Put(row, HConstants.LATEST_TIMESTAMP, familyMap);
doBatchMutate(p);
}