Search in sources :

Example 6 with JobCatalogListener

use of org.apache.gobblin.runtime.api.JobCatalogListener 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);
        }
    }
}
Also used : JobCatalogListener(org.apache.gobblin.runtime.api.JobCatalogListener) JobSpec(org.apache.gobblin.runtime.api.JobSpec)

Aggregations

JobCatalogListener (org.apache.gobblin.runtime.api.JobCatalogListener)6 JobSpec (org.apache.gobblin.runtime.api.JobSpec)6 Test (org.testng.annotations.Test)5 URI (java.net.URI)4 PrintWriter (java.io.PrintWriter)2 Hashtable (java.util.Hashtable)2 Properties (java.util.Properties)2 ResolvedJobSpec (org.apache.gobblin.runtime.job_spec.ResolvedJobSpec)2 Path (org.apache.hadoop.fs.Path)2 InvocationOnMock (org.mockito.invocation.InvocationOnMock)2 JobSpecNotFoundException (org.apache.gobblin.runtime.api.JobSpecNotFoundException)1 PathAlterationObserver (org.apache.gobblin.util.filesystem.PathAlterationObserver)1