
com.hazelcast.mapreduce.TrackableJob Maven / Gradle / Ivy
/*
* Copyright (c) 2008-2016, Hazelcast, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hazelcast.mapreduce;
import com.hazelcast.core.ICompletableFuture;
import com.hazelcast.spi.annotation.Beta;
/**
* This interface describes a trackable job. In the default implementation,
* the internal assigned operation processor is a TrackableJob, so the process
* can be watched while processing.
* To request the TrackableJob of a map reduce job, you can use the following code snippet.
*
* JobTracker tracker = hazelcastInstance.getJobTracker(...);
* Job job = tracker.newJob(...);
* // ...
* JobCompletableFuture future = job.submit();
* String jobId = future.getJobId();
* TrackableJob trackableJob = tracker.getTrackableJob(jobId);
*
*
* @param type of the returning value
* @since 3.2
*/
@Beta
public interface TrackableJob {
/**
* Returns the assigned {@link JobTracker}
*
* @return assigned JobTracker
*/
JobTracker getJobTracker();
/**
* Returns the name of the underlying {@link JobTracker}
*
* @return name of the JobTracker
*/
String getName();
/**
* Returns the unique job id of the tracked job
*
* @return job id of the tracked job
*/
String getJobId();
/**
* Returns the {@link com.hazelcast.core.ICompletableFuture} to add callbacks
* or wait for the resulting value of the tracked job.
*
* @return ICompletableFuture of the tracked job
*/
ICompletableFuture getCompletableFuture();
/**
* Returns an instance of {@link com.hazelcast.mapreduce.JobProcessInformation} to find out the state and
* statistics of a running task, or returns null if the underlying job id is not available because the job is already
* finished or has not yet been submitted.
* It returns null if not requested on the job issuing cluster member or client, since those values are
* not distributed to all clusters for traffic reasons.
*
* @return instance of the job process information, or null if job id is not available
*/
JobProcessInformation getJobProcessInformation();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy