Fredy Wijaya has posted comments on this change. ( http://gerrit.cloudera.org:8080/13049 )
Change subject: IMPALA-8149 : Add support for alter_database events ...................................................................... Patch Set 1: (12 comments) http://gerrit.cloudera.org:8080/#/c/13049/1//COMMIT_MSG Commit Message: http://gerrit.cloudera.org:8080/#/c/13049/1//COMMIT_MSG@9 PS1, Line 9: add typo: adds http://gerrit.cloudera.org:8080/#/c/13049/1//COMMIT_MSG@8 PS1, Line 8: : This change add support for alter_database events in two parts: : One is adding catalogServiceId and catalogVersion in db parameters when alter database. : The other is adding alter database event, check if it's self event during process, if true do nothing, if false replace caralog cached db with event db. nit: try to keep it within 72 characters http://gerrit.cloudera.org:8080/#/c/13049/1/fe/src/main/java/org/apache/impala/catalog/CatalogServiceCatalog.java File fe/src/main/java/org/apache/impala/catalog/CatalogServiceCatalog.java: http://gerrit.cloudera.org:8080/#/c/13049/1/fe/src/main/java/org/apache/impala/catalog/CatalogServiceCatalog.java@767 PS1, Line 767: * @param tblName table name > We need to update the comment to explain that it can remove version for bot +1. I'm also not quite clear why we need to remove the version for in-flight events when tblName == null. Same as above for getInFlightVersionsForEvents. http://gerrit.cloudera.org:8080/#/c/13049/1/fe/src/main/java/org/apache/impala/catalog/Db.java File fe/src/main/java/org/apache/impala/catalog/Db.java: http://gerrit.cloudera.org:8080/#/c/13049/1/fe/src/main/java/org/apache/impala/catalog/Db.java@521 PS1, Line 521: == nit: >= is probably better http://gerrit.cloudera.org:8080/#/c/13049/1/fe/src/main/java/org/apache/impala/catalog/events/MetastoreEvents.java File fe/src/main/java/org/apache/impala/catalog/events/MetastoreEvents.java: http://gerrit.cloudera.org:8080/#/c/13049/1/fe/src/main/java/org/apache/impala/catalog/events/MetastoreEvents.java@263 PS1, Line 263: protected List<Long> pendingVersionNumbersFromCatalog_ = Collections.EMPTY_LIST; make it final? http://gerrit.cloudera.org:8080/#/c/13049/1/fe/src/main/java/org/apache/impala/catalog/events/MetastoreEvents.java@272 PS1, Line 272: event.getTableName() can event.getTableName() be null? If not, we should do Preconditions.checkNotNull(event.getTableName()) similar to L271 http://gerrit.cloudera.org:8080/#/c/13049/1/fe/src/main/java/org/apache/impala/catalog/events/MetastoreEvents.java@405 PS1, Line 405: if (versionNumberFromEvent_ == -1 || pendingVersionNumbersFromCatalog_.isEmpty()) : return false; nit: if it spans across multiple lines, use {} http://gerrit.cloudera.org:8080/#/c/13049/1/fe/src/main/java/org/apache/impala/catalog/events/MetastoreEvents.java@408 PS1, Line 408: if (catalog_.getCatalogServiceId().equals(serviceIdFromEvent_)) { : // service id is a match. Now check if the event version is what we expect : // in the list : if (pendingVersionNumbersFromCatalog_.get(0).equals(versionNumberFromEvent_)) { can be combined with && to reduce the nestedness http://gerrit.cloudera.org:8080/#/c/13049/1/fe/src/main/java/org/apache/impala/catalog/events/MetastoreEvents.java@439 PS1, Line 439: protected void initSelfEventIdentifiersFromEvent() { : throw new UnsupportedOperationException("Please override this method in subclass"); : } making it an abstract is better since we get compile-time vs runtime error. http://gerrit.cloudera.org:8080/#/c/13049/1/fe/src/main/java/org/apache/impala/catalog/events/MetastoreEvents.java@445 PS1, Line 445: if (params == null) This code is a bit weird that "params" can be null. Usually it should be an empty map instead. http://gerrit.cloudera.org:8080/#/c/13049/1/fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java File fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java: http://gerrit.cloudera.org:8080/#/c/13049/1/fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java@370 PS1, Line 370: break; nit: put it in the new line http://gerrit.cloudera.org:8080/#/c/13049/1/fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java@3805 PS1, Line 3805: Preconditions.checkState(dbName != null && !dbName.isEmpty(), > I think this check is redundant, as it is done inside getDb() call below? checkState is also not quite correct. It's more like checkArgument. -- To view, visit http://gerrit.cloudera.org:8080/13049 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iaf020e85cae04163bf32e31363eb4119d624640b Gerrit-Change-Number: 13049 Gerrit-PatchSet: 1 Gerrit-Owner: Anonymous Coward <xiaom...@cloudera.com> Gerrit-Reviewer: Anurag Mantripragada <anu...@cloudera.com> Gerrit-Reviewer: Bharath Krishna <bhar...@cloudera.com> Gerrit-Reviewer: Bharath Vissapragada <bhara...@cloudera.com> Gerrit-Reviewer: Fredy Wijaya <fwij...@cloudera.com> Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Gerrit-Reviewer: Vihang Karajgaonkar <vih...@cloudera.com> Gerrit-Comment-Date: Thu, 18 Apr 2019 18:55:14 +0000 Gerrit-HasComments: Yes