Swift is becoming the datastore pivot to import models generated from the analytics cluster to production (T219544).
As we need to move suggestions generated by glent (T212888) from hadoop to elasticsearch we will investigate using swift instead of kafka (as we used in the past).
This task is to track the work on the production side: import data from swift to elasticsearch.
Assuming that swift contains a list of json files to import and we are given a folder to read:
- list all files in the folder
- select the last one (there will be some naming convention)
- check that a new index needs to be created
- create a index based on the data filename using a very simple mapping
- pull data from swift using MW classes (FileBackendStore?) and import to elastic using the bulk API
- switch the index alias to the new index
- delete the old index