HBASE-15375 Do not write to '/tmp' in TestRegionMover
This commit is contained in:
parent
edc5ab5af9
commit
5e395c4294
|
@ -21,6 +21,7 @@ package org.apache.hadoop.hbase.util;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
|
@ -174,7 +175,8 @@ public class TestRegionMover {
|
||||||
@Test
|
@Test
|
||||||
public void testExclude() throws Exception {
|
public void testExclude() throws Exception {
|
||||||
MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster();
|
MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster();
|
||||||
FileWriter fos = new FileWriter("/tmp/exclude_file");
|
File excludeFile = new File(TEST_UTIL.getDataTestDir().toUri().getPath(), "exclude_file");
|
||||||
|
FileWriter fos = new FileWriter(excludeFile);
|
||||||
HRegionServer excludeServer = cluster.getRegionServer(1);
|
HRegionServer excludeServer = cluster.getRegionServer(1);
|
||||||
String excludeHostname = excludeServer.getServerName().getHostname();
|
String excludeHostname = excludeServer.getServerName().getHostname();
|
||||||
int excludeServerPort = excludeServer.getServerName().getPort();
|
int excludeServerPort = excludeServer.getServerName().getPort();
|
||||||
|
@ -187,7 +189,7 @@ public class TestRegionMover {
|
||||||
int port = regionServer.getServerName().getPort();
|
int port = regionServer.getServerName().getPort();
|
||||||
String rs = rsName + ":" + Integer.toString(port);
|
String rs = rsName + ":" + Integer.toString(port);
|
||||||
RegionMoverBuilder rmBuilder =
|
RegionMoverBuilder rmBuilder =
|
||||||
new RegionMoverBuilder(rs).ack(true).excludeFile("/tmp/exclude_file");
|
new RegionMoverBuilder(rs).ack(true).excludeFile(excludeFile.getCanonicalPath());
|
||||||
RegionMover rm = rmBuilder.build();
|
RegionMover rm = rmBuilder.build();
|
||||||
rm.setConf(TEST_UTIL.getConfiguration());
|
rm.setConf(TEST_UTIL.getConfiguration());
|
||||||
rm.unload();
|
rm.unload();
|
||||||
|
|
Loading…
Reference in New Issue