Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B844C200D21 for ; Mon, 16 Oct 2017 20:21:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B6FFE1609EF; Mon, 16 Oct 2017 18:21:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 06D411609E3 for ; Mon, 16 Oct 2017 20:21:04 +0200 (CEST) Received: (qmail 49926 invoked by uid 500); 16 Oct 2017 18:21:04 -0000 Mailing-List: contact commits-help@sentry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sentry.apache.org Delivered-To: mailing list commits@sentry.apache.org Received: (qmail 49917 invoked by uid 99); 16 Oct 2017 18:21:04 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Oct 2017 18:21:04 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0611ADFA3D; Mon, 16 Oct 2017 18:21:04 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: spena@apache.org To: commits@sentry.apache.org Message-Id: <8a490dacbdd340e49d1f2806f507cee5@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: sentry git commit: SENTRY-1985: Sentry should log in stdout when it is ready to serve requests (Sergio Pena, reviewed by Alexander Kolbasov, Na Li) Date: Mon, 16 Oct 2017 18:21:04 +0000 (UTC) archived-at: Mon, 16 Oct 2017 18:21:05 -0000 Repository: sentry Updated Branches: refs/heads/master 2ec0f3f82 -> ce049714b SENTRY-1985: Sentry should log in stdout when it is ready to serve requests (Sergio Pena, reviewed by Alexander Kolbasov, Na Li) Project: http://git-wip-us.apache.org/repos/asf/sentry/repo Commit: http://git-wip-us.apache.org/repos/asf/sentry/commit/ce049714 Tree: http://git-wip-us.apache.org/repos/asf/sentry/tree/ce049714 Diff: http://git-wip-us.apache.org/repos/asf/sentry/diff/ce049714 Branch: refs/heads/master Commit: ce049714b529df02e795ffd3575ae1d33646329a Parents: 2ec0f3f Author: Sergio Pena Authored: Mon Oct 16 13:20:32 2017 -0500 Committer: Sergio Pena Committed: Mon Oct 16 13:20:32 2017 -0500 ---------------------------------------------------------------------- .../java/org/apache/sentry/service/thrift/HMSFollower.java | 9 +++++++++ .../org/apache/sentry/service/thrift/SentryService.java | 3 +++ 2 files changed, 12 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/sentry/blob/ce049714/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 31fd459..0861132 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 @@ -49,6 +49,7 @@ public class HMSFollower implements Runnable, AutoCloseable { private final Configuration authzConf; private final SentryStore sentryStore; private final NotificationProcessor notificationProcessor; + private boolean readyToServe; private final HiveNotificationFetcher notificationFetcher; private final boolean hdfsSyncEnabled; @@ -84,6 +85,7 @@ public class HMSFollower implements Runnable, AutoCloseable { public HMSFollower(Configuration conf, SentryStore store, LeaderStatusMonitor leaderMonitor, HiveConnectionFactory hiveConnectionFactory, String authServerName) { LOGGER.info("HMSFollower is being initialized"); + readyToServe = false; authzConf = conf; this.leaderMonitor = leaderMonitor; sentryStore = store; @@ -197,6 +199,13 @@ public class HMSFollower implements Runnable, AutoCloseable { return; } + if (!readyToServe) { + // Allow users and/or applications who look into the Sentry console output to see + // when Sentry is ready to serve. + System.out.println("Sentry HMS support is ready"); + readyToServe = true; + } + // Continue with processing new notifications if no snapshots are done. processNotifications(notifications); } catch (TException e) { http://git-wip-us.apache.org/repos/asf/sentry/blob/ce049714/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 d2a4c2d..43535a7 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 @@ -270,6 +270,9 @@ public class SentryService implements Callable, SigUtils.SigListener { // 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"); + + // Allow clients/users watching the console to know when sentry is ready + System.out.println("Sentry service is ready to serve client requests"); SentryStateBank.enableState(SentryServiceState.COMPONENT, SentryServiceState.SERVICE_RUNNING); thriftServer.serve(); }