Project

General

Profile

« Previous | Next » 

Revision 59405

Trying to avoid mdstore to store transaction of cancelled feeding

View differences:

MongoMDStore.java
23 23
import eu.dnetlib.data.mdstore.modular.RecordParser;
24 24
import eu.dnetlib.data.mdstore.modular.connector.MDStore;
25 25
import eu.dnetlib.enabling.resultset.ResultSetListener;
26
import eu.dnetlib.enabling.resultset.client.ResultSetClient;
26 27
import org.apache.commons.lang3.StringUtils;
27 28
import org.apache.commons.logging.Log;
28 29
import org.apache.commons.logging.LogFactory;
......
81 82
			while (true) {
82 83
				try {
83 84
					final Object record = queue.take();
85
					if(record == ResultSetClient.SENTINEL_PROC_CANCELED){
86
						//it means the wf was cancelled, so we must give this information back to the caller to avoid commit
87
						log.warn(String.format("Process cancelled after %d records, returning -1", count));
88
						return -1;
89
					}
84 90
					if (record == sentinel) {
85 91
						bulkWritesManager.flushBulks();
86 92
						break;

Also available in: Unified diff