HBASE-19351 Deprecated is missing in Table implementations

Signed-off-by: Michael Stack <stack@apache.org>
This commit is contained in:
Peter Somogyi 2017-11-27 17:09:56 +01:00 committed by Michael Stack
parent b75510284f
commit b5a01685f4
4 changed files with 28 additions and 7 deletions

View File

@ -233,6 +233,7 @@ public class HTable implements Table {
* {@inheritDoc}
*/
@Override
@Deprecated
public HTableDescriptor getTableDescriptor() throws IOException {
HTableDescriptor htd = HBaseAdmin.getHTableDescriptor(tableName, connection, rpcCallerFactory,
rpcControllerFactory, operationTimeoutMs, readRpcTimeoutMs);
@ -745,7 +746,7 @@ public class HTable implements Table {
final byte [] family, final byte [] qualifier, final byte [] value,
final Put put)
throws IOException {
return checkAndPut(row, family, qualifier, CompareOp.EQUAL, value, put);
return checkAndPut(row, family, qualifier, CompareOperator.EQUAL, value, put);
}
private boolean doCheckAndPut(final byte [] row, final byte [] family,
@ -773,6 +774,7 @@ public class HTable implements Table {
* {@inheritDoc}
*/
@Override
@Deprecated
public boolean checkAndPut(final byte [] row, final byte [] family,
final byte [] qualifier, final CompareOp compareOp, final byte [] value,
final Put put)
@ -799,7 +801,7 @@ public class HTable implements Table {
@Override
public boolean checkAndDelete(final byte [] row, final byte [] family, final byte [] qualifier,
final byte [] value, final Delete delete) throws IOException {
return checkAndDelete(row, family, qualifier, CompareOp.EQUAL, value, delete);
return checkAndDelete(row, family, qualifier, CompareOperator.EQUAL, value, delete);
}
private boolean doCheckAndDelete(final byte [] row, final byte [] family,
@ -845,6 +847,7 @@ public class HTable implements Table {
* {@inheritDoc}
*/
@Override
@Deprecated
public boolean checkAndDelete(final byte [] row, final byte [] family,
final byte [] qualifier, final CompareOp compareOp, final byte [] value,
final Delete delete)
@ -919,6 +922,7 @@ public class HTable implements Table {
* {@inheritDoc}
*/
@Override
@Deprecated
public boolean checkAndMutate(final byte [] row, final byte [] family, final byte [] qualifier,
final CompareOp compareOp, final byte [] value, final RowMutations rm)
throws IOException {

View File

@ -251,6 +251,7 @@ public class RemoteHTable implements Table {
}
@Override
@Deprecated
public HTableDescriptor getTableDescriptor() throws IOException {
StringBuilder sb = new StringBuilder();
sb.append('/');
@ -702,6 +703,7 @@ public class RemoteHTable implements Table {
}
@Override
@Deprecated
public boolean checkAndPut(byte[] row, byte[] family, byte[] qualifier,
CompareOp compareOp, byte[] value, Put put) throws IOException {
throw new IOException("checkAndPut for non-equal comparison not implemented");
@ -752,6 +754,7 @@ public class RemoteHTable implements Table {
}
@Override
@Deprecated
public boolean checkAndDelete(byte[] row, byte[] family, byte[] qualifier,
CompareOp compareOp, byte[] value, Delete delete) throws IOException {
throw new IOException("checkAndDelete for non-equal comparison not implemented");
@ -835,17 +838,21 @@ public class RemoteHTable implements Table {
throw new UnsupportedOperationException("batchCoprocessorService not implemented");
}
@Override public boolean checkAndMutate(byte[] row, byte[] family, byte[] qualifier,
@Override
@Deprecated
public boolean checkAndMutate(byte[] row, byte[] family, byte[] qualifier,
CompareOp compareOp, byte[] value, RowMutations rm) throws IOException {
throw new UnsupportedOperationException("checkAndMutate not implemented");
}
@Override public boolean checkAndMutate(byte[] row, byte[] family, byte[] qualifier,
CompareOperator compareOp, byte[] value, RowMutations rm) throws IOException {
@Override
public boolean checkAndMutate(byte[] row, byte[] family, byte[] qualifier,
CompareOperator compareOp, byte[] value, RowMutations rm) throws IOException {
throw new UnsupportedOperationException("checkAndMutate not implemented");
}
@Override
@Deprecated
public void setOperationTimeout(int operationTimeout) {
throw new UnsupportedOperationException();
}
@ -885,6 +892,7 @@ public class RemoteHTable implements Table {
}
@Override
@Deprecated
public void setReadRpcTimeout(int readRpcTimeout) {
throw new UnsupportedOperationException();
}
@ -901,6 +909,7 @@ public class RemoteHTable implements Table {
}
@Override
@Deprecated
public void setWriteRpcTimeout(int writeRpcTimeout) {
throw new UnsupportedOperationException();
}

View File

@ -84,6 +84,7 @@ public class RegionAsTable implements Table {
}
@Override
@Deprecated
public HTableDescriptor getTableDescriptor() throws IOException {
return new HTableDescriptor(this.region.getTableDescriptor());
}
@ -219,6 +220,7 @@ public class RegionAsTable implements Table {
}
@Override
@Deprecated
public boolean checkAndPut(byte[] row, byte[] family, byte[] qualifier, CompareOp compareOp,
byte[] value, Put put)
throws IOException {
@ -250,6 +252,7 @@ public class RegionAsTable implements Table {
}
@Override
@Deprecated
public boolean checkAndDelete(byte[] row, byte[] family, byte[] qualifier,
CompareOp compareOp, byte[] value, Delete delete)
throws IOException {
@ -333,6 +336,7 @@ public class RegionAsTable implements Table {
}
@Override
@Deprecated
public boolean checkAndMutate(byte[] row, byte[] family, byte[] qualifier, CompareOp compareOp,
byte[] value, RowMutations mutation)
throws IOException {
@ -348,6 +352,7 @@ public class RegionAsTable implements Table {
}
@Override
@Deprecated
public void setOperationTimeout(int operationTimeout) {
throw new UnsupportedOperationException();
}
@ -370,6 +375,7 @@ public class RegionAsTable implements Table {
}
@Override
@Deprecated
public void setWriteRpcTimeout(int writeRpcTimeout) {throw new UnsupportedOperationException(); }
@Override
@ -378,6 +384,7 @@ public class RegionAsTable implements Table {
}
@Override
@Deprecated
public void setReadRpcTimeout(int readRpcTimeout) {throw new UnsupportedOperationException(); }
@Override

View File

@ -22,6 +22,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.hbase.Cell;
import org.apache.hadoop.hbase.ClusterStatus.Option;
import org.apache.hadoop.hbase.CompareOperator;
import org.apache.hadoop.hbase.HBaseTestingUtility;
import org.apache.hadoop.hbase.RegionLoad;
import org.apache.hadoop.hbase.ServerLoad;
@ -300,7 +301,7 @@ public class TestRegionServerReadRequestMetrics {
put = new Put(ROW1);
put.addColumn(CF1, COL2, VAL2);
boolean checkAndPut =
table.checkAndPut(ROW1, CF1, COL2, CompareFilter.CompareOp.EQUAL, VAL2, put);
table.checkAndPut(ROW1, CF1, COL2, CompareOperator.EQUAL, VAL2, put);
resultCount = checkAndPut ? 1 : 0;
testReadRequests(resultCount, 1, 0);
@ -317,7 +318,7 @@ public class TestRegionServerReadRequestMetrics {
RowMutations rm = new RowMutations(ROW1);
rm.add(put);
boolean checkAndMutate =
table.checkAndMutate(ROW1, CF1, COL1, CompareFilter.CompareOp.EQUAL, VAL1, rm);
table.checkAndMutate(ROW1, CF1, COL1, CompareOperator.EQUAL, VAL1, rm);
resultCount = checkAndMutate ? 1 : 0;
testReadRequests(resultCount, 1, 0);
}