|
@@ -519,17 +519,20 @@ public class TestDFSClientRetries extends TestCase {
|
|
|
LOG.info("Test 4 succeeded! Time spent: " + (timestamp2-timestamp)/1000.0 + " sec.");
|
|
|
}
|
|
|
|
|
|
- private boolean busyTest(int xcievers, int threads, int fileLen, int timeWin, int retries)
|
|
|
+ private boolean busyTest(int xcievers, int threads, int fileLen, int timeWin, int retries)
|
|
|
throws IOException {
|
|
|
|
|
|
boolean ret = true;
|
|
|
short replicationFactor = 1;
|
|
|
long blockSize = 128*1024*1024; // DFS block size
|
|
|
int bufferSize = 4096;
|
|
|
- int originalXcievers = conf.getInt(DFSConfigKeys.DFS_DATANODE_MAX_RECEIVER_THREADS_KEY,0);
|
|
|
- conf.setInt(DFSConfigKeys.DFS_DATANODE_MAX_RECEIVER_THREADS_KEY, xcievers);
|
|
|
- conf.setInt(DFSConfigKeys.DFS_CLIENT_MAX_BLOCK_ACQUIRE_FAILURES_KEY,
|
|
|
- retries);
|
|
|
+ int originalXcievers = conf.getInt(
|
|
|
+ DFSConfigKeys.DFS_DATANODE_MAX_RECEIVER_THREADS_KEY,
|
|
|
+ DFSConfigKeys.DFS_DATANODE_MAX_RECEIVER_THREADS_DEFAULT);
|
|
|
+ conf.setInt(DFSConfigKeys.DFS_DATANODE_MAX_RECEIVER_THREADS_KEY,
|
|
|
+ xcievers);
|
|
|
+ conf.setInt(DFSConfigKeys.DFS_CLIENT_MAX_BLOCK_ACQUIRE_FAILURES_KEY,
|
|
|
+ retries);
|
|
|
conf.setInt(DFSConfigKeys.DFS_CLIENT_RETRY_WINDOW_BASE, timeWin);
|
|
|
// Disable keepalive
|
|
|
conf.setInt(DFSConfigKeys.DFS_DATANODE_SOCKET_REUSE_KEEPALIVE_KEY, 0);
|
|
@@ -605,7 +608,8 @@ public class TestDFSClientRetries extends TestCase {
|
|
|
e.printStackTrace();
|
|
|
ret = false;
|
|
|
} finally {
|
|
|
- conf.setInt(DFSConfigKeys.DFS_DATANODE_MAX_RECEIVER_THREADS_KEY,originalXcievers);
|
|
|
+ conf.setInt(DFSConfigKeys.DFS_DATANODE_MAX_RECEIVER_THREADS_KEY,
|
|
|
+ originalXcievers);
|
|
|
fs.delete(file1, false);
|
|
|
cluster.shutdown();
|
|
|
}
|