Jelajahi Sumber

HADOOP-10280. Make Schedulables return a configurable identity of user or group. (Contributed by Chris Li)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1581532 13f79535-47bb-0310-9956-ffa450edef68
Arpit Agarwal 11 tahun lalu
induk
melakukan
c64974a863

+ 3 - 0
hadoop-common-project/hadoop-common/CHANGES.txt

@@ -390,6 +390,9 @@ Release 2.4.0 - UNRELEASED
     HADOOP-10423. Clarify compatibility policy document for combination of 
     new client and old server. (Chris Nauroth via kasha)
 
+    HADOOP-10280. Make Schedulables return a configurable identity of user
+    or group. (Chris Li via Arpit Agarwal)
+
   OPTIMIZATIONS
 
   BUG FIXES

+ 1 - 0
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/CommonConfigurationKeys.java

@@ -89,6 +89,7 @@ public class CommonConfigurationKeys extends CommonConfigurationKeysPublic {
    */
   public static final String IPC_CALLQUEUE_NAMESPACE = "ipc";
   public static final String IPC_CALLQUEUE_IMPL_KEY = "callqueue.impl";
+  public static final String IPC_CALLQUEUE_IDENTITY_PROVIDER_KEY = "identity-provider.impl";
 
   /** Internal buffer size for Lzo compressor/decompressors */
   public static final String  IO_COMPRESSION_CODEC_LZO_BUFFERSIZE_KEY =

+ 7 - 1
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java

@@ -496,7 +496,7 @@ public abstract class Server {
   }
 
   /** A call queued for handling. */
-  public static class Call {
+  public static class Call implements Schedulable {
     private final int callId;             // the client's call id
     private final int retryCount;        // the retry count of the call
     private final Writable rpcRequest;    // Serialized Rpc request from client
@@ -534,6 +534,12 @@ public abstract class Server {
     public void setResponse(ByteBuffer response) {
       this.rpcResponse = response;
     }
+
+    // For Schedulable
+    @Override
+    public UserGroupInformation getUserGroupInformation() {
+      return connection.user;
+    }    
   }
 
   /** Listens on the socket. Creates jobs for the handler threads*/