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

Mohammad Kamrul Islam commented on OOZIE-561:
---------------------------------------------

High-level Design:

1)      User specifications: User will specify a dataset by providing the 
following information 
   a)   HCatalog server endpoint (e,g, host:port) (Optional, default  is in 
Oozie).
   b)   Database name (default in Oozie system?)
   c)   Table name.
   d)   One or more partition key-value pairs. This value could be 
parameterized by common constants like YEAR, MONTH, DAY, HOUR, MINUTE as being 
used for directory based data.
   e)   Example 
<dataset name=”my_ds” initial-instance=”DateStamp”  frequency=days(1)>
            <uri-template> hcat://[HcatServer:Port]/db/mydb/table/clicks/? 
datestamp=$YEAR$MONTH$DAY$HOUR;region=us</uri-template> 
</dataset>  <PLEASE COMMENTS ....>
2)      Dependency Map: This is an Oozie’s internal data structure. That will 
maintain all the partition-based (could be extended to directory based too) 
data dependencies. There will be a separate map for each hcat-server/db/table. 
Access to map needs to be synchronized. Each map entry will contains the 
following information:
     a) Partition key-value pairs as key
     b) List Coordinator action ids
     c) Last modified timestamp.
IMPORTANT: This is critical for this design. We need scalability or faster 
access. At the same time, we need to consider how to manage or recover for 
failure cases. Any other idea?


3)      Start-up: When a coordinator action is materialized/created, Oozie will 
perform the followings:
    a)  At first, for each dependent partition, add an entry in the 
dependencyMap (if the entry for ‘data’ doesn’t exist). If it already exists in 
the dependencyMap, it will add the coordinator action id in the value. The 
dependencyMap will keep the list of missing data and the associated coordinator 
action ids.
    b)  Oozie will register to the JMS Notification system for the specific 
table/topic, (if it is not already done).  How to register a topic: 
http://twiki.corp.yahoo.com/view/Grid/HCatNotification
   c)   Oozie will directly query HCatalog/Metastore about the existence of 
partition (Cold-Start). If HCatalog ensures the existence of data, Oozie will 
update the dependencyMap and database record(s)) accordingly. 
   d)   If a partition is not found, Oozie will wait for the notification. 
4)      JMS notification received: When a notification for a specific 
table/topic is received, Oozie will do the followings:
   a)   Retrieve the partitions from the notification message.
   b)   Remove the entry associated with the partitions for the dependencyMap.
   c)    Update the corresponding coordinator ids synchronously in the 
database. A new command class is needed.
5)      All dependencies met: If all dependencies of any coordinator action are 
fulfilled, Oozie will move the action’s status from WAITING to READY. New 
command class might be needed.
6)      Fall-back: Oozie will periodically (configurable value) query the 
HCatalog for the existence of the entries in the dependecyMap and update the DB 
accordingly. (Recovery/ FALL-BACK)
7)      Bootstrapping: When Oozie starts, it needs to find all coordinator 
actions that are in WAITING state and needs to follow the step 2.
8)      Table Modifications: Oozie will need to add a separate column in 
coordinator action’s table to store the missing table-partition dependencies.  







Detailed design:
==================
A)      Table Schema Change: Create a new column called MD_missingDependency of 
type BLOB in table COORD_ACTIONS. Needs to modify CoorinatorAction  and 
JsonCoordinatorAction class.
B)      Missing Dependency Service: Create a new service class to manage  the 
dependency map and its modifications. The class should provide a way to 
add/delete/update an entry like (Server/DB/Table/Partition(s) → (coordinator 
Id, Last Modified Time). Probable map classes are HashMap/ ConcurrentHashMap.  
This class needs to efficient and scalable to handle a lot of requests 
simultaneously. Need to consider the max Map size.
C)      Metadata Accessor Service:  A new class to access to HCatalog/Meta 
store service using Java API. All HCatalog communication including security 
checks should be done through this class. Need to consider doAs().
D)      JMS Message Subscriber Service: This class will handle all the 
registrations and subsequent messages sent from HCatalog. This class should be 
as thin as possible.
E)      Improved Recovery Service: Modify the existing recovery service to 
handle the fallback process. If a data is waiting in the dependency map list 
for more a 20 minutes (say, configurable through site xml) without any update, 
the recovery service will directly call to HCatalog using 
MetadataAccessorService.
F)      Cold start: Missing dependency service will store all the partition 
dependencies from COORD_ACTIONs table and store it into the map. A new class 
CoordMetaDataInputcheckCommand could achieve this.  In addition, Recovery 
service will periodically checks the waiting coordinator actions with partition 
based dependency in the COORD_ACTIONS table and will ensure the waiting 
dependencies are stored into dependency Map. 
G)       CLI change: Oozie CLI needs to show the partition dependencies as part 
of missing dependency.
H)      UpdateDepenedcyCommand : This class will update the table when a new 
dependency is met through JMS message or Fall Back or Cold Start process.  When 
all the data dependencies are met, this class will queue the 
CoordinatorReadyCommand and changed the status from WAITING to READY.
I)      Parser : URI parser
J)      New EL functions: To access table name name, dbname filter etc.  


                
> Integrate Oozie with HCatalog
> -----------------------------
>
>                 Key: OOZIE-561
>                 URL: https://issues.apache.org/jira/browse/OOZIE-561
>             Project: Oozie
>          Issue Type: New Feature
>            Reporter: Santhosh Srinivasan
>            Assignee: Mona Chitnis
>
> With the incubation of HCatalog, we have a mechanism to abstract data and 
> storage on HDFS. A natural progression for Oozie is to interact with HCatalog 
> to facilitate the interplay between MapReduce, Pig and Hive. In addition, the 
> support for notification in HCatalog will alleviate (and not eliminate) the 
> need to poll HDFS for data sets represented as tables and partitions.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to