hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brando...@apache.org
Subject git commit: HDFS-7215.Add JvmPauseMonitor to NFS gateway. Contributed by Brandon Li
Date Tue, 21 Oct 2014 18:55:32 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 33e020cb1 -> c800e058e


HDFS-7215.Add JvmPauseMonitor to NFS gateway. Contributed by Brandon Li

(cherry picked from commit 4e134a02a4b6f30704b99dfb166dc361daf426ea)

Conflicts:
	hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt


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

Branch: refs/heads/branch-2
Commit: c800e058ea023a6fa8b68a0cf797c8aa0e2d9226
Parents: 33e020c
Author: Brandon Li <brandonli@apache.org>
Authored: Tue Oct 21 11:49:10 2014 -0700
Committer: Brandon Li <brandonli@apache.org>
Committed: Tue Oct 21 11:55:18 2014 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/nfs/nfs3/Nfs3Base.java |  5 +++--
 .../java/org/apache/hadoop/oncrpc/RpcProgram.java |  3 ++-
 .../hadoop/hdfs/nfs/nfs3/RpcProgramNfs3.java      | 18 +++++++++++++++++-
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt       |  2 ++
 .../src/site/apt/HdfsNfsGateway.apt.vm            |  4 +++-
 5 files changed, 27 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/c800e058/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/nfs/nfs3/Nfs3Base.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/nfs/nfs3/Nfs3Base.java
b/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/nfs/nfs3/Nfs3Base.java
index b166330..40744bc 100644
--- a/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/nfs/nfs3/Nfs3Base.java
+++ b/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/nfs/nfs3/Nfs3Base.java
@@ -50,7 +50,7 @@ public abstract class Nfs3Base {
     startTCPServer(); // Start TCP server
 
     if (register) {
-      ShutdownHookManager.get().addShutdownHook(new Unregister(),
+      ShutdownHookManager.get().addShutdownHook(new NfsShutdownHook(),
           SHUTDOWN_HOOK_PRIORITY);
       try {
         rpcProgram.register(PortmapMapping.TRANSPORT_TCP, nfsBoundPort);
@@ -74,10 +74,11 @@ public abstract class Nfs3Base {
    */
   public static final int SHUTDOWN_HOOK_PRIORITY = 10;
 
-  private class Unregister implements Runnable {
+  private class NfsShutdownHook implements Runnable {
     @Override
     public synchronized void run() {
       rpcProgram.unregister(PortmapMapping.TRANSPORT_TCP, nfsBoundPort);
+      rpcProgram.stopDaemons();
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/c800e058/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/RpcProgram.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/RpcProgram.java
b/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/RpcProgram.java
index 3190603..3343c75 100644
--- a/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/RpcProgram.java
+++ b/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/RpcProgram.java
@@ -136,8 +136,9 @@ public abstract class RpcProgram extends SimpleChannelUpstreamHandler
{
     }
   }
 
-  // Start extra daemons
+  // Start extra daemons or services
   public void startDaemons() {}
+  public void stopDaemons() {}
   
   @Override
   public void messageReceived(ChannelHandlerContext ctx, MessageEvent e)

http://git-wip-us.apache.org/repos/asf/hadoop/blob/c800e058/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/nfs3/RpcProgramNfs3.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/nfs3/RpcProgramNfs3.java
b/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/nfs3/RpcProgramNfs3.java
index 40a9043..b1076f2 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/nfs3/RpcProgramNfs3.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/nfs3/RpcProgramNfs3.java
@@ -126,6 +126,7 @@ import org.apache.hadoop.security.AccessControlException;
 import org.apache.hadoop.security.SecurityUtil;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.security.authorize.AuthorizationException;
+import org.apache.hadoop.util.JvmPauseMonitor;
 import org.jboss.netty.buffer.ChannelBuffer;
 import org.jboss.netty.buffer.ChannelBuffers;
 import org.jboss.netty.channel.Channel;
@@ -158,6 +159,7 @@ public class RpcProgramNfs3 extends RpcProgram implements Nfs3Interface
{
   private String writeDumpDir; // The dir save dump files
 
   private final RpcCallCache rpcCallCache;
+  private JvmPauseMonitor pauseMonitor;
 
   public RpcProgramNfs3(NfsConfiguration config, DatagramSocket registrationSocket,
       boolean allowInsecurePorts) throws IOException {
@@ -219,7 +221,21 @@ public class RpcProgramNfs3 extends RpcProgram implements Nfs3Interface
{
 
   @Override
   public void startDaemons() {
-     writeManager.startAsyncDataSerivce();
+    if (pauseMonitor == null) {
+      pauseMonitor = new JvmPauseMonitor(config);
+      pauseMonitor.start();
+    }
+    writeManager.startAsyncDataSerivce();
+  }
+
+  @Override
+  public void stopDaemons() {
+    if (writeManager != null) {
+      writeManager.shutdownAsyncDataService();
+    }
+    if (pauseMonitor != null) {
+      pauseMonitor.stop();
+    }
   }
 
   // Checks the type of IOException and maps it to appropriate Nfs3Status code.

http://git-wip-us.apache.org/repos/asf/hadoop/blob/c800e058/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 cfe621f..3cee2e8 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -627,6 +627,8 @@ Release 2.6.0 - UNRELEASED
     HDFS-7259. Unresponseive NFS mount point due to deferred COMMIT response.
     (brandonli)
 
+    HDFS-7215.Add JvmPauseMonitor to NFS gateway (brandonli)
+
     BREAKDOWN OF HDFS-6581 SUBTASKS AND RELATED JIRAS
   
       HDFS-6921. Add LazyPersist flag to FileStatus. (Arpit Agarwal)

http://git-wip-us.apache.org/repos/asf/hadoop/blob/c800e058/hadoop-hdfs-project/hadoop-hdfs/src/site/apt/HdfsNfsGateway.apt.vm
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/site/apt/HdfsNfsGateway.apt.vm b/hadoop-hdfs-project/hadoop-hdfs/src/site/apt/HdfsNfsGateway.apt.vm
index 4044ae8..0e6c482 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/site/apt/HdfsNfsGateway.apt.vm
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/site/apt/HdfsNfsGateway.apt.vm
@@ -171,7 +171,9 @@ HDFS NFS Gateway
 </property>
 ----
 
-  * Customize log settings. To get NFS debug trace, users can edit the log4j.property file

+  * JVM and log settings. You can export JVM settings (e.g., heap size and GC log) in 
+   HADOOP_NFS3_OPTS. More NFS related settings can be found in hadoop-env.sh. 
+   To get NFS debug trace, you can edit the log4j.property file 
    to add the following. Note, debug trace, especially for ONCRPC, can be very verbose.
 
     To change logging level:


Mime
View raw message