[ 
https://issues.apache.org/jira/browse/HIVE-22428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16963792#comment-16963792
 ] 

Miklos Gergely commented on HIVE-22428:
---------------------------------------

In short: it is ok.

A few remarks:
 * According to the hive 
[checkstyle|https://github.com/apache/hive/blob/ca4c0a2269310cc1618d1eafaee5bd126a3df69e/checkstyle/checkstyle.xml#L163]
 the maximum row length is 120 characters, so there is no reason to break 
shorter lines.
 * At one point you remove the *if (LOG.isDebugEnabled()) {*, at another you 
introduce a new one. It is only needed if the cost of caclulating the message 
is high, but *TableName.getQualified* is a simple string concatenation, so 
there is no point of using it here.
 * I don't see why you've added the final modifier for the parameter of 
*debugLog*, it is not required, and it is also not generally used in the class 
or in Hive.

> Superfluous "Failed to get database" WARN Logging in ObjectStore
> ----------------------------------------------------------------
>
>                 Key: HIVE-22428
>                 URL: https://issues.apache.org/jira/browse/HIVE-22428
>             Project: Hive
>          Issue Type: Improvement
>          Components: Standalone Metastore
>    Affects Versions: 3.2.0
>            Reporter: David Mollitor
>            Assignee: David Mollitor
>            Priority: Major
>         Attachments: HIVE-22428.1.patch, HIVE-22428.1.patch
>
>
> In my testing, I get lots of logs like this:
> {code:none}
>       Line 26319: 2019-10-28T21:09:52,134  WARN [pool-6-thread-5] 
> metastore.ObjectStore: Failed to get database hive.compdb, returning 
> NoSuchObjectException
>       Line 26327: 2019-10-28T21:09:52,135  WARN [pool-6-thread-5] 
> metastore.ObjectStore: Failed to get database hive.compdb, returning 
> NoSuchObjectException
>       Line 26504: 2019-10-28T21:09:52,600  WARN [pool-6-thread-5] 
> metastore.ObjectStore: Failed to get database hive.tstatsfast, returning 
> NoSuchObjectException
>       Line 26519: 2019-10-28T21:09:52,606  WARN [pool-6-thread-5] 
> metastore.ObjectStore: Failed to get database hive.tstatsfast, returning 
> NoSuchObjectException
>       Line 26695: 2019-10-28T21:09:52,922  WARN [pool-6-thread-5] 
> metastore.ObjectStore: Failed to get database hive.createDb, returning 
> NoSuchObjectException
>       Line 26703: 2019-10-28T21:09:52,923  WARN [pool-6-thread-5] 
> metastore.ObjectStore: Failed to get database hive.createDb, returning 
> NoSuchObjectException
>       Line 26763: 2019-10-28T21:09:52,936  WARN [pool-6-thread-5] 
> metastore.ObjectStore: Failed to get database hive.compdb, returning 
> NoSuchObjectException
>       Line 26778: 2019-10-28T21:09:52,939  WARN [pool-6-thread-5] 
> metastore.ObjectStore: Failed to get database hive.compdb, returning 
> NoSuchObjectException
>       Line 26963: 2019-10-28T21:09:53,273  WARN [pool-6-thread-5] 
> metastore.ObjectStore: Failed to get database hive.db1, returning 
> NoSuchObjectException
>       Line 26978: 2019-10-28T21:09:53,276  WARN [pool-6-thread-5] 
> metastore.ObjectStore: Failed to get database hive.db2, returning 
> NoSuchObjectException
>       Line 26986: 2019-10-28T21:09:53,277  WARN [pool-6-thread-5] 
> metastore.ObjectStore: Failed to get database hive.db1, returning 
> NoSuchObjectException
>       Line 27018: 2019-10-28T21:09:53,300  WARN [pool-6-thread-5] 
> metastore.ObjectStore: Failed to get database hive.db2, returning 
> NoSuchObjectException
> {code}
> This is a superfluous log message.  It might be pretty common for a database 
> to not exists if, for example, a user fat-fingers the name of the database.  
> The code also has the bad habit of log-and-throw.  Just log or throw, not 
> both.
> Since I'm looking at this class, touch up some of the other logging as well.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to