Merge remote-tracking branch 'upstream/collaborative' into caseEDT

This commit is contained in:
Ann Priestman 2015-07-17 11:06:33 -04:00
commit 7d02d97a82
3 changed files with 23 additions and 16 deletions

View File

@ -145,16 +145,18 @@ final class FileIngestPipeline {
*/
synchronized List<IngestModuleError> shutDown() {
List<IngestModuleError> errors = new ArrayList<>();
for (PipelineModule module : this.modules) {
try {
module.shutDown();
} catch (Throwable ex) { // Catch-all exception firewall
errors.add(new IngestModuleError(module.getDisplayName(), ex));
String msg = ex.getMessage();
// Jython run-time errors don't seem to have a message, but have details in toString.
if (msg == null)
msg = ex.toString();
MessageNotifyUtil.Notify.error(module.getDisplayName() + " Error", msg);
if(this.running == true){ // Don't shut down pipelines that never started
for (PipelineModule module : this.modules) {
try {
module.shutDown();
} catch (Throwable ex) { // Catch-all exception firewall
errors.add(new IngestModuleError(module.getDisplayName(), ex));
String msg = ex.getMessage();
// Jython run-time errors don't seem to have a message, but have details in toString.
if (msg == null)
msg = ex.toString();
MessageNotifyUtil.Notify.error(module.getDisplayName() + " Error", msg);
}
}
}
this.running = false;

View File

@ -126,11 +126,13 @@ final class FilesIdentifierIngestModule implements FileIngestModule {
*/
@Override
public void shutDown() {
if (refCounter.decrementAndGet(this.context.getJobId()) == 0) {
// Shutting down the last instance of this module for this ingest
// job, so discard the interesting file sets definitions snapshot
// for the job.
FilesIdentifierIngestModule.interestingFileSetsByJob.remove(this.context.getJobId());
if(context != null){
if (refCounter.decrementAndGet(this.context.getJobId()) == 0) {
// Shutting down the last instance of this module for this ingest
// job, so discard the interesting file sets definitions snapshot
// for the job.
FilesIdentifierIngestModule.interestingFileSetsByJob.remove(this.context.getJobId());
}
}
}
}

View File

@ -245,7 +245,7 @@ public final class KeywordSearchIngestModule implements FileIngestModule {
public void shutDown() {
logger.log(Level.INFO, "Instance {0}", instanceNum); //NON-NLS
if (initialized == false) {
if ((initialized == false) || (context == null)) {
return;
}
@ -314,6 +314,9 @@ public final class KeywordSearchIngestModule implements FileIngestModule {
synchronized(ingestStatus) {
Map<Long, IngestStatus> ingestStatusForJob = ingestStatus.get(jobId);
if(ingestStatusForJob == null){
return;
}
for (IngestStatus s : ingestStatusForJob.values()) {
switch (s) {
case TEXT_INGESTED: