- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How Atlas know that Table is created in Hive
- Labels:
-
Apache Atlas
Created ‎05-29-2017 09:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I know that Atlas did it automatically when we make necessary configurations for import-hive.sh etc files. But I want to know internal working of Atlas. What happens behind the scene. Which class/module is invoked/involved?
Created ‎05-29-2017 01:07 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Atlas Hive Hook in configured in Hive by set-up in hive-site.xml.
<property> <name>hive.exec.post.hooks</name> <value>org.apache.atlas.hive.hook.HiveHook</value> </property>
whenever a table is created in hive, a event is triggered which invokes the atlas hive hook. This hook sends message to Atlas via notification to kafka, The notification in kafka is consumed by Atlas and hive entity is created.
Refer:-
Created ‎05-29-2017 01:07 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Atlas Hive Hook in configured in Hive by set-up in hive-site.xml.
<property> <name>hive.exec.post.hooks</name> <value>org.apache.atlas.hive.hook.HiveHook</value> </property>
whenever a table is created in hive, a event is triggered which invokes the atlas hive hook. This hook sends message to Atlas via notification to kafka, The notification in kafka is consumed by Atlas and hive entity is created.
Refer:-
Created ‎05-29-2017 01:23 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
cool. So what type of information Hook gets from Hive and how? I basically wants to know that. Did Hook query Hive to know information?
Created ‎05-30-2017 06:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Following information is passed from Hive to Atlas-Hive Hook from Hive whenever any DML statement is executed when Atlas Hive hook is configured.
final HiveEventContext event = new HiveEventContext(); event.setInputs(hookContext.getInputs()); event.setOutputs(hookContext.getOutputs()); event.setHookType(hookContext.getHookType()); final UserGroupInformation ugi = hookContext.getUgi() == null ? Utils.getUGI() : hookContext.getUgi(); event.setUgi(ugi); event.setUser(getUser(hookContext.getUserName(), hookContext.getUgi())); event.setOperation(OPERATION_MAP.get(hookContext.getOperationName())); event.setQueryId(hookContext.getQueryPlan().getQueryId()); event.setQueryStr(hookContext.getQueryPlan().getQueryStr()); event.setQueryStartTime(hookContext.getQueryPlan().getQueryStartTime()); event.setQueryType(hookContext.getQueryPlan().getQueryPlan().getQueryType()); event.setLineageInfo(hookContext.getLinfo());
Created ‎05-30-2017 08:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This means Hive will automatically notify Atlas. What if I have MySQL instead of Hive. I am sure MySQL will not notify like Hive. Right? If yes then what can be done to achieve notification in case of MySQL?
Created ‎05-30-2017 06:14 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Muhammad Imran Tariq, You are right MySQL will not notify like Hive, check if MySql has any mechanism to invoke the class / method when there is a change in metadata.
Do share your findings
Nixon
Created ‎06-06-2017 04:59 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
https://dev.mysql.com/doc/refman/5.7/en/writing-plugins.html
MySQL does offer capability to write plugins which might offer similar functionality as the Hive|AtlasHook.
