hadoop git commit: HDFS-7835. make initial sleeptime in locateFollowingBlock configurable for DFSClient. Contributed by Zhihai Xu.

2015-03-20 Thread yjzhangal
Repository: hadoop
Updated Branches:
  refs/heads/trunk 43dde502b - 15612313f


HDFS-7835. make initial sleeptime in locateFollowingBlock configurable for 
DFSClient. Contributed by Zhihai Xu.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/15612313
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/15612313
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/15612313

Branch: refs/heads/trunk
Commit: 15612313f578a5115f8d03885e9b0c8c376ed56e
Parents: 43dde50
Author: Yongjun Zhang yzh...@cloudera.com
Authored: Fri Mar 20 08:59:44 2015 -0700
Committer: Yongjun Zhang yzh...@cloudera.com
Committed: Fri Mar 20 09:12:42 2015 -0700

--
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt |  3 +++
 .../java/org/apache/hadoop/hdfs/DFSClient.java  | 11 ++
 .../org/apache/hadoop/hdfs/DFSConfigKeys.java   |  3 +++
 .../org/apache/hadoop/hdfs/DFSOutputStream.java | 10 +
 .../src/main/resources/hdfs-default.xml |  7 +++
 .../hadoop/hdfs/TestDFSClientRetries.java   | 22 
 6 files changed, 52 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hadoop/blob/15612313/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
--
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt 
b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index d6fc88b..52fbeff 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -323,6 +323,9 @@ Release 2.8.0 - UNRELEASED
 
 HDFS-2360. Ugly stacktrace when quota exceeds. (harsh)
 
+HDFS-7835. make initial sleeptime in locateFollowingBlock configurable for
+DFSClient. (Zhihai Xu via Yongjun Zhang)
+
   OPTIMIZATIONS
 
   BUG FIXES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/15612313/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
index 3c8fd31..3236771 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
@@ -24,6 +24,8 @@ import static 
org.apache.hadoop.hdfs.DFSConfigKeys.DFS_BYTES_PER_CHECKSUM_DEFAUL
 import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_BYTES_PER_CHECKSUM_KEY;
 import static 
org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_BLOCK_WRITE_LOCATEFOLLOWINGBLOCK_RETRIES_DEFAULT;
 import static 
org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_BLOCK_WRITE_LOCATEFOLLOWINGBLOCK_RETRIES_KEY;
+import static 
org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_BLOCK_WRITE_LOCATEFOLLOWINGBLOCK_INITIAL_DELAY_DEFAULT;
+import static 
org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_BLOCK_WRITE_LOCATEFOLLOWINGBLOCK_INITIAL_DELAY_KEY;
 import static 
org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_BLOCK_WRITE_RETRIES_DEFAULT;
 import static 
org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_BLOCK_WRITE_RETRIES_KEY;
 import static 
org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_CACHED_CONN_RETRY_DEFAULT;
@@ -305,6 +307,7 @@ public class DFSClient implements java.io.Closeable, 
RemotePeerFactory,
 final int nCachedConnRetry;
 final int nBlockWriteRetry;
 final int nBlockWriteLocateFollowingRetry;
+final int blockWriteLocateFollowingInitialDelayMs;
 final long defaultBlockSize;
 final long prefetchSize;
 final short defaultReplication;
@@ -416,6 +419,9 @@ public class DFSClient implements java.io.Closeable, 
RemotePeerFactory,
   nBlockWriteLocateFollowingRetry = conf.getInt(
   DFS_CLIENT_BLOCK_WRITE_LOCATEFOLLOWINGBLOCK_RETRIES_KEY,
   DFS_CLIENT_BLOCK_WRITE_LOCATEFOLLOWINGBLOCK_RETRIES_DEFAULT);
+  blockWriteLocateFollowingInitialDelayMs = conf.getInt(
+  DFS_CLIENT_BLOCK_WRITE_LOCATEFOLLOWINGBLOCK_INITIAL_DELAY_KEY,
+  DFS_CLIENT_BLOCK_WRITE_LOCATEFOLLOWINGBLOCK_INITIAL_DELAY_DEFAULT);
   uMask = FsPermission.getUMask(conf);
   connectToDnViaHostname = conf.getBoolean(DFS_CLIENT_USE_DN_HOSTNAME,
   DFS_CLIENT_USE_DN_HOSTNAME_DEFAULT);
@@ -566,6 +572,11 @@ public class DFSClient implements java.io.Closeable, 
RemotePeerFactory,
   }
   return dataChecksum;
 }
+
+@VisibleForTesting
+public int getBlockWriteLocateFollowingInitialDelayMs() {
+  return blockWriteLocateFollowingInitialDelayMs;
+}
   }
  
   public Conf getConf() {


hadoop git commit: HDFS-7835. make initial sleeptime in locateFollowingBlock configurable for DFSClient. Contributed by Zhihai Xu.

2015-03-20 Thread yjzhangal
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 ed7f847c9 - 0a41b1bdc


HDFS-7835. make initial sleeptime in locateFollowingBlock configurable for 
DFSClient. Contributed by Zhihai Xu.

(cherry-picked from commit 15612313f578a5115f8d03885e9b0c8c376ed56e)

Conflicts:

hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSClientRetries.java


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/0a41b1bd
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/0a41b1bd
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/0a41b1bd

Branch: refs/heads/branch-2
Commit: 0a41b1bdcadbdfc427348799f89d122a152d41fe
Parents: ed7f847
Author: Yongjun Zhang yzh...@cloudera.com
Authored: Fri Mar 20 08:59:44 2015 -0700
Committer: Yongjun Zhang yzh...@cloudera.com
Committed: Fri Mar 20 09:25:59 2015 -0700

--
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt |  3 +++
 .../java/org/apache/hadoop/hdfs/DFSClient.java  | 11 ++
 .../org/apache/hadoop/hdfs/DFSConfigKeys.java   |  3 +++
 .../org/apache/hadoop/hdfs/DFSOutputStream.java | 10 +
 .../src/main/resources/hdfs-default.xml |  7 +++
 .../hadoop/hdfs/TestDFSClientRetries.java   | 22 
 6 files changed, 52 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hadoop/blob/0a41b1bd/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
--
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt 
b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index f9c4258..402504d 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -10,6 +10,9 @@ Release 2.8.0 - UNRELEASED
 
 HDFS-2360. Ugly stacktrace when quota exceeds. (harsh)
 
+HDFS-7835. make initial sleeptime in locateFollowingBlock configurable for
+DFSClient. (Zhihai Xu via Yongjun Zhang)
+
   OPTIMIZATIONS
 
   BUG FIXES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0a41b1bd/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
index 658cccf..74c0d78 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
@@ -24,6 +24,8 @@ import static 
org.apache.hadoop.hdfs.DFSConfigKeys.DFS_BYTES_PER_CHECKSUM_DEFAUL
 import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_BYTES_PER_CHECKSUM_KEY;
 import static 
org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_BLOCK_WRITE_LOCATEFOLLOWINGBLOCK_RETRIES_DEFAULT;
 import static 
org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_BLOCK_WRITE_LOCATEFOLLOWINGBLOCK_RETRIES_KEY;
+import static 
org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_BLOCK_WRITE_LOCATEFOLLOWINGBLOCK_INITIAL_DELAY_DEFAULT;
+import static 
org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_BLOCK_WRITE_LOCATEFOLLOWINGBLOCK_INITIAL_DELAY_KEY;
 import static 
org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_BLOCK_WRITE_RETRIES_DEFAULT;
 import static 
org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_BLOCK_WRITE_RETRIES_KEY;
 import static 
org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_CACHED_CONN_RETRY_DEFAULT;
@@ -307,6 +309,7 @@ public class DFSClient implements java.io.Closeable, 
RemotePeerFactory,
 final int nCachedConnRetry;
 final int nBlockWriteRetry;
 final int nBlockWriteLocateFollowingRetry;
+final int blockWriteLocateFollowingInitialDelayMs;
 final long defaultBlockSize;
 final long prefetchSize;
 final short defaultReplication;
@@ -418,6 +421,9 @@ public class DFSClient implements java.io.Closeable, 
RemotePeerFactory,
   nBlockWriteLocateFollowingRetry = conf.getInt(
   DFS_CLIENT_BLOCK_WRITE_LOCATEFOLLOWINGBLOCK_RETRIES_KEY,
   DFS_CLIENT_BLOCK_WRITE_LOCATEFOLLOWINGBLOCK_RETRIES_DEFAULT);
+  blockWriteLocateFollowingInitialDelayMs = conf.getInt(
+  DFS_CLIENT_BLOCK_WRITE_LOCATEFOLLOWINGBLOCK_INITIAL_DELAY_KEY,
+  DFS_CLIENT_BLOCK_WRITE_LOCATEFOLLOWINGBLOCK_INITIAL_DELAY_DEFAULT);
   uMask = FsPermission.getUMask(conf);
   connectToDnViaHostname = conf.getBoolean(DFS_CLIENT_USE_DN_HOSTNAME,
   DFS_CLIENT_USE_DN_HOSTNAME_DEFAULT);
@@ -568,6 +574,11 @@ public class DFSClient implements java.io.Closeable, 
RemotePeerFactory,
   }
   return dataChecksum;
 }
+
+@VisibleForTesting
+public int getBlockWriteLocateFollowingInitialDelayMs() {
+  return