> On May 10, 2017, 4:40 p.m., kalyan kumar kalvagadda wrote:
> > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java
> > Lines 142 (patched)
> > <https://reviews.apache.org/r/59120/diff/2/?file=1714020#file1714020line150>
> >
> >     It does not help in debugging? If you don't see log message "Metastore 
> > uri is not configured in hive config. Returning", it is clear that you have 
> > some value in configured for "METASTOREURIS". Just that information may not 
> > help you. If you really want some log in possitive case, print the 
> > metastoreUri here instead of printing it below.

The metastoreUri is printed here. {} is the way to include its value in logging 
message. see https://www.slf4j.org/faq.html for more detail.
--------------------------------

Better yet, use parameterized messages

There exists a very convenient alternative based on message formats. Assuming 
entry is an object, you can write:

Object entry = new SomeObject();
logger.debug("The entry is {}.", entry);

After evaluating whether to log or not, and only if the decision is 
affirmative, will the logger implementation format the message and replace the 
'{}' pair with the string value of entry. In other words, this form does not 
incur the cost of parameter construction in case the log statement is disabled.

The following two lines will yield the exact same output. However, the second 
form will outperform the first form by a factor of at least 30, in case of a 
disabled logging statement.

logger.debug("The new entry is "+entry+".");
logger.debug("The new entry is {}.", entry);


- Na


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59120/#review174499
-----------------------------------------------------------


On May 10, 2017, 3:37 p.m., Na Li wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59120/
> -----------------------------------------------------------
> 
> (Updated May 10, 2017, 3:37 p.m.)
> 
> 
> Review request for sentry, Alexander Kolbasov, kalyan kumar kalvagadda, and 
> Sergio Pena.
> 
> 
> Bugs: sentry-1757
>     https://issues.apache.org/jira/browse/sentry-1757
> 
> 
> Repository: sentry
> 
> 
> Description
> -------
> 
> use hive configuration to check.
> 
> 
> Diffs
> -----
> 
>   
> sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java
>  e271ea4 
>   
> sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegration.java
>  1530eb2 
>   
> sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegrationBase.java
>  32acc65 
> 
> 
> Diff: https://reviews.apache.org/r/59120/diff/2/
> 
> 
> Testing
> -------
> 
> integration test TestHDFSIntegrationEnd2End
> 
> 
> Thanks,
> 
> Na Li
> 
>

Reply via email to