Add isCancelled to IngestJob.DataSourceIngestModuleHandle

This commit is contained in:
Richard Cordovano 2014-12-18 13:04:15 -05:00
parent 2a84b56689
commit 1eef4f10c6

View File

@ -257,6 +257,7 @@ public final class IngestJob {
private final DataSourceIngestJob job; private final DataSourceIngestJob job;
private final DataSourceIngestPipeline.PipelineModule module; private final DataSourceIngestPipeline.PipelineModule module;
private final boolean cancelled;
/** /**
* Constructs a handle to a data source level ingest module that can be * Constructs a handle to a data source level ingest module that can be
@ -270,6 +271,7 @@ public final class IngestJob {
private DataSourceIngestModuleHandle(DataSourceIngestJob job, DataSourceIngestPipeline.PipelineModule module) { private DataSourceIngestModuleHandle(DataSourceIngestJob job, DataSourceIngestPipeline.PipelineModule module) {
this.job = job; this.job = job;
this.module = module; this.module = module;
this.cancelled = job.currentDataSourceIngestModuleIsCancelled();
} }
/** /**
@ -283,7 +285,7 @@ public final class IngestJob {
} }
/** /**
* Returns the time the data source level ingest module associated with * Gets the time the data source level ingest module associated with
* this handle began processing. * this handle began processing.
* *
* @return The module processing start time. * @return The module processing start time.
@ -292,6 +294,16 @@ public final class IngestJob {
return this.module.getProcessingStartTime(); return this.module.getProcessingStartTime();
} }
/**
* Queries whether or not cancellation of the data source level ingest
* module associated with this handle has been requested.
*
* @return True or false.
*/
public boolean isCancelled() {
return this.cancelled;
}
/** /**
* Requests cancellation of the ingest module associated with this * Requests cancellation of the ingest module associated with this
* handle. Returns immediately, but there may be a delay before the * handle. Returns immediately, but there may be a delay before the