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 8b6f305ac7
commit 12efae4829
4 changed files with 28 additions and 7 deletions

View File

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

View File

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

View File

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

View File

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