You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by Sarath Subramanian <sa...@apache.org> on 2018/09/17 21:54:06 UTC

Review Request 68740: ATLAS-2874: Include handling of Atlas Entity Transformers in current Import logic

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68740/
-----------------------------------------------------------

Review request for atlas, Apoorv Naik, Ashutosh Mestry, Madhan Neethiraj, and Nixon Rodrigues.


Bugs: ATLAS-2874
    https://issues.apache.org/jira/browse/ATLAS-2874


Repository: atlas


Description
-------

Include handling of Atlas Entity Transformers implemented in ATLAS-2873 in current Import logic


Diffs
-----

  intg/src/main/java/org/apache/atlas/model/impexp/AtlasImportRequest.java f56fe2274 
  repository/src/main/java/org/apache/atlas/repository/impexp/ImportService.java a88ba2b86 
  repository/src/main/java/org/apache/atlas/repository/impexp/ZipSource.java bd51d3b38 


Diff: https://reviews.apache.org/r/68740/diff/1/


Testing
-------

curl -X POST -u admin:admin -H "Content-Type: multipart/form-data" -F request=@importTransformer.json -F data=@/root/exportData.zip http://localhost:21000/api/atlas/admin/import

importTransformer1.json
----------------------

{
  "options": {
    "transforms": "{ \"hive_table\": { \"qualifiedName\": [ \"replace:@cl1:@cl2\" ] }, \"hive_db\": { \"qualifiedName\": [ \"replace:@cl1:@cl2\" ] } }",
    "transformers": "[{\"conditions\":{\"hdfs_path.name\":\"STARTS_WITH: /tmp/aa/bb/\"},\"action\":{\"hdfs_path.name\":\"REPLACE_PREFIX: = :/tmp/aa/bb/=/tmp/xx/yy/\"}}]",
  }
}

importTransformer2.json
----------------------

{
  "options": {
    "transforms": "{ \"hive_table\": { \"qualifiedName\": [ \"replace:@cl1:@cl2\" ] }, \"hive_db\": { \"qualifiedName\": [ \"replace:@cl1:@cl2\" ] } }",
    "transformers": "[{\"conditions\":{\"hive_db.clusterName\":\"EQUALS: cl1\"},\"action\":{\"hive_db.clusterName\":\"SET: cl1_backup\"}}]"
  }
}


Thanks,

Sarath Subramanian


Re: Review Request 68740: ATLAS-2874: Include handling of Atlas Entity Transformers in current Import logic

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68740/#review208692
-----------------------------------------------------------


Fix it, then Ship it!





repository/src/main/java/org/apache/atlas/repository/impexp/ZipSource.java
Lines 143 (patched)
<https://reviews.apache.org/r/68740/#comment292821>

    "entityHandlers == null && " - is not needed, given line #141 above.


- Madhan Neethiraj


On Sept. 17, 2018, 9:54 p.m., Sarath Subramanian wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68740/
> -----------------------------------------------------------
> 
> (Updated Sept. 17, 2018, 9:54 p.m.)
> 
> 
> Review request for atlas, Apoorv Naik, Ashutosh Mestry, Madhan Neethiraj, and Nixon Rodrigues.
> 
> 
> Bugs: ATLAS-2874
>     https://issues.apache.org/jira/browse/ATLAS-2874
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> Include handling of Atlas Entity Transformers implemented in ATLAS-2873 in current Import logic
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/model/impexp/AtlasImportRequest.java f56fe2274 
>   repository/src/main/java/org/apache/atlas/repository/impexp/ImportService.java a88ba2b86 
>   repository/src/main/java/org/apache/atlas/repository/impexp/ZipSource.java bd51d3b38 
> 
> 
> Diff: https://reviews.apache.org/r/68740/diff/1/
> 
> 
> Testing
> -------
> 
> curl -X POST -u admin:admin -H "Content-Type: multipart/form-data" -F request=@importTransformer.json -F data=@/root/exportData.zip http://localhost:21000/api/atlas/admin/import
> 
> importTransformer1.json
> ----------------------
> 
> {
>   "options": {
>     "transforms": "{ \"hive_table\": { \"qualifiedName\": [ \"replace:@cl1:@cl2\" ] }, \"hive_db\": { \"qualifiedName\": [ \"replace:@cl1:@cl2\" ] } }",
>     "transformers": "[{\"conditions\":{\"hdfs_path.name\":\"STARTS_WITH: /tmp/aa/bb/\"},\"action\":{\"hdfs_path.name\":\"REPLACE_PREFIX: = :/tmp/aa/bb/=/tmp/xx/yy/\"}}]",
>   }
> }
> 
> importTransformer2.json
> ----------------------
> 
> {
>   "options": {
>     "transforms": "{ \"hive_table\": { \"qualifiedName\": [ \"replace:@cl1:@cl2\" ] }, \"hive_db\": { \"qualifiedName\": [ \"replace:@cl1:@cl2\" ] } }",
>     "transformers": "[{\"conditions\":{\"hive_db.clusterName\":\"EQUALS: cl1\"},\"action\":{\"hive_db.clusterName\":\"SET: cl1_backup\"}}]"
>   }
> }
> 
> 
> Thanks,
> 
> Sarath Subramanian
> 
>