[ 
https://issues.apache.org/jira/browse/ATLAS-1174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sarath Subramanian updated ATLAS-1174:
--------------------------------------
    Description: 
1. Introduce "typeVersion" attribute to all types in the type system, this 
helps to track the changes made to the default types out of the box (hive, 
sqoop, falcon and storm types) and user created types. If version is not 
mentioned during creation of a type, default version "1.0" is assigned 
(optional attribute).

2. Using the typeVersion attributed for types, introduce a patch framework for 
type system. This framework can be used during upgrade scenarios - like add new 
attributes to an existing types and will be run during startup of atlas. 

    The sequence of steps:

    a. During atlas startup, check $ATLAS_HOME/models/patches directory for any 
available patch files (json files). If there any patch files handle them.
    b. Sample patch json file looks like:
    {
      "patches": [
        { 
          "action": "ADD_ATTRIBUTE",
          "typeName": "hive_column",
          "applyToVersion": "1.0",
          "updateToVersion": "2.0",
          "actionParams": [
            { "name": "position",
              "dataTypeName": "int",
              "multiplicity": "optional",
              "isComposite": false,
              "isUnique": false,
              "isIndexable": false,
              "reverseAttributeName": null
            } ]
        } ]
    }

    c. The framework updates the type in "typeName" for the matching version 
number and after applying the patch "ADD_ATTRIBUTE" update the version to the 
one mentioned in "updateToVersion"
    d. The json file can have more than one action (array of actions)
    e. We can have multiple patch json files in the directory and they are 
applied in the sort order of the filename. eg:
        001-hive_column_add_position.json
        002-hive_column_add_anotherattribute.json

> Framework to apply updates to types in the type-system
> ------------------------------------------------------
>
>                 Key: ATLAS-1174
>                 URL: https://issues.apache.org/jira/browse/ATLAS-1174
>             Project: Atlas
>          Issue Type: New Feature
>            Reporter: Sarath Subramanian
>            Assignee: Sarath Subramanian
>
> 1. Introduce "typeVersion" attribute to all types in the type system, this 
> helps to track the changes made to the default types out of the box (hive, 
> sqoop, falcon and storm types) and user created types. If version is not 
> mentioned during creation of a type, default version "1.0" is assigned 
> (optional attribute).
> 2. Using the typeVersion attributed for types, introduce a patch framework 
> for type system. This framework can be used during upgrade scenarios - like 
> add new attributes to an existing types and will be run during startup of 
> atlas. 
>     The sequence of steps:
>     a. During atlas startup, check $ATLAS_HOME/models/patches directory for 
> any available patch files (json files). If there any patch files handle them.
>     b. Sample patch json file looks like:
>     {
>       "patches": [
>         { 
>           "action": "ADD_ATTRIBUTE",
>           "typeName": "hive_column",
>           "applyToVersion": "1.0",
>           "updateToVersion": "2.0",
>           "actionParams": [
>             { "name": "position",
>               "dataTypeName": "int",
>               "multiplicity": "optional",
>               "isComposite": false,
>               "isUnique": false,
>               "isIndexable": false,
>               "reverseAttributeName": null
>             } ]
>         } ]
>     }
>     c. The framework updates the type in "typeName" for the matching version 
> number and after applying the patch "ADD_ATTRIBUTE" update the version to the 
> one mentioned in "updateToVersion"
>     d. The json file can have more than one action (array of actions)
>     e. We can have multiple patch json files in the directory and they are 
> applied in the sort order of the filename. eg:
>         001-hive_column_add_position.json
>         002-hive_column_add_anotherattribute.json



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to