Job Executor let's you execute a Job with a given JobId and a UserName.
#Assumptions:
- It is possible to have multiple Job Executors can run for a given Application- this is to allow a use case specific ExecutorService per Job Executor
- If only ONE Job Executor is needed, the design will be slightly different, by using the right creational pattern for the JobExecutor AND the map of current running jobs
- ONLY one instance of a given JobId can run at any time
- If a user attempts to execute a current running job, the current userName associated with the job is returned
- This is a low throughput executor, uses the same lock for reads and writes
- runningJobsMap : holds a map of jobId and jobStatus for jobs currently running.
- Note that we are using a HashMap instead of a ConcurrentHashMap, to enable blocking read-writes.
- A case specific Executor service can be injected into the Job Executor to run jobs
- The executor uses a ReentrantLock to keep the reads and writes to the map atomic.
JavaDocs are located at :
site/apidocs/index.html
Just run:
mvn clean install
To execute all the unit tests, run:
mvn test