HBASE-14665 Remove deprecated HBaseTestingUtility#createTable methods

This commit is contained in:
Jonathan M Hsieh 2015-10-21 20:50:54 -07:00
parent 39521068e8
commit 7b73899e95
1 changed files with 0 additions and 279 deletions

View File

@ -1309,19 +1309,6 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
return createTable(tableName, new String[]{family});
}
/**
* Create a table.
* @param tableName
* @param family
* @return An HTable instance for the created table.
* @throws IOException
* @deprecated use {@link #createTable(TableName, byte[])}
*/
@Deprecated
public HTable createTable(byte[] tableName, byte[] family) throws IOException {
return createTable(TableName.valueOf(tableName), new byte[][] { family });
}
/**
* Create a table.
* @param tableName
@ -1368,22 +1355,6 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
return createTable(tableName, new byte[][] { family }, splitKeys);
}
/**
* Create a table.
* @param tableName
* @param families
* @return An HTable instance for the created table.
* @throws IOException
* @deprecated use {@link #createTable(TableName, byte[][])}
*/
@Deprecated
public HTable createTable(byte[] tableName, byte[][] families)
throws IOException {
return createTable(tableName, families,
new Configuration(getConfiguration()));
}
/**
* Create a table.
* @param tableName
@ -1420,20 +1391,6 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
return createTable(tableName, families, splitKeys, new Configuration(getConfiguration()));
}
@Deprecated
public HTable createTable(byte[] tableName, byte[][] families, int numVersions, byte[] startKey,
byte[] endKey, int numRegions) throws IOException {
return createTable(TableName.valueOf(tableName), families, numVersions, startKey, endKey,
numRegions);
}
@Deprecated
public HTable createTable(String tableName, byte[][] families, int numVersions, byte[] startKey,
byte[] endKey, int numRegions) throws IOException {
return createTable(TableName.valueOf(tableName), families, numVersions, startKey, endKey,
numRegions);
}
public HTable createTable(TableName tableName, byte[][] families,
int numVersions, byte[] startKey, byte[] endKey, int numRegions)
throws IOException{
@ -1505,21 +1462,6 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
return (HTable) getConnection().getTable(htd.getTableName());
}
/**
* Create a table.
* @param tableName
* @param families
* @param c Configuration to use
* @return An HTable instance for the created table.
* @throws IOException
* @deprecated use {@link #createTable(TableName, byte[][])}
*/
@Deprecated
public HTable createTable(TableName tableName, byte[][] families, final Configuration c)
throws IOException {
return createTable(tableName, families, (byte[][]) null, c);
}
/**
* Create a table.
* @param tableName
@ -1534,95 +1476,6 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
return createTable(new HTableDescriptor(tableName), families, splitKeys, c);
}
/**
* Create a table.
* @param tableName
* @param families
* @param c Configuration to use
* @return An HTable instance for the created table.
* @throws IOException
* @deprecated use {@link #createTable(TableName, byte[][])}
*/
@Deprecated
public HTable createTable(byte[] tableName, byte[][] families, final Configuration c)
throws IOException {
HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(tableName));
for(byte[] family : families) {
HColumnDescriptor hcd = new HColumnDescriptor(family);
// Disable blooms (they are on by default as of 0.95) but we disable them here because
// tests have hard coded counts of what to expect in block cache, etc., and blooms being
// on is interfering.
hcd.setBloomFilterType(BloomType.NONE);
desc.addFamily(hcd);
}
getHBaseAdmin().createTable(desc);
return (HTable) getConnection().getTable(desc.getTableName());
}
/**
* Create a table.
* @param tableName
* @param families
* @param c Configuration to use
* @param numVersions
* @return An HTable instance for the created table.
* @throws IOException
* @deprecated use {@link #createTable(TableName, byte[][], int)}
*/
@Deprecated
public HTable createTable(TableName tableName, byte[][] families,
final Configuration c, int numVersions)
throws IOException {
HTableDescriptor desc = new HTableDescriptor(tableName);
for(byte[] family : families) {
HColumnDescriptor hcd = new HColumnDescriptor(family)
.setMaxVersions(numVersions);
desc.addFamily(hcd);
}
getHBaseAdmin().createTable(desc);
// HBaseAdmin only waits for regions to appear in hbase:meta we should wait until they are assigned
waitUntilAllRegionsAssigned(tableName);
return (HTable) getConnection().getTable(tableName);
}
/**
* Create a table.
* @param tableName
* @param families
* @param c Configuration to use
* @param numVersions
* @return An HTable instance for the created table.
* @throws IOException
* @deprecated use {@link #createTable(TableName, byte[][], int)}
*/
@Deprecated
public HTable createTable(byte[] tableName, byte[][] families,
final Configuration c, int numVersions)
throws IOException {
HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(tableName));
for (byte[] family : families) {
HColumnDescriptor hcd = new HColumnDescriptor(family).setMaxVersions(numVersions);
desc.addFamily(hcd);
}
getHBaseAdmin().createTable(desc);
return (HTable) getConnection().getTable(desc.getTableName());
}
/**
* Create a table.
* @param tableName
* @param family
* @param numVersions
* @return An HTable instance for the created table.
* @throws IOException
* @deprecated use {@link #createTable(TableName, byte[], int)}
*/
@Deprecated
public HTable createTable(byte[] tableName, byte[] family, int numVersions)
throws IOException {
return createTable(tableName, new byte[][]{family}, numVersions);
}
/**
* Create a table.
* @param tableName
@ -1636,21 +1489,6 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
return createTable(tableName, new byte[][]{family}, numVersions);
}
/**
* Create a table.
* @param tableName
* @param families
* @param numVersions
* @return An HTable instance for the created table.
* @throws IOException
* @deprecated use {@link #createTable(TableName, byte[][], int)}
*/
@Deprecated
public HTable createTable(byte[] tableName, byte[][] families, int numVersions)
throws IOException {
return createTable(TableName.valueOf(tableName), families, numVersions);
}
/**
* Create a table.
* @param tableName
@ -1699,23 +1537,6 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
return createTable(tableName, families, numVersions, KEYS_FOR_HBA_CREATE_TABLE);
}
/**
* Create a table.
* @param tableName
* @param families
* @param numVersions
* @param blockSize
* @return An HTable instance for the created table.
* @throws IOException
* @deprecated use {@link #createTable(TableName, byte[][], int, int)}
*/
@Deprecated
public HTable createTable(byte[] tableName, byte[][] families,
int numVersions, int blockSize) throws IOException {
return createTable(TableName.valueOf(tableName),
families, numVersions, blockSize);
}
/**
* Create a table.
* @param tableName
@ -1758,22 +1579,6 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
return (HTable) getConnection().getTable(tableName);
}
/**
* Create a table.
* @param tableName
* @param families
* @param numVersions
* @return An HTable instance for the created table.
* @throws IOException
* @deprecated use {@link #createTable(TableName, byte[][], int)}
*/
@Deprecated
public HTable createTable(byte[] tableName, byte[][] families,
int[] numVersions)
throws IOException {
return createTable(TableName.valueOf(tableName), families, numVersions);
}
/**
* Create a table.
* @param tableName
@ -1799,21 +1604,6 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
return (HTable) getConnection().getTable(tableName);
}
/**
* Create a table.
* @param tableName
* @param family
* @param splitRows
* @return An HTable instance for the created table.
* @throws IOException
* @deprecated use {@link #createTable(TableName, byte[], byte[][])}
*/
@Deprecated
public HTable createTable(byte[] tableName, byte[] family, byte[][] splitRows)
throws IOException{
return createTable(TableName.valueOf(tableName), family, splitRows);
}
/**
* Create a table.
* @param tableName
@ -1844,29 +1634,6 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
return createTable(tableName, family, KEYS_FOR_HBA_CREATE_TABLE);
}
/**
* Create a table.
* @param tableName
* @param families
* @param splitRows
* @return An HTable instance for the created table.
* @throws IOException
* @deprecated use {@link #createTable(TableName, byte[][], byte[][])}
*/
@Deprecated
public HTable createTable(byte[] tableName, byte[][] families, byte[][] splitRows)
throws IOException {
HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(tableName));
for(byte[] family:families) {
HColumnDescriptor hcd = new HColumnDescriptor(family);
desc.addFamily(hcd);
}
getHBaseAdmin().createTable(desc, splitRows);
// HBaseAdmin only waits for regions to appear in hbase:meta we should wait until they are assigned
waitUntilAllRegionsAssigned(desc.getTableName());
return (HTable) getConnection().getTable(desc.getTableName());
}
/**
* Modify a table, synchronous. Waiting logic similar to that of {@code admin.rb#alter_status}.
*/
@ -2158,37 +1925,6 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
return truncateTable(tableName, false);
}
/**
* Truncate a table using the admin command.
* Effectively disables, deletes, and recreates the table.
*
* @param tableName table which must exist.
* @param preserveRegions keep the existing split points
* @return HTable for the new table
* @deprecated use {@link #truncateTable(TableName, boolean)}
*/
@Deprecated
public HTable truncateTable(final byte[] tableName, final boolean preserveRegions)
throws IOException {
return truncateTable(TableName.valueOf(tableName), preserveRegions);
}
/**
* Truncate a table using the admin command.
* Effectively disables, deletes, and recreates the table.
* For previous behavior of issuing row deletes, see
* deleteTableData.
* Expressly does not preserve regions of existing table.
*
* @param tableName table which must exist.
* @return HTable for the new table
* @deprecated use {@link #truncateTable(TableName)}
*/
@Deprecated
public HTable truncateTable(final byte[] tableName) throws IOException {
return truncateTable(TableName.valueOf(tableName), false);
}
/**
* Load table with rows from 'aaa' to 'zzz'.
* @param t Table
@ -2881,12 +2617,6 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
expireSession(nodeZK, false);
}
@Deprecated
public void expireSession(ZooKeeperWatcher nodeZK, Server server)
throws Exception {
expireSession(nodeZK, false);
}
/**
* Expire a ZooKeeper session as recommended in ZooKeeper documentation
* http://wiki.apache.org/hadoop/ZooKeeper/FAQ#A4
@ -3657,15 +3387,6 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
HConstants.DEFAULT_ZOOKEEPER_ZNODE_PARENT);
}
@Deprecated
public HTable createRandomTable(String tableName, final Collection<String> families,
final int maxVersions, final int numColsPerRow, final int numFlushes, final int numRegions,
final int numRowsPerFlush) throws IOException, InterruptedException {
return (HTable) this
.createRandomTable(TableName.valueOf(tableName), families, maxVersions, numColsPerRow,
numFlushes, numRegions, numRowsPerFlush);
}
/** Creates a random table with the given parameters */
public Table createRandomTable(TableName tableName,
final Collection<String> families,