HBASE-23776 Removed deprecated method createLocalHTU() from HBaseTestingUtility

Signed-off-by: stack <stack@apache.org>
This commit is contained in:
Jan Hentschel 2020-02-02 00:28:25 +01:00 committed by GitHub
parent 9b6d25066d
commit 5a3ad6f08f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
33 changed files with 32 additions and 54 deletions

View File

@ -302,11 +302,6 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility {
* <p>Initially, all tmp files are written to a local test data directory.
* Once {@link #startMiniDFSCluster} is called, either directly or via
* {@link #startMiniCluster()}, tmp data will be written to the DFS directory instead.
*
* <p>Previously, there was a distinction between the type of utility returned by
* {@link #createLocalHTU()} and this constructor; this is no longer the case. All
* HBaseTestingUtility objects will behave as local until a DFS cluster is started,
* at which point they will switch to using mini DFS for storage.
*/
public HBaseTestingUtility() {
this(HBaseConfiguration.create());
@ -319,11 +314,6 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility {
* Once {@link #startMiniDFSCluster} is called, either directly or via
* {@link #startMiniCluster()}, tmp data will be written to the DFS directory instead.
*
* <p>Previously, there was a distinction between the type of utility returned by
* {@link #createLocalHTU()} and this constructor; this is no longer the case. All
* HBaseTestingUtility objects will behave as local until a DFS cluster is started,
* at which point they will switch to using mini DFS for storage.
*
* @param conf The configuration to use for further operations
*/
public HBaseTestingUtility(@Nullable Configuration conf) {
@ -352,18 +342,6 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility {
this.conf.getBoolean(LocalHBaseCluster.ASSIGN_RANDOM_PORTS, true));
}
/**
* @deprecated since 2.0.0 and will be removed in 3.0.0. Use {@link #HBaseTestingUtility()}
* instead.
* @return a normal HBaseTestingUtility
* @see #HBaseTestingUtility()
* @see <a href="https://issues.apache.org/jira/browse/HBASE-19841">HBASE-19841</a>
*/
@Deprecated
public static HBaseTestingUtility createLocalHTU() {
return new HBaseTestingUtility();
}
/**
* @deprecated since 2.0.0 and will be removed in 3.0.0. Use
* {@link #HBaseTestingUtility(Configuration)} instead.

View File

@ -82,7 +82,7 @@ public class TestCoprocessorInterface {
@Rule public TestName name = new TestName();
private static final Logger LOG = LoggerFactory.getLogger(TestCoprocessorInterface.class);
private static final HBaseTestingUtility TEST_UTIL = HBaseTestingUtility.createLocalHTU();
private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
static final Path DIR = TEST_UTIL.getDataTestDir();
private static class CustomScanner implements RegionScanner {

View File

@ -49,7 +49,7 @@ public class TestCoreMasterCoprocessor {
HBaseClassTestRule.forClass(TestCoreMasterCoprocessor.class);
@Rule public TestName name = new TestName();
private static final HBaseTestingUtility HTU = HBaseTestingUtility.createLocalHTU();
private static final HBaseTestingUtility HTU = new HBaseTestingUtility();
private MasterServices ms;
private MasterCoprocessorHost mch;

View File

@ -58,7 +58,7 @@ public class TestCoreRegionCoprocessor {
HBaseClassTestRule.forClass(TestCoreRegionCoprocessor.class);
@Rule public TestName name = new TestName();
HBaseTestingUtility HTU = HBaseTestingUtility.createLocalHTU();
HBaseTestingUtility HTU = new HBaseTestingUtility();
private HRegion region = null;
private RegionServerServices rss;

View File

@ -49,7 +49,7 @@ public class TestCoreRegionServerCoprocessor {
HBaseClassTestRule.forClass(TestCoreRegionServerCoprocessor.class);
@Rule public TestName name = new TestName();
private static final HBaseTestingUtility HTU = HBaseTestingUtility.createLocalHTU();
private static final HBaseTestingUtility HTU = new HBaseTestingUtility();
private RegionServerServices rss;
private RegionServerCoprocessorHost rsch;

View File

@ -79,7 +79,7 @@ public class TestEncodedSeekers {
private static final int NUM_HFILES = 4;
private static final int NUM_ROWS_PER_FLUSH = NUM_ROWS / NUM_HFILES;
private final HBaseTestingUtility testUtil = HBaseTestingUtility.createLocalHTU();
private final HBaseTestingUtility testUtil = new HBaseTestingUtility();
private final DataBlockEncoding encoding;
private final boolean includeTags;
private final boolean compressTags;

View File

@ -90,7 +90,7 @@ public class TestCacheOnWrite {
private static final Logger LOG = LoggerFactory.getLogger(TestCacheOnWrite.class);
private static final HBaseTestingUtility TEST_UTIL = HBaseTestingUtility.createLocalHTU();
private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
private Configuration conf;
private CacheConfig cacheConf;
private FileSystem fs;

View File

@ -61,7 +61,7 @@ public class TestForceCacheImportantBlocks {
public static final HBaseClassTestRule CLASS_RULE =
HBaseClassTestRule.forClass(TestForceCacheImportantBlocks.class);
private final HBaseTestingUtility TEST_UTIL = HBaseTestingUtility.createLocalHTU();
private final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
private static final String TABLE = "myTable";
private static final String CF = "myCF";

View File

@ -77,7 +77,7 @@ public class TestScannerFromBucketCache {
private TableName tableName;
private void setUp(boolean useBucketCache) throws IOException {
test_util = HBaseTestingUtility.createLocalHTU();
test_util = new HBaseTestingUtility();
conf = test_util.getConfiguration();
if (useBucketCache) {
conf.setInt("hbase.bucketcache.size", 400);

View File

@ -61,7 +61,7 @@ public class TestScannerSelectionUsingKeyRange {
public static final HBaseClassTestRule CLASS_RULE =
HBaseClassTestRule.forClass(TestScannerSelectionUsingKeyRange.class);
private static final HBaseTestingUtility TEST_UTIL = HBaseTestingUtility.createLocalHTU();
private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
private static TableName TABLE = TableName.valueOf("myTable");
private static String FAMILY = "myCF";
private static byte[] FAMILY_BYTES = Bytes.toBytes(FAMILY);

View File

@ -68,7 +68,7 @@ public class TestScannerSelectionUsingTTL {
private static final Logger LOG =
LoggerFactory.getLogger(TestScannerSelectionUsingTTL.class);
private static final HBaseTestingUtility TEST_UTIL = HBaseTestingUtility.createLocalHTU();
private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
private static TableName TABLE = TableName.valueOf("myTable");
private static String FAMILY = "myCF";
private static byte[] FAMILY_BYTES = Bytes.toBytes(FAMILY);

View File

@ -58,7 +58,7 @@ public class TestHMasterRPCException {
private static final Logger LOG = LoggerFactory.getLogger(TestHMasterRPCException.class);
private final HBaseTestingUtility testUtil = HBaseTestingUtility.createLocalHTU();
private final HBaseTestingUtility testUtil = new HBaseTestingUtility();
private HMaster master;

View File

@ -84,7 +84,7 @@ public class TestMobFileCache {
@Before
public void setUp() throws Exception {
UTIL = HBaseTestingUtility.createLocalHTU();
UTIL = new HBaseTestingUtility();
conf = UTIL.getConfiguration();
conf.set(MobConstants.MOB_FILE_CACHE_SIZE_KEY, TEST_CACHE_SIZE);
TableDescriptorBuilder tableDescriptorBuilder =

View File

@ -98,7 +98,7 @@ public class TestAtomicOperation {
@Rule public TestName name = new TestName();
HRegion region = null;
private HBaseTestingUtility TEST_UTIL = HBaseTestingUtility.createLocalHTU();
private HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
// Test names
static byte[] tableName;

View File

@ -82,7 +82,7 @@ public class TestCacheOnWriteInSchema {
private static final Logger LOG = LoggerFactory.getLogger(TestCacheOnWriteInSchema.class);
@Rule public TestName name = new TestName();
private static final HBaseTestingUtility TEST_UTIL = HBaseTestingUtility.createLocalHTU();
private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
private static final String DIR = TEST_UTIL.getDataTestDir("TestCacheOnWriteInSchema").toString();
private static byte [] table;
private static byte [] family = Bytes.toBytes("family");

View File

@ -61,7 +61,7 @@ public class TestColumnSeeking {
HBaseClassTestRule.forClass(TestColumnSeeking.class);
@Rule public TestName name = new TestName();
private final static HBaseTestingUtility TEST_UTIL = HBaseTestingUtility.createLocalHTU();
private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
private static final Logger LOG = LoggerFactory.getLogger(TestColumnSeeking.class);

View File

@ -92,7 +92,7 @@ public class TestCompaction {
HBaseClassTestRule.forClass(TestCompaction.class);
@Rule public TestName name = new TestName();
private static final HBaseTestingUtility UTIL = HBaseTestingUtility.createLocalHTU();
private static final HBaseTestingUtility UTIL = new HBaseTestingUtility();
protected Configuration conf = UTIL.getConfiguration();
private HRegion r = null;

View File

@ -76,7 +76,7 @@ public class TestCompactionArchiveConcurrentClose {
@Before
public void setup() throws Exception {
testUtil = HBaseTestingUtility.createLocalHTU();
testUtil = new HBaseTestingUtility();
testDir = testUtil.getDataTestDir("TestStoreFileRefresherChore");
FSUtils.setRootDir(testUtil.getConfiguration(), testDir);
}

View File

@ -82,7 +82,7 @@ public class TestFailedAppendAndSync {
@Before
public void setup() throws IOException {
TEST_UTIL = HBaseTestingUtility.createLocalHTU();
TEST_UTIL = new HBaseTestingUtility();
CONF = TEST_UTIL.getConfiguration();
// Disable block cache.
CONF.setFloat(HConstants.HFILE_BLOCK_CACHE_SIZE_KEY, 0f);

View File

@ -246,7 +246,7 @@ public class TestHRegion {
@Before
public void setup() throws IOException {
TEST_UTIL = HBaseTestingUtility.createLocalHTU();
TEST_UTIL = new HBaseTestingUtility();
CONF = TEST_UTIL.getConfiguration();
NettyAsyncFSWALConfigHelper.setEventLoopConfig(CONF, GROUP, NioSocketChannel.class);
dir = TEST_UTIL.getDataTestDir("TestHRegion").toString();

View File

@ -61,7 +61,7 @@ public class TestKeepDeletes {
public static final HBaseClassTestRule CLASS_RULE =
HBaseClassTestRule.forClass(TestKeepDeletes.class);
HBaseTestingUtility hbu = HBaseTestingUtility.createLocalHTU();
HBaseTestingUtility hbu = new HBaseTestingUtility();
private final byte[] T0 = Bytes.toBytes("0");
private final byte[] T1 = Bytes.toBytes("1");
private final byte[] T2 = Bytes.toBytes("2");

View File

@ -88,7 +88,7 @@ public class TestMajorCompaction {
}
@Rule public TestName name;
private static final Logger LOG = LoggerFactory.getLogger(TestMajorCompaction.class.getName());
private static final HBaseTestingUtility UTIL = HBaseTestingUtility.createLocalHTU();
private static final HBaseTestingUtility UTIL = new HBaseTestingUtility();
protected Configuration conf = UTIL.getConfiguration();
private HRegion r = null;

View File

@ -59,7 +59,7 @@ public class TestMinorCompaction {
@Rule public TestName name = new TestName();
private static final Logger LOG = LoggerFactory.getLogger(TestMinorCompaction.class.getName());
private static final HBaseTestingUtility UTIL = HBaseTestingUtility.createLocalHTU();
private static final HBaseTestingUtility UTIL = new HBaseTestingUtility();
protected Configuration conf = UTIL.getConfiguration();
private HRegion r = null;

View File

@ -104,7 +104,7 @@ public abstract class TestMultiColumnScanner {
/** The probability to delete a row/column pair */
private static final double DELETE_PROBABILITY = 0.02;
private final static HBaseTestingUtility TEST_UTIL = HBaseTestingUtility.createLocalHTU();
private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
@Parameter(0)
public Compression.Algorithm comprAlgo;

View File

@ -65,7 +65,7 @@ public class TestMultiLogThreshold {
@BeforeClass
public static void setup() throws Exception {
final TableName tableName = TableName.valueOf("tableName");
TEST_UTIL = HBaseTestingUtility.createLocalHTU();
TEST_UTIL = new HBaseTestingUtility();
CONF = TEST_UTIL.getConfiguration();
THRESHOLD = CONF.getInt(RSRpcServices.BATCH_ROWS_THRESHOLD_NAME,
RSRpcServices.BATCH_ROWS_THRESHOLD_DEFAULT);

View File

@ -72,7 +72,7 @@ public class TestRegionIncrement {
@Before
public void setUp() throws Exception {
TEST_UTIL = HBaseTestingUtility.createLocalHTU();
TEST_UTIL = new HBaseTestingUtility();
}
@After

View File

@ -49,7 +49,7 @@ public class TestRowTooBig {
public static final HBaseClassTestRule CLASS_RULE =
HBaseClassTestRule.forClass(TestRowTooBig.class);
private final static HBaseTestingUtility HTU = HBaseTestingUtility.createLocalHTU();
private final static HBaseTestingUtility HTU = new HBaseTestingUtility();
private static Path rootRegionDir;
private static final HTableDescriptor TEST_HTD =
new HTableDescriptor(TableName.valueOf(TestRowTooBig.class.getSimpleName()));

View File

@ -86,7 +86,7 @@ public class TestScanWithBloomError {
private FileSystem fs;
private Configuration conf;
private final static HBaseTestingUtility TEST_UTIL = HBaseTestingUtility.createLocalHTU();
private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
@Parameters
public static final Collection<Object[]> parameters() {

View File

@ -75,7 +75,7 @@ public class TestScanner {
@Rule public TestName name = new TestName();
private static final Logger LOG = LoggerFactory.getLogger(TestScanner.class);
private final static HBaseTestingUtility TEST_UTIL = HBaseTestingUtility.createLocalHTU();
private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
private static final byte [] FIRST_ROW = HConstants.EMPTY_START_ROW;
private static final byte [][] COLS = { HConstants.CATALOG_FAMILY };

View File

@ -59,7 +59,7 @@ public class TestScannerWithCorruptHFile {
@Rule public TestName name = new TestName();
private static final byte[] FAMILY_NAME = Bytes.toBytes("f");
private final static HBaseTestingUtility TEST_UTIL = HBaseTestingUtility.createLocalHTU();
private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
@BeforeClass

View File

@ -127,7 +127,7 @@ public class TestSeekOptimizations {
private long totalSeekDiligent, totalSeekLazy;
private final static HBaseTestingUtility TEST_UTIL = HBaseTestingUtility.createLocalHTU();
private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
@Parameters
public static final Collection<Object[]> parameters() {

View File

@ -45,7 +45,7 @@ public class TestTimestampFilterSeekHint {
public static final HBaseClassTestRule CLASS_RULE =
HBaseClassTestRule.forClass(TestTimestampFilterSeekHint.class);
private final static HBaseTestingUtility TEST_UTIL = HBaseTestingUtility.createLocalHTU();
private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
private final static String RK = "myRK";
private final static byte[] RK_BYTES = Bytes.toBytes(RK);

View File

@ -71,7 +71,7 @@ public class TestSnapshotManifest {
@Before
public void setup() throws Exception {
TEST_UTIL = HBaseTestingUtility.createLocalHTU();
TEST_UTIL = new HBaseTestingUtility();
rootDir = TEST_UTIL.getDataTestDir(TABLE_NAME_STR);
fs = TEST_UTIL.getTestFileSystem();