Skip to content

Commit

Permalink
checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
abstractdog committed Apr 2, 2024
1 parent 5649494 commit 8b5a97c
Showing 1 changed file with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,16 @@ public class TestMRInputHelpers {
private static Path oldSplitsDir;
private static Path newSplitsDir;


private static Path TEST_ROOT_DIR;
private static Path LOCAL_TEST_ROOT_DIR;
private static Path testRootDir;
private static Path localTestRootDir;

@BeforeClass
public static void setup() throws IOException {
TEST_ROOT_DIR = new Path(Files.createTempDirectory(TestMRHelpers.class.getName()).toString());
LOCAL_TEST_ROOT_DIR = new Path(Files.createTempDirectory(TestMRHelpers.class.getName() + "-local").toString());
testRootDir = new Path(Files.createTempDirectory(TestMRHelpers.class.getName()).toString());
localTestRootDir = new Path(Files.createTempDirectory(TestMRHelpers.class.getName() + "-local").toString());

try {
conf.set(MiniDFSCluster.HDFS_MINIDFS_BASEDIR, TEST_ROOT_DIR.toString());
conf.set(MiniDFSCluster.HDFS_MINIDFS_BASEDIR, testRootDir.toString());
dfsCluster = new MiniDFSCluster.Builder(conf).numDataNodes(2)
.format(true).racks(null).build();
remoteFs = dfsCluster.getFileSystem();
Expand Down Expand Up @@ -219,7 +218,7 @@ public void testInputEventSerializedPath() throws IOException {
MRSplitProto proto = MRSplitProto.newBuilder().setSplitBytes(ByteString.copyFrom("splits".getBytes())).build();

FileSystem localFs = FileSystem.getLocal(conf);
Path splitsDir = localFs.resolvePath(LOCAL_TEST_ROOT_DIR);
Path splitsDir = localFs.resolvePath(localTestRootDir);

Path serializedPath = new Path(splitsDir + Path.SEPARATOR + "splitpayload");

Expand Down Expand Up @@ -284,7 +283,7 @@ private DataSourceDescriptor generateDataSourceDescriptorMapRed(Path inputSplits
@Test(timeout = 5000)
public void testInputSplitLocalResourceCreationWithDifferentFS() throws Exception {
FileSystem localFs = FileSystem.getLocal(conf);
Path splitsDir = localFs.resolvePath(LOCAL_TEST_ROOT_DIR);
Path splitsDir = localFs.resolvePath(localTestRootDir);

DataSourceDescriptor dataSource = generateDataSourceDescriptorMapRed(splitsDir);

Expand All @@ -303,11 +302,11 @@ public void testInputSplitLocalResourceCreationWithDifferentFS() throws Exceptio

@Before
public void before() throws IOException {
localFs.mkdirs(LOCAL_TEST_ROOT_DIR);
localFs.mkdirs(localTestRootDir);
}

@After
public void after() throws IOException {
localFs.delete(LOCAL_TEST_ROOT_DIR, true);
localFs.delete(localTestRootDir, true);
}
}

0 comments on commit 8b5a97c

Please sign in to comment.