Skip to content

Commit

Permalink
HBASE-23777 Removed deprecated createTableDescriptor(String, int, int…
Browse files Browse the repository at this point in the history
…, int, KeepDeletedCells) from HBaseTestingUtility

Signed-off-by: stack <[email protected]>
Signed-off-by: Viraj Jasani <[email protected]>
  • Loading branch information
HorizonNet authored Feb 2, 2020
1 parent 5a3ad6f commit 12f1c7c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1899,19 +1899,6 @@ public void deleteTableIfAny(TableName tableName) throws IOException {
public static final byte [] START_KEY_BYTES = {FIRST_CHAR, FIRST_CHAR, FIRST_CHAR};
public static final String START_KEY = new String(START_KEY_BYTES, HConstants.UTF8_CHARSET);

/**
* @deprecated since 2.0.0 and will be removed in 3.0.0. Use
* {@link #createTableDescriptor(TableName, int, int, int, KeepDeletedCells)} instead.
* @see #createTableDescriptor(TableName, int, int, int, KeepDeletedCells)
* @see <a href="https://issues.apache.org/jira/browse/HBASE-13893">HBASE-13893</a>
*/
@Deprecated
public HTableDescriptor createTableDescriptor(final String name,
final int minVersions, final int versions, final int ttl, KeepDeletedCells keepDeleted) {
return this.createTableDescriptor(TableName.valueOf(name), minVersions, versions, ttl,
keepDeleted);
}

/**
* Create a table of name <code>name</code>.
* @param name Name to give table.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.KeepDeletedCells;
import org.apache.hadoop.hbase.PrivateCellUtil;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.Delete;
import org.apache.hadoop.hbase.client.Get;
import org.apache.hadoop.hbase.client.Put;
Expand Down Expand Up @@ -104,7 +105,7 @@ public void tearDown() throws Exception {
@Test
public void testBasicScenario() throws Exception {
// keep 3 versions, rows do not expire
HTableDescriptor htd = hbu.createTableDescriptor(name.getMethodName(), 0, 3,
HTableDescriptor htd = hbu.createTableDescriptor(TableName.valueOf(name.getMethodName()), 0, 3,
HConstants.FOREVER, KeepDeletedCells.TRUE);
HRegion region = hbu.createLocalHRegion(htd, null, null);

Expand Down Expand Up @@ -201,7 +202,7 @@ public void testBasicScenario() throws Exception {
@Test
public void testRawScanWithoutKeepingDeletes() throws Exception {
// KEEP_DELETED_CELLS is NOT enabled
HTableDescriptor htd = hbu.createTableDescriptor(name.getMethodName(), 0, 3,
HTableDescriptor htd = hbu.createTableDescriptor(TableName.valueOf(name.getMethodName()), 0, 3,
HConstants.FOREVER, KeepDeletedCells.FALSE);
HRegion region = hbu.createLocalHRegion(htd, null, null);

Expand Down Expand Up @@ -246,7 +247,7 @@ public void testRawScanWithoutKeepingDeletes() throws Exception {
@Test
public void testWithoutKeepingDeletes() throws Exception {
// KEEP_DELETED_CELLS is NOT enabled
HTableDescriptor htd = hbu.createTableDescriptor(name.getMethodName(), 0, 3,
HTableDescriptor htd = hbu.createTableDescriptor(TableName.valueOf(name.getMethodName()), 0, 3,
HConstants.FOREVER, KeepDeletedCells.FALSE);
HRegion region = hbu.createLocalHRegion(htd, null, null);

Expand Down Expand Up @@ -299,7 +300,7 @@ public void testWithoutKeepingDeletes() throws Exception {
*/
@Test
public void testRawScanWithColumns() throws Exception {
HTableDescriptor htd = hbu.createTableDescriptor(name.getMethodName(), 0, 3,
HTableDescriptor htd = hbu.createTableDescriptor(TableName.valueOf(name.getMethodName()), 0, 3,
HConstants.FOREVER, KeepDeletedCells.TRUE);
Region region = hbu.createLocalHRegion(htd, null, null);

Expand All @@ -323,7 +324,7 @@ public void testRawScanWithColumns() throws Exception {
*/
@Test
public void testRawScan() throws Exception {
HTableDescriptor htd = hbu.createTableDescriptor(name.getMethodName(), 0, 3,
HTableDescriptor htd = hbu.createTableDescriptor(TableName.valueOf(name.getMethodName()), 0, 3,
HConstants.FOREVER, KeepDeletedCells.TRUE);
Region region = hbu.createLocalHRegion(htd, null, null);

Expand Down Expand Up @@ -413,7 +414,7 @@ public void testRawScan() throws Exception {
*/
@Test
public void testDeleteMarkerExpirationEmptyStore() throws Exception {
HTableDescriptor htd = hbu.createTableDescriptor(name.getMethodName(), 0, 1,
HTableDescriptor htd = hbu.createTableDescriptor(TableName.valueOf(name.getMethodName()), 0, 1,
HConstants.FOREVER, KeepDeletedCells.TRUE);
HRegion region = hbu.createLocalHRegion(htd, null, null);

Expand Down Expand Up @@ -456,7 +457,7 @@ public void testDeleteMarkerExpirationEmptyStore() throws Exception {
*/
@Test
public void testDeleteMarkerExpiration() throws Exception {
HTableDescriptor htd = hbu.createTableDescriptor(name.getMethodName(), 0, 1,
HTableDescriptor htd = hbu.createTableDescriptor(TableName.valueOf(name.getMethodName()), 0, 1,
HConstants.FOREVER, KeepDeletedCells.TRUE);
HRegion region = hbu.createLocalHRegion(htd, null, null);

Expand Down Expand Up @@ -519,7 +520,7 @@ public void testDeleteMarkerExpiration() throws Exception {
*/
@Test
public void testWithOldRow() throws Exception {
HTableDescriptor htd = hbu.createTableDescriptor(name.getMethodName(), 0, 1,
HTableDescriptor htd = hbu.createTableDescriptor(TableName.valueOf(name.getMethodName()), 0, 1,
HConstants.FOREVER, KeepDeletedCells.TRUE);
HRegion region = hbu.createLocalHRegion(htd, null, null);

Expand Down Expand Up @@ -597,7 +598,7 @@ public void testWithOldRow() throws Exception {
*/
@Test
public void testRanges() throws Exception {
HTableDescriptor htd = hbu.createTableDescriptor(name.getMethodName(), 0, 3,
HTableDescriptor htd = hbu.createTableDescriptor(TableName.valueOf(name.getMethodName()), 0, 3,
HConstants.FOREVER, KeepDeletedCells.TRUE);
Region region = hbu.createLocalHRegion(htd, null, null);

Expand Down Expand Up @@ -679,7 +680,7 @@ public void testRanges() throws Exception {
*/
@Test
public void testDeleteMarkerVersioning() throws Exception {
HTableDescriptor htd = hbu.createTableDescriptor(name.getMethodName(), 0, 1,
HTableDescriptor htd = hbu.createTableDescriptor(TableName.valueOf(name.getMethodName()), 0, 1,
HConstants.FOREVER, KeepDeletedCells.TRUE);
HRegion region = hbu.createLocalHRegion(htd, null, null);

Expand Down Expand Up @@ -772,7 +773,7 @@ public void testDeleteMarkerVersioning() throws Exception {
*/
@Test
public void testWithMixedCFs() throws Exception {
HTableDescriptor htd = hbu.createTableDescriptor(name.getMethodName(), 0, 1,
HTableDescriptor htd = hbu.createTableDescriptor(TableName.valueOf(name.getMethodName()), 0, 1,
HConstants.FOREVER, KeepDeletedCells.TRUE);
Region region = hbu.createLocalHRegion(htd, null, null);

Expand Down Expand Up @@ -824,8 +825,8 @@ public void testWithMixedCFs() throws Exception {
*/
@Test
public void testWithMinVersions() throws Exception {
HTableDescriptor htd =
hbu.createTableDescriptor(name.getMethodName(), 3, 1000, 1, KeepDeletedCells.TRUE);
HTableDescriptor htd = hbu.createTableDescriptor(TableName.valueOf(name.getMethodName()), 3,
1000, 1, KeepDeletedCells.TRUE);
HRegion region = hbu.createLocalHRegion(htd, null, null);

long ts = EnvironmentEdgeManager.currentTime() - 2000; // 2s in the past
Expand Down Expand Up @@ -903,8 +904,8 @@ public void testWithMinVersions() throws Exception {
*/
@Test
public void testWithTTL() throws Exception {
HTableDescriptor htd =
hbu.createTableDescriptor(name.getMethodName(), 1, 1000, 1, KeepDeletedCells.TTL);
HTableDescriptor htd = hbu.createTableDescriptor(TableName.valueOf(name.getMethodName()), 1,
1000, 1, KeepDeletedCells.TTL);
HRegion region = hbu.createLocalHRegion(htd, null, null);

long ts = EnvironmentEdgeManager.currentTime() - 2000; // 2s in the past
Expand Down

0 comments on commit 12f1c7c

Please sign in to comment.