use of org.apache.gobblin.runtime.api.JobSpec in project incubator-gobblin by apache.
the class JobCatalogBase method addListener.
/**
*{@inheritDoc}
*/
@Override
public synchronized void addListener(JobCatalogListener jobListener) {
Preconditions.checkNotNull(jobListener);
this.listeners.addListener(jobListener);
if (state() == State.RUNNING) {
for (JobSpec jobSpec : getJobsWithTimeUpdate()) {
JobCatalogListener.AddJobCallback addJobCallback = new JobCatalogListener.AddJobCallback(jobSpec);
this.listeners.callbackOneListener(addJobCallback, jobListener);
}
}
}
use of org.apache.gobblin.runtime.api.JobSpec in project incubator-gobblin by apache.
the class MutableJobCatalogBase method remove.
@Override
public void remove(URI uri) {
Preconditions.checkState(state() == State.RUNNING, String.format("%s is not running.", this.getClass().getName()));
Preconditions.checkNotNull(uri);
JobSpec jobSpec = doRemove(uri);
if (null != jobSpec) {
this.listeners.onDeleteJob(jobSpec.getUri(), jobSpec.getVersion());
}
}
Aggregations