impala-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henry Robinson (Code Review)" <ger...@cloudera.org>
Subject [Impala-CR](cdh5-trunk) IMPALA-3711: Remove unnecessary privilege checks in getDbsMetadata()
Date Wed, 06 Jul 2016 01:00:25 GMT
Henry Robinson has posted comments on this change.

Change subject: IMPALA-3711: Remove unnecessary privilege checks in getDbsMetadata()
......................................................................


Patch Set 18:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/3371/18/fe/src/main/java/com/cloudera/impala/util/PatternMatcher.java
File fe/src/main/java/com/cloudera/impala/util/PatternMatcher.java:

PS18, Line 46: public static final PatternMatcher MATCHER_MATCH_ALL = new PatternMatcher();
             :   public static final PatternMatcher MATCHER_MATCH_NONE;
             :   static {
             :     MATCHER_MATCH_NONE = new PatternMatcher();
             :     MATCHER_MATCH_NONE.patterns_ = Collections.emptyList();
             :   }
> Why this is not thread safe? this is constructed on process start up right?
That's the point: the class implementation needs to stay read-only. 

If you want to go this route, I would add some more defensive checks: make patterns_ final
and an ImmutableList. Add a class comment saying that the implementation must be thread safe.

You might consider, instead, subclassing PatternMatcher with a MatchAllMAtcher class, whose
implementation of matches() is "return true".


-- 
To view, visit http://gerrit.cloudera.org:8080/3371
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I17d8c5b9fb12483e4b01b819fba48b6849311a14
Gerrit-PatchSet: 18
Gerrit-Project: Impala
Gerrit-Branch: cdh5-trunk
Gerrit-Owner: Huaisi Xu <hxu@cloudera.com>
Gerrit-Reviewer: Dimitris Tsirogiannis <dtsirogiannis@cloudera.com>
Gerrit-Reviewer: Henry Robinson <henry@cloudera.com>
Gerrit-Reviewer: Huaisi Xu <hxu@cloudera.com>
Gerrit-HasComments: Yes

Mime
View raw message