HBASE-17464 Fix getNewDataTestDirOnTestFS to always return a unique path
Signed-off-by: Michael Stack <stack@apache.org>
This commit is contained in:
parent
cdee1a7034
commit
9fd5dab1a8
|
@ -564,13 +564,13 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
|
|||
//the working directory, and create a unique sub dir there
|
||||
FileSystem fs = getTestFileSystem();
|
||||
Path newDataTestDir;
|
||||
String randomStr = UUID.randomUUID().toString();
|
||||
if (fs.getUri().getScheme().equals(FileSystem.getLocal(conf).getUri().getScheme())) {
|
||||
File dataTestDir = new File(getDataTestDir().toString());
|
||||
newDataTestDir = new Path(getDataTestDir(), randomStr);
|
||||
File dataTestDir = new File(newDataTestDir.toString());
|
||||
if (deleteOnExit()) dataTestDir.deleteOnExit();
|
||||
newDataTestDir = new Path(dataTestDir.getAbsolutePath());
|
||||
} else {
|
||||
Path base = getBaseTestDirOnTestFS();
|
||||
String randomStr = UUID.randomUUID().toString();
|
||||
newDataTestDir = new Path(base, randomStr);
|
||||
if (deleteOnExit()) fs.deleteOnExit(newDataTestDir);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue