Search in sources :

Example 1 with UnpublishedHandling

use of org.apache.gobblin.publisher.UnpublishedHandling in project incubator-gobblin by apache.

the class SafeDatasetCommit method checkForUnpublishedWUHandling.

void checkForUnpublishedWUHandling(String datasetUrn, JobState.DatasetState datasetState, Class<? extends DataPublisher> dataPublisherClass, Closer closer) throws ReflectiveOperationException, IOException {
    if (UnpublishedHandling.class.isAssignableFrom(dataPublisherClass)) {
        // pass in jobstate to retrieve properties
        DataPublisher publisher = closer.register(DataPublisher.getInstance(dataPublisherClass, this.jobContext.getJobState()));
        log.info(String.format("Calling publisher to handle unpublished work units for dataset %s of job %s.", datasetUrn, this.jobContext.getJobId()));
        ((UnpublishedHandling) publisher).handleUnpublishedWorkUnits(datasetState.getTaskStatesAsWorkUnitStates());
    }
}
Also used : UnpublishedHandling(org.apache.gobblin.publisher.UnpublishedHandling) DataPublisher(org.apache.gobblin.publisher.DataPublisher)

Aggregations

DataPublisher (org.apache.gobblin.publisher.DataPublisher)1 UnpublishedHandling (org.apache.gobblin.publisher.UnpublishedHandling)1