You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by mc...@apache.org on 2019/01/10 17:42:45 UTC

[incubator-pinot] branch master updated: Added a log when access is denied (#3669)

This is an automated email from the ASF dual-hosted git repository.

mcvsubbu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 94cab26  Added a log when access is denied (#3669)
94cab26 is described below

commit 94cab26fa92ffd33a4c5e9502b26a32dde43b914
Author: Subbu Subramaniam <mc...@users.noreply.github.com>
AuthorDate: Thu Jan 10 09:42:40 2019 -0800

    Added a log when access is denied (#3669)
---
 .../pinot/broker/requesthandler/BaseBrokerRequestHandler.java       | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pinot-broker/src/main/java/com/linkedin/pinot/broker/requesthandler/BaseBrokerRequestHandler.java b/pinot-broker/src/main/java/com/linkedin/pinot/broker/requesthandler/BaseBrokerRequestHandler.java
index ea8eb0e..2b9304d 100644
--- a/pinot-broker/src/main/java/com/linkedin/pinot/broker/requesthandler/BaseBrokerRequestHandler.java
+++ b/pinot-broker/src/main/java/com/linkedin/pinot/broker/requesthandler/BaseBrokerRequestHandler.java
@@ -107,7 +107,7 @@ public abstract class BaseBrokerRequestHandler implements BrokerRequestHandler {
       return "";
     }
   }
-  
+
   @Override
   public BrokerResponse handleRequest(JSONObject request, @Nullable RequesterIdentity requesterIdentity)
       throws Exception {
@@ -149,8 +149,8 @@ public abstract class BaseBrokerRequestHandler implements BrokerRequestHandler {
     // Check table access
     boolean hasAccess = _accessControlFactory.create().hasAccess(requesterIdentity, brokerRequest);
     if (!hasAccess) {
-      _brokerMetrics.addMeteredTableValue(brokerRequest.getQuerySource().getTableName(),
-          BrokerMeter.REQUEST_DROPPED_DUE_TO_ACCESS_ERROR, 1);
+      _brokerMetrics.addMeteredTableValue(tableName, BrokerMeter.REQUEST_DROPPED_DUE_TO_ACCESS_ERROR, 1);
+      LOGGER.info("Access denied for requestId {}, table {}", requestId, tableName);
       requestStatistics.setErrorCode(QueryException.ACCESS_DENIED_ERROR_CODE);
       return new BrokerResponseNative(QueryException.ACCESS_DENIED_ERROR);
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org