----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/65412/#review196660 -----------------------------------------------------------
repository/src/main/java/org/apache/atlas/repository/impexp/ExportService.java Lines 253 (patched) <https://reviews.apache.org/r/65412/#comment276397> 'ret' gets reassigned in every iteration, making the earlier iteration result lost. - Madhan Neethiraj On Feb. 1, 2018, 10:16 p.m., Ashutosh Mestry wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/65412/ > ----------------------------------------------------------- > > (Updated Feb. 1, 2018, 10:16 p.m.) > > > Review request for atlas. > > > Bugs: ATLAS-2422 > https://issues.apache.org/jira/browse/ATLAS-2422 > > > Repository: atlas > > > Description > ------- > > **Background** > Existing implementation of _ExportService_, uses the starting entity that is > fetched using a gremlin query. This implementation expands on that. > > **Approach** > - Additional query (switch-case) added to _AtlasGremlinQueryProvider_. > - Modify _ExportService_ to process additional flavor of starting entity by > looking at the new option specified in _AtlasExportRequest_. > > **Usage** > Note the _typeName_ and _options_ parameters. > > Contents of _exportRequest.json_: > ``` > {"itemsToExport": [ { "typeName": "hive_db,hdfs_path" } ], "options": { > "fetchType": "FULL", "matchType": "forType"}} > > ``` > CURL: > ``` > curl -X POST -u admin:admin -H "Content-Type: application/json" -H > "Cache-Control: no-cache" -d @../docs/exportRequest.json > http://localhost:21000/api/atlas/admin/export > ../docs/full-export.zip > ``` > > Import is not impacted. > ``` > curl -X POST -u admin:admin -H "Content-Type: multipart/form-data" -H > "Cache-Control: no-cache" -F data=@../docs/full-export.zip > http://localhost:21000/api/atlas/admin/import > ``` > > > Diffs > ----- > > intg/src/main/java/org/apache/atlas/model/impexp/AtlasExportRequest.java > a015e9bf > > repository/src/main/java/org/apache/atlas/repository/impexp/ExportService.java > a88c09e8 > > repository/src/main/java/org/apache/atlas/util/AtlasGremlin2QueryProvider.java > 9cffdb9d > > repository/src/main/java/org/apache/atlas/util/AtlasGremlinQueryProvider.java > e4898bde > > repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java > 7901ef68 > > repository/src/test/java/org/apache/atlas/repository/impexp/ImportServiceReportingTest.java > 0aaaa704 > > repository/src/test/java/org/apache/atlas/repository/impexp/ImportServiceTestUtils.java > 72895125 > > > Diff: https://reviews.apache.org/r/65412/diff/2/ > > > Testing > ------- > > **Unit test** > - Added new test to verify the behavior. > > > **Functional test** > - Via CURL calls. > > **Accuracy testing** > - Using Export-import-export compare. > > > File Attachments > ---------------- > > Export 1 > > https://reviews.apache.org/media/uploaded/files/2018/01/30/813f8af8-8b38-4896-8f6b-dc72c3652d3e__full-export-pre.zip > Export After Import > > https://reviews.apache.org/media/uploaded/files/2018/01/30/967aff68-2320-4f85-b10e-9500060ae118__full-export-post.zip > > > Thanks, > > Ashutosh Mestry > >
