This week was quite a busy one as most of the development for the first deliverable (next week) took place during this time.
Firstly, we should be aware why are we developing an alternative database using ElasticSearch. The main reason we are having huge amounts of data coming every day which itself a large number of parameters. So, using ES is quite beneficial here since we can create indexes on a daily/monthly basis and also query the same with more flexibility than MySQL.
I was majorly focussed and covered the following tasks:
Firstly, we should be aware why are we developing an alternative database using ElasticSearch. The main reason we are having huge amounts of data coming every day which itself a large number of parameters. So, using ES is quite beneficial here since we can create indexes on a daily/monthly basis and also query the same with more flexibility than MySQL.
I was majorly focussed and covered the following tasks:
- Create a wrapper over the ElasticSearchDB.py for JobParameters with methods: 'get' and 'set'.
- The function 'get' majorly handles the fetching of the parameters from the ElasticSearch (ES) backend using the ElasticSearch-py API 'query'. The function takes in a jobID (which is like a primary key, though no keys in ES) and an optional list of names if needed to query the ES.
- The function 'set' is used to update or insert the values of JobParameters in the ES backend using the ES-python APIs 'update-by-query' and 'index'. First priority would be to first find whether the given jobID exists and if not found it is inserted to ES index.
- Add a flag in the JobMonitoringHandler to activate ElasticSearch backend as mentioned in the configuration file 'dirac.cfg'.
- The basic operation is to read the flag 'useES' from the configuration file (introduced now) and based on its bool value, activate the backend.
- Add an update method to the ElasticSearchDB.py which was initially not present. It is a wrapper over the ES-python APIs 'update-by-query' and 'index' so that the functions outside the script can't access the ES-py module directly.
This was all done for this week and a commit was made with respect to the same. Find the commit here. Tasks can be tracked for the next in the task manager (check sidebar).
Comments
Post a Comment