sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ak...@apache.org
Subject sentry git commit: SENTRY-1717: Sentry should emit log messages when it is ready to serve requests (Na Li, reviewed by Alex Kolbasov)
Date Fri, 12 May 2017 04:48:23 GMT
Repository: sentry
Updated Branches:
  refs/heads/sentry-ha-redesign 0acd85384 -> 7da5d5e57


SENTRY-1717: Sentry should emit log messages when it is ready to serve requests (Na Li, reviewed
by Alex Kolbasov)


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

Branch: refs/heads/sentry-ha-redesign
Commit: 7da5d5e571376c3b8ae399b92d7db6e97dc66b41
Parents: 0acd853
Author: Alexander Kolbasov <akolb@cloudera.com>
Authored: Thu May 11 21:48:00 2017 -0700
Committer: Alexander Kolbasov <akolb@cloudera.com>
Committed: Thu May 11 21:48:00 2017 -0700

----------------------------------------------------------------------
 .../java/org/apache/sentry/service/thrift/HMSFollower.java   | 8 ++++++++
 .../java/org/apache/sentry/service/thrift/SentryService.java | 4 ++++
 2 files changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sentry/blob/7da5d5e5/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java
b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java
index 9880c40..5e6b906 100644
--- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java
+++ b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java
@@ -84,6 +84,7 @@ public class HMSFollower implements Runnable, AutoCloseable {
   private String hiveInstance;
 
   private boolean needHiveSnapshot = true;
+  private boolean needLogHMSSupportReady = true;
   private final LeaderStatusMonitor leaderMonitor;
 
   HMSFollower(Configuration conf, SentryStore store, LeaderStatusMonitor leaderMonitor) throws
Exception {
@@ -306,6 +307,13 @@ public class HMSFollower implements Runnable, AutoCloseable {
         wakeUpWaitingClientsForSync(currentEventID);
       }
 
+      // HMSFollower connected to HMS and it finished full snapshot if that was required
+      // Log this message only once
+      if (needLogHMSSupportReady && connectedToHMS) {
+        LOGGER.info("Sentry HMS support is ready");
+        needLogHMSSupportReady = false;
+      }
+
       // HIVE-15761: Currently getNextNotification API may return an empty
       // NotificationEventResponse causing TProtocolException.
       // Workaround: Only processes the notification events newer than the last updated one.

http://git-wip-us.apache.org/repos/asf/sentry/blob/7da5d5e5/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryService.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryService.java
b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryService.java
index 3ea7ebf..6fb224c 100644
--- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryService.java
+++ b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryService.java
@@ -266,6 +266,10 @@ public class SentryService implements Callable, SigUtils.SigListener
{
     thriftServer = new TThreadPoolServer(args);
     LOGGER.info("Serving on " + address);
     startSentryWebServer();
+
+    // thriftServer.serve() does not return until thriftServer is stopped. Need to log before
+    // calling thriftServer.serve()
+    LOGGER.info("Sentry service is ready to serve client requests");
     thriftServer.serve();
   }
 


Mime
View raw message