Revision 59415
Added by Claudio Atzori over 3 years ago
MDStoreFeeder.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.data.mdstore.modular; |
2 | 2 |
|
3 | 3 |
import com.google.common.collect.Maps; |
4 |
import com.googlecode.sarasvati.GraphProcess; |
|
4 | 5 |
import eu.dnetlib.data.mdstore.MDStoreServiceException; |
5 | 6 |
import eu.dnetlib.data.mdstore.modular.action.DoneCallback; |
6 | 7 |
import eu.dnetlib.data.mdstore.modular.action.FailedCallback; |
... | ... | |
34 | 35 |
final String storingType, |
35 | 36 |
final boolean sync, |
36 | 37 |
final List<MDFormatDescription> mdformats, |
38 |
final GraphProcess graphProcess, |
|
37 | 39 |
final DoneCallback doneCallback, |
38 | 40 |
final FailedCallback failCallback) throws MDStoreServiceException { |
39 |
log.info("Start feeding mdstore " + mdId); |
|
41 |
|
|
40 | 42 |
log.debug("Start feeding mdstore " + mdId + " with epr " + rsEpr); |
41 | 43 |
|
42 | 44 |
String transactionId = null; |
... | ... | |
60 | 62 |
writeOps = mdstore.feed(records, refresh, mdformats); |
61 | 63 |
} |
62 | 64 |
|
63 |
if(writeOps == -1){
|
|
65 |
if(graphProcess.isCanceled()){
|
|
64 | 66 |
//means the process was cancelled, so we must not commit |
65 | 67 |
log.warn(String.format("The feeding process on mdstore %s has been cancelled. Records will not be committed. Transaction %s set as invalid.", mdId, transactionId)); |
66 | 68 |
dao.invalidTransaction(transactionId, mdId); |
Also available in: Unified diff
making the mdstore feed action aware of the workflow process registry to handle workflow kills