Revision 30928
Added by Sandro La Bruzzo over 9 years ago
EnsureIndexJob.java | ||
---|---|---|
4 | 4 |
import org.apache.commons.logging.LogFactory; |
5 | 5 |
import org.springframework.beans.factory.annotation.Required; |
6 | 6 |
|
7 |
import eu.dnetlib.data.mdstore.MDStoreServiceException; |
|
7 | 8 |
import eu.dnetlib.data.mdstore.modular.connector.MDStoreDao; |
8 | 9 |
import eu.dnetlib.data.mdstore.modular.mongodb.MongoMDStore; |
9 | 10 |
import eu.dnetlib.enabling.tools.AbstractSchedulable; |
... | ... | |
18 | 19 |
protected void doExecute() { |
19 | 20 |
log.info("performing mdstore index check"); |
20 | 21 |
|
21 |
for (String mdId : getDao().listMDStores()) { |
|
22 |
try { |
|
23 |
log.info("ensureindex for mdStoreId:" + mdId); |
|
24 |
((MongoMDStore) getDao().getMDStore(mdId)).ensureIndices(); |
|
25 |
} catch (Throwable e) { |
|
26 |
log.warn("unable to reindex mdstore: " + mdId, e); |
|
22 |
try { |
|
23 |
for (String mdId : getDao().listMDStores()) { |
|
24 |
try { |
|
25 |
log.info("ensureindex for mdStoreId:" + mdId); |
|
26 |
((MongoMDStore) getDao().getMDStore(mdId)).ensureIndices(); |
|
27 |
} catch (Throwable e) { |
|
28 |
log.warn("unable to reindex mdstore: " + mdId, e); |
|
29 |
} |
|
27 | 30 |
} |
31 |
} catch (MDStoreServiceException e) { |
|
32 |
log.warn("unable to reindex mdstore ", e); |
|
28 | 33 |
} |
29 | 34 |
|
30 | 35 |
log.info("mdstore index check completed"); |
Also available in: Unified diff
implemented postgres mdstore, added some exception