Revision 53498
Added by Michele Artini over 5 years ago
FixRepoMdstoreSizesJobNode.java | ||
---|---|---|
14 | 14 |
import org.apache.commons.io.IOUtils; |
15 | 15 |
import org.apache.commons.lang.math.NumberUtils; |
16 | 16 |
import org.apache.commons.lang3.StringUtils; |
17 |
import org.apache.commons.logging.Log; |
|
18 |
import org.apache.commons.logging.LogFactory; |
|
17 | 19 |
import org.dom4j.Document; |
18 | 20 |
import org.dom4j.DocumentException; |
19 | 21 |
import org.dom4j.io.SAXReader; |
... | ... | |
64 | 66 |
|
65 | 67 |
private boolean alwaysUpdate = false; |
66 | 68 |
|
69 |
private static final Log log = LogFactory.getLog(FixRepoMdstoreSizesJobNode.class); |
|
70 |
|
|
67 | 71 |
public void init(final int total) { |
68 | 72 |
this.current = 0; |
69 | 73 |
this.total = total; |
... | ... | |
78 | 82 |
init(list.size()); |
79 | 83 |
|
80 | 84 |
for (final String dsId : list) { |
85 |
log.info("Processing ds: " + dsId); |
|
86 |
|
|
81 | 87 |
current++; |
82 | 88 |
try { |
83 | 89 |
for (final Api<ApiParam> api : dsManager.getApis(dsId)) { |
84 | 90 |
verifyApi(dsId, api); |
85 | 91 |
} |
86 | 92 |
} catch (final Throwable e) { |
93 |
log.error("Error processing ds: " + dsId, e); |
|
87 | 94 |
token.getEnv().setAttribute(WorkflowsConstants.SYSTEM_ERROR + "::" + dsId, e.getMessage()); |
88 | 95 |
} |
89 | 96 |
} |
... | ... | |
99 | 106 |
final int actualSize = NumberUtils.toInt(doc.valueOf("//NUMBER_OF_RECORDS"), 0); |
100 | 107 |
final int size = mdstoreDao.getMDStore(mdId).getSize(); |
101 | 108 |
if (alwaysUpdate || size != actualSize) { |
109 |
log.info(" -- Updating size of api " + api.getId() + ", new value = " + size); |
|
102 | 110 |
updateMdStoreProfile(mdId, doc, size); |
103 | 111 |
dsManager.setLastCollectionInfo(dsId, api.getId(), mdId, size, calculateLastDate(doc)); |
104 | 112 |
} |
Also available in: Unified diff
Added logs