Revision 37139
Added by Andrea Mannocci over 9 years ago
modules/dnet-openaireplus-workflows/trunk/src/main/java/eu/dnetlib/msro/openaireplus/workflows/nodes/dataFlowMonitoring/TriggerPrepublicMonitoringScenarioJobNode.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.msro.openaireplus.workflows.nodes.dataFlowMonitoring; |
2 | 2 |
|
3 | 3 |
import java.io.IOException; |
4 |
import java.util.HashMap; |
|
5 | 4 |
import java.util.List; |
6 | 5 |
|
7 | 6 |
import javax.annotation.Resource; |
8 | 7 |
|
9 |
import org.apache.commons.io.IOUtils; |
|
10 | 8 |
import org.apache.commons.logging.Log; |
11 | 9 |
import org.apache.commons.logging.LogFactory; |
12 | 10 |
|
13 |
import com.google.gson.Gson; |
|
14 | 11 |
import com.googlecode.sarasvati.Arc; |
15 | 12 |
import com.googlecode.sarasvati.NodeToken; |
16 | 13 |
|
... | ... | |
21 | 18 |
import eu.dnetlib.monitoring.core.sensors.collection.SensorWrapper; |
22 | 19 |
import eu.dnetlib.monitoring.core.sensors.collection.index.solr.SolrSensor; |
23 | 20 |
import eu.dnetlib.monitoring.core.sensors.collection.kv.redis.RedisSensor; |
24 |
import eu.dnetlib.monitoring.model.SensorConfiguration; |
|
25 | 21 |
import eu.dnetlib.msro.workflows.nodes.SimpleJobNode; |
26 | 22 |
|
27 | 23 |
public class TriggerPrepublicMonitoringScenarioJobNode extends SimpleJobNode { |
... | ... | |
68 | 64 |
|
69 | 65 |
private String evaluateCurrentSolrCollection() throws ISLookUpException { |
70 | 66 |
List<String> list = serviceLocator.getService(ISLookUpService.class).quickSearchProfile(solrXquery); |
71 |
if (list.size() != 1) { throw new ISLookUpException("Exactly one collection in SOLR should be the public one!"); } |
|
67 |
if (list.size() != 1) { |
|
68 |
log.warn("Please check the query: \n" + solrXquery + "\n returns " + list.size() + " elements"); |
|
69 |
} |
|
72 | 70 |
if (SolrCollections.TMF.equals(list.get(0))) { |
73 | 71 |
return SolrCollections.DMF + SOLR_COLLECTION_POSTFIX; |
74 | 72 |
} else { |
Also available in: Unified diff
fixed selection of SOLR collection within data flow monitoring job node