chetanmeh opened a new pull request #3814: wskadmin scala db command to export and import URL: https://github.com/apache/incubator-openwhisk/pull/3814 Adds `db` command support to export and import the db contents to scala based wskadmin impl (#3722) ## Description Current `wskadmin` support dumping the db content for various collections, views etc to file via `db` command ``` $ wskadmin db get -h usage: wskadmin db get [-h] [-v VIEW] [--docs] database positional arguments: database the database name optional arguments: -h, --help show this help message and exit -v VIEW, --view VIEW the view in the database to get --docs include document contents ``` This PR will support both `get` (export) and `put` (import) commands to admin tooling. ### Streaming IO The export and import support would make use of Akka Streams. For e.g. for exporting the json from CouchDB it would make use of [\_all_docs][1] endpoint which uses chunked transfer encoding. This logic is implemented in `CouchDBStreamingStore` which makes use of [Alpakka JSON Streaming][2] support to dump each json document as a single line The JSON dump file created via `get` would have a one json record per line and thus can again be consumed in a streaming way ## TODO - [ ] Export - Filter by view - [ ] Export - Attachments - [ ] Import ## Related issue and scope <!--- Please include a link to a related issue if there is one. --> - [ ] I opened an issue to propose and discuss this change (#????) ## My changes affect the following components <!--- Select below all system components are affected by your change. --> <!--- Enter an `x` in all applicable boxes. --> - [ ] API - [ ] Controller - [ ] Message Bus (e.g., Kafka) - [ ] Loadbalancer - [ ] Invoker - [ ] Intrinsic actions (e.g., sequences, conductors) - [ ] Data stores (e.g., CouchDB) - [ ] Tests - [ ] Deployment - [ ] CLI - [x] General tooling - [ ] Documentation ## Types of changes <!--- What types of changes does your code introduce? Use `x` in all the boxes that apply: --> - [ ] Bug fix (generally a non-breaking change which closes an issue). - [x] Enhancement or new feature (adds new functionality). - [ ] Breaking change (a bug fix or enhancement which changes existing behavior). ## Checklist: <!--- Please review the points below which help you make sure you've covered all aspects of the change you're making. --> - [x] I signed an [Apache CLA](https://github.com/apache/incubator-openwhisk/blob/master/CONTRIBUTING.md). - [x] I reviewed the [style guides](https://github.com/apache/incubator-openwhisk/wiki/Contributing:-Git-guidelines#code-readiness) and followed the recommendations (Travis CI will check :). - [x] I added tests to cover my changes. - [ ] My changes require further changes to the documentation. - [ ] I updated the documentation where necessary. [1]: http://docs.couchdb.org/en/2.0.0/api/database/bulk-api.html [2]: https://developer.lightbend.com/docs/alpakka/current/data-transformations/json.html#streaming-of-nested-structures
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
