----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/73239/#review222721 -----------------------------------------------------------
addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/AtlasHiveHookContext.java Lines 61 (patched) <https://reviews.apache.org/r/73239/#comment311887> Consider marking skipDdlOperations as final, as it is not updated after assignment in constructor. addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/AtlasHiveHookContext.java Lines 100 (patched) <https://reviews.apache.org/r/73239/#comment311886> 'allowDdlOperations()' suggests opposite of deny - which is not the case here. Also, since this method is a negative of skipDdlOperations(), consider removing this method and replace its usage with '!skipDdlOperations()'. addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/AlterDatabase.java Line 61 (original), 61 (patched) <https://reviews.apache.org/r/73239/#comment311888> context is available to toDbEntity(). Consider avoiding context.allowDdlOperations() as argument? addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java Line 348 (original), 352 (patched) <https://reviews.apache.org/r/73239/#comment311889> saveInContext argument may not be needed; its value is same as context.allowDdlOperations(). Please review other methods as well for similar usage. addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/DropDatabase.java Lines 72 (patched) <https://reviews.apache.org/r/73239/#comment311891> Please review if context.removeKnownDatabase() should be called for all database - #82 & #89, to clean cache of deleted database. addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/DropTable.java Lines 71 (patched) <https://reviews.apache.org/r/73239/#comment311890> Please review if context.removeKnownTable(), #81, should be called for all tables, to clean cache of deleted tables. - Madhan Neethiraj On March 18, 2021, 12:59 a.m., Ashutosh Mestry wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/73239/ > ----------------------------------------------------------- > > (Updated March 18, 2021, 12:59 a.m.) > > > Review request for atlas, Madhan Neethiraj and Sarath Subramanian. > > > Bugs: ATLAS-4204 > https://issues.apache.org/jira/browse/ATLAS-4204 > > > Repository: atlas > > > Description > ------- > > **Background** > Please see JIRA. > > Terms and abbreviations used: > - Database objects: Database, table, views, etc. > - DDL: Data Definition Langugage. Database parlance. Operations performed on > a database server that result in creation of objects that hold data. > - DML: Data Manipulation Language. Database parlance. Operations performed on > a database server that result in manipulation (add, update, delete) of data. > These are performed using database objects that are already created. > > Hive hook is implemented by: > - _HiveHook_ > - _HiveMetastoreImpl_ > > - _BaseHiveEvent_ has 2 methods: > - getHiveMetastoreEntities: Called by HMS events. > - getHiveEntities: Called by HS2 events. > > **Approach** > - Introduce a flag _skipDDL_ indicating if entities generated as part of DDL > operation should be skipped by a hook. This flag is set as a configuration > parameters: atlas.hive.hook.ignore.ddl.operations > - Skip creation of Atlas's DDL entities when HS2 event is used. > - Continue using HMS event processing unchanged. > > > Diffs > ----- > > > addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/AtlasHiveHookContext.java > 128647147 > addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java > 79e87c79d > > addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/AlterDatabase.java > d2623b363 > > addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/AlterTableRename.java > 6961fa7c2 > > addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/AlterTableRenameCol.java > 756a6089e > > addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java > 7c269ce53 > > addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/CreateDatabase.java > bf5f5620e > > addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/CreateTable.java > 63fc89424 > > addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/DropDatabase.java > 20019d2ef > > addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/DropTable.java > 440c08aff > common/src/main/java/org/apache/atlas/utils/PathExtractorContext.java > ce688e4e4 > > > Diff: https://reviews.apache.org/r/73239/diff/1/ > > > Testing > ------- > > **Functional tests** > - Used specific queries to exercise the affected code paths. > - Verified messages going out of the hooks, onces posted on ATLAS_HOOK and > the entities created within Atlas. > > **Volume test** > Pending. > > **Unit test** > Pending. > > > File Attachments > ---------------- > > HMS Create Table > > https://reviews.apache.org/media/uploaded/files/2021/03/18/748a849a-c8f8-4869-bcb0-ee4ee50215d8__hms-create-table.json > HS2 Create Table > > https://reviews.apache.org/media/uploaded/files/2021/03/18/3f27aac6-a741-4758-9d6a-db67b05a63eb__hs2-create-table.json > HS2 Create Database > > https://reviews.apache.org/media/uploaded/files/2021/03/18/e0472b5d-3367-42d8-834a-7cfafa13aae6__hs2-create-db.json > HMS Create Database > > https://reviews.apache.org/media/uploaded/files/2021/03/18/bc34e035-f805-4ddd-abf3-a2b833ce3af0__hms-create-db.json > > > Thanks, > > Ashutosh Mestry > >
