Zookeeper
We use zookeeper to track locks between the autonomous components. To make zookeeper easier to use, we use the netflix curator api http://curator.incubator.apache.org/
Autonomous component locking procedure
Each of the autonomous components will exist as cron jobs. Periodically, often every minute or thereabouts, the cron job will activate. It will then follow the procedure below.
- Lock SBOI+component name
- query SBOI for batches
- For each returned batch
- Attempt to lock the batch+component name
- if successful, break loop
- unlock SBOI+component name
- Do work on locked batch (if any)
- store results in DOMS
- unlock locked batch
The specific lock paths are as follows
SBOI lock = "/SBOI/" + runnable.getComponentName();
batch lock = "/"+runnable.getComponentName() + "/B" + batch.getBatchID() + "-RT" + batch.getRoundTripNumber();