hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject hbase git commit: HBASE-19087 Logs should have Optional's value/null instead of Optional[value]/Optional.empty.
Date Tue, 31 Oct 2017 01:37:43 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 98c01bd4c -> 5000652e5


HBASE-19087 Logs should have Optional's value/null instead of Optional[value]/Optional.empty.

Change-Id: I436d02ee91710442d199e63956186a9364852c4e
Signed-off-by: Apekshit Sharma <appy@apache.org>


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

Branch: refs/heads/master
Commit: 5000652e5e3fa9cfc6ea59c0415382b2e7b62f36
Parents: 98c01bd
Author: Guangxu Cheng <guangxucheng@gmail.com>
Authored: Wed Oct 25 20:23:33 2017 +0800
Committer: Apekshit Sharma <appy@apache.org>
Committed: Mon Oct 30 18:32:02 2017 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/hbase/master/HMaster.java | 3 ++-
 .../org/apache/hadoop/hbase/regionserver/RSRpcServices.java   | 7 ++++---
 .../hadoop/hbase/security/token/TestTokenAuthentication.java  | 4 ++--
 3 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/5000652e/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
index a990a4b..a34f3f4 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
@@ -1552,7 +1552,8 @@ public class HMaster extends HRegionServer implements MasterServices
{
    * @return Client info for use as prefix on an audit log string; who did an action
    */
   public String getClientIdAuditPrefix() {
-    return "Client=" + RpcServer.getRequestUserName() + "/" + RpcServer.getRemoteAddress();
+    return "Client=" + RpcServer.getRequestUserName().orElse(null)
+        + "/" + RpcServer.getRemoteAddress().orElse(null);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/hbase/blob/5000652e/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
index bff69ba..0623b2c 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
@@ -1137,7 +1137,8 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
       if (LOG.isWarnEnabled()) {
         LOG.warn("Large batch operation detected (greater than " + rowSizeWarnThreshold
             + ") (HBASE-18023)." + " Requested Number of Rows: " + sum + " Client: "
-            + RpcServer.getRequestUserName() + "/" + RpcServer.getRemoteAddress()
+            + RpcServer.getRequestUserName().orElse(null) + "/"
+            + RpcServer.getRemoteAddress().orElse(null)
             + " first region in multi=" + firstRegionName);
       }
     }
@@ -1727,8 +1728,8 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
   @QosPriority(priority=HConstants.ADMIN_QOS)
   public ClearCompactionQueuesResponse clearCompactionQueues(RpcController controller,
     ClearCompactionQueuesRequest request) throws ServiceException {
-    LOG.debug("Client=" + RpcServer.getRequestUserName() + "/" + RpcServer.getRemoteAddress()
-            + " clear compactions queue");
+    LOG.debug("Client=" + RpcServer.getRequestUserName().orElse(null) + "/"
+        + RpcServer.getRemoteAddress().orElse(null) + " clear compactions queue");
     ClearCompactionQueuesResponse.Builder respBuilder = ClearCompactionQueuesResponse.newBuilder();
     requestCount.increment();
     if (clearCompactionQueues.compareAndSet(false,true)) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/5000652e/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestTokenAuthentication.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestTokenAuthentication.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestTokenAuthentication.java
index e849b30..f116b30 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestTokenAuthentication.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestTokenAuthentication.java
@@ -374,7 +374,7 @@ public class TestTokenAuthentication {
     public AuthenticationProtos.GetAuthenticationTokenResponse getAuthenticationToken(
         RpcController controller, AuthenticationProtos.GetAuthenticationTokenRequest request)
       throws ServiceException {
-      LOG.debug("Authentication token request from " + RpcServer.getRequestUserName());
+      LOG.debug("Authentication token request from " + RpcServer.getRequestUserName().orElse(null));
       // Ignore above passed in controller -- it is always null
       ServerRpcController serverController = new ServerRpcController();
       final NonShadedBlockingRpcCallback<AuthenticationProtos.GetAuthenticationTokenResponse>
@@ -392,7 +392,7 @@ public class TestTokenAuthentication {
     public AuthenticationProtos.WhoAmIResponse whoAmI(
         RpcController controller, AuthenticationProtos.WhoAmIRequest request)
       throws ServiceException {
-      LOG.debug("whoAmI() request from " + RpcServer.getRequestUserName());
+      LOG.debug("whoAmI() request from " + RpcServer.getRequestUserName().orElse(null));
       // Ignore above passed in controller -- it is always null
       ServerRpcController serverController = new ServerRpcController();
       NonShadedBlockingRpcCallback<AuthenticationProtos.WhoAmIResponse> callback =


Mime
View raw message