Revision 53486
Added by Michele Artini over 5 years ago
FixRepoMdstoreSizesJobNode.java | ||
---|---|---|
62 | 62 |
private ISRegistryService registry; |
63 | 63 |
private ISLookUpService lookup; |
64 | 64 |
|
65 |
private boolean alwaysUpdate = false; |
|
66 |
|
|
65 | 67 |
public void init(final int total) { |
66 | 68 |
this.current = 0; |
67 | 69 |
this.total = total; |
... | ... | |
96 | 98 |
final String mdId = doc.valueOf("//RESOURCE_IDENTIFIER/@value"); |
97 | 99 |
final int actualSize = NumberUtils.toInt(doc.valueOf("//NUMBER_OF_RECORDS"), 0); |
98 | 100 |
final int size = mdstoreDao.getMDStore(mdId).getSize(); |
99 |
if (size != actualSize) { |
|
101 |
if (alwaysUpdate || size != actualSize) {
|
|
100 | 102 |
updateMdStoreProfile(mdId, doc, size); |
101 | 103 |
dsManager.setLastCollectionInfo(dsId, api.getId(), mdId, size, calculateLastDate(doc)); |
102 | 104 |
} |
... | ... | |
106 | 108 |
final String mdId = doc.valueOf("//RESOURCE_IDENTIFIER/@value"); |
107 | 109 |
final int actualSize = NumberUtils.toInt(doc.valueOf("//NUMBER_OF_RECORDS"), 0); |
108 | 110 |
final int size = mdstoreDao.getMDStore(mdId).getSize(); |
109 |
if (size != actualSize) { |
|
111 |
if (alwaysUpdate || size != actualSize) {
|
|
110 | 112 |
updateMdStoreProfile(mdId, doc, size); |
111 | 113 |
dsManager.setLastAggregationInfo(dsId, api.getId(), mdId, size, calculateLastDate(doc)); |
112 | 114 |
} |
... | ... | |
116 | 118 |
final String objId = doc.valueOf("//RESOURCE_IDENTIFIER/@value"); |
117 | 119 |
final int actualSize = NumberUtils.toInt(doc.valueOf("//STORE_SIZE"), 0); |
118 | 120 |
final int size = objectStoreDao.getObjectStore(objId).getSize(); |
119 |
if (size != actualSize) { |
|
121 |
if (alwaysUpdate || size != actualSize) {
|
|
120 | 122 |
updateObjStoreProfile(objId, doc, size); |
121 | 123 |
dsManager.setLastDownloadInfo(dsId, api.getId(), objId, size, calculateLastDate(doc)); |
122 | 124 |
} |
... | ... | |
187 | 189 |
return false; |
188 | 190 |
} |
189 | 191 |
|
192 |
public boolean isAlwaysUpdate() { |
|
193 |
return alwaysUpdate; |
|
194 |
} |
|
195 |
|
|
196 |
public void setAlwaysUpdate(final boolean alwaysUpdate) { |
|
197 |
this.alwaysUpdate = alwaysUpdate; |
|
198 |
} |
|
199 |
|
|
190 | 200 |
} |
Also available in: Unified diff
added a condition to reduce the number of updates