Get Rollup Job API

The Get Rollup Job API can be used to get one or all rollup jobs from the cluster. It accepts a GetRollupJobRequest object as a request and returns a GetRollupJobResponse.

Get Rollup Job Request

A GetRollupJobRequest can be built without any parameters to get all of the rollup jobs or with a job name to get a single job:

GetRollupJobRequest getAll = new GetRollupJobRequest();        
GetRollupJobRequest getJob = new GetRollupJobRequest("job_1"); 

Gets all jobs.

Gets job_1.

Execution

The Get Rollup Job API can be executed through a RollupClient instance. Such instance can be retrieved from a RestHighLevelClient using the rollup() method:

GetRollupJobResponse response = client.rollup().getRollupJob(getJob, RequestOptions.DEFAULT);

Response

The returned GetRollupJobResponse includes a JobWrapper per returned job which contains the configuration of the job, the job’s current status, and statistics about the job’s past execution.

assertThat(response.getJobs(), hasSize(1));
JobWrapper job = response.getJobs().get(0); 
RollupJobConfig config = job.getJob();
RollupJobStatus status = job.getStatus();
RollupIndexerJobStats stats = job.getStats();

We only asked for a single job

Asynchronous Execution

This request can be executed asynchronously:

client.rollup().getRollupJobAsync(getJob, RequestOptions.DEFAULT, listener); 

The GetRollupJobRequest to execute and the ActionListener to use when the execution completes

The asynchronous method does not block and returns immediately. Once it is completed the ActionListener is called back using the onResponse method if the execution successfully completed or using the onFailure method if it failed.

A typical listener for GetRollupJobResponse looks like:

ActionListener<GetRollupJobResponse> listener = new ActionListener<GetRollupJobResponse>() {
    @Override
    public void onResponse(GetRollupJobResponse response) {
        
    }

    @Override
    public void onFailure(Exception e) {
        
    }
};

Called when the execution is successfully completed. The response is provided as an argument

Called in case of failure. The raised exception is provided as an argument