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

Peter Bacsko commented on HADOOP-16237:
---------------------------------------

*CosmosDBDocumentStoreReader /* *CosmosDBDocumentStoreWriter*

 
{noformat}
if (client == null) {
  synchronized (this) {
    if (client == null) {
      LOG.info("Creating Cosmos DB Client...");
      client = DocumentStoreUtils.createCosmosDBClient(conf);
    }
  }
}{noformat}
To me this looks like the standard DCL pattern and with {{client}} being 
non-volatile, it's faulty. So either make it volatile or we should consider 
making {{client}} non-static - is it expensive to create? Do we really need to 
cache it once it's created?

*FlowRunDocument.aggregate*
{noformat}
LOG.error("Unknown TimelineMetricOperation."){noformat}
I vote for WARN level. If it's really an error, then we probably should throw 
an exception, no? 

 

*FlowRunDocument.aggregateMetrics(Map)*

I think FindBugs is right, this can be enhanced. We retrieve the {{keySet()}} 
from {{metricSubDocMap}} then perform {{get()}}  on it if {{metrics}} happens 
to contain the same key. Operating on the {{EntrySet}} is definitely better 
here (although I have no idea whether it really speeds up things). 

> Fix new findbugs issues after update guava to 27.0-jre in hadoop-project trunk
> ------------------------------------------------------------------------------
>
>                 Key: HADOOP-16237
>                 URL: https://issues.apache.org/jira/browse/HADOOP-16237
>             Project: Hadoop Common
>          Issue Type: Sub-task
>    Affects Versions: 3.3.0
>            Reporter: Gabor Bota
>            Assignee: Gabor Bota
>            Priority: Critical
>         Attachments: 
> branch-findbugs-hadoop-common-project_hadoop-kms-warnings.html, 
> branch-findbugs-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-nodemanager-warnings.html,
>  
> branch-findbugs-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-resourcemanager-warnings.html,
>  
> branch-findbugs-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-timelineservice-documentstore-warnings.html
>
>
> There are a bunch of new findbugs issues in the build after committing the 
> guava update.
> Mostly in yarn, but we have to check and handle those.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to