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

David Mollitor commented on HIVE-23540:
---------------------------------------

[~gopalv]  Thanks.  Good point: I updated the JIRA with the specific findbugs 
warning.  It's probably not too consequential, but I wanted to close some of 
these warnings out to remove the chatter from the plugin.

Ya, I can revert the singleton change, but in general singletons of this nature 
are the best bet for such a large and complicated piece of software.  Otherwise 
you run into issues with NullPointerExceptions and those are just very annoying 
in a production system.  For example, there is no 'null' check in the 
{{reset()}} method before accessing {{cacheBuffers}}.  Since the variable is 
not marked as 'volatile' the value should be cached by the thread, and really, 
for something like LLAP, it probably makes the most sense to focus on code 
clarity, ease, and safety.  If there is a performance problem from some of the 
overhead, the fix is super easy: scale.  Just fire up another daemon; that's 
what Google does.

https://github.com/google/guava/wiki/UsingAndAvoidingNullExplained

{code:java|title=EncodedColumnBatch.java}
    public void reset() {
      cacheBuffers.clear();
      refCount.set(0);
      indexBaseOffset = 0;
    }
{code}


> Fix Findbugs Warnings in EncodedColumnBatch
> -------------------------------------------
>
>                 Key: HIVE-23540
>                 URL: https://issues.apache.org/jira/browse/HIVE-23540
>             Project: Hive
>          Issue Type: Improvement
>          Components: storage-api
>            Reporter: David Mollitor
>            Assignee: David Mollitor
>            Priority: Minor
>         Attachments: HIVE-23540.1.patch
>
>
> bq. Strings should not be concatenated using '+' in a loop



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

Reply via email to