Revision 8592
Added by Peter Slaughter almost 11 years ago
src/edu/ucsb/nceas/metacat/dataone/SyncAccessPolicy.java | ||
---|---|---|
111 | 111 |
|
112 | 112 |
try { |
113 | 113 |
cn = D1Client.getCN(); |
114 |
logMetacat.debug("Will sync access policies to CN id: " + cn.getNodeId() + " with info: " + cn.toString()); |
|
114 |
logMetacat.debug("Will sync access policies to CN id: " |
|
115 |
+ cn.getNodeId() + " with info: " + cn.toString()); |
|
115 | 116 |
} catch (ServiceFailure sf) { |
116 | 117 |
logMetacat |
117 | 118 |
.error("Unable to get Coordinating node name for this MN"); |
... | ... | |
188 | 189 |
+ pid.getValue() |
189 | 190 |
+ " Service failure: " |
190 | 191 |
+ sf.getMessage()); |
192 |
sf.printStackTrace(); |
|
193 |
logMetacat.debug("Cause: " + sf.getCause()); |
|
191 | 194 |
// throw sf; |
192 | 195 |
continue; |
193 | 196 |
} catch (Exception e) { |
... | ... | |
343 | 346 |
objectFormatId, replicaStatus, start, count); |
344 | 347 |
|
345 | 348 |
logMetacat.debug("syncTask total # of guids: " |
346 |
+ objsToSync.getTotal() + ", count for this page: " + objsToSync.getCount()); |
|
349 |
+ objsToSync.getTotal() + ", count for this page: " |
|
350 |
+ objsToSync.getCount()); |
|
347 | 351 |
} catch (Exception e) { |
348 | 352 |
logMetacat.error("Error syncing ids"); |
349 | 353 |
} |
350 |
|
|
354 |
|
|
351 | 355 |
total = objsToSync.getTotal(); |
352 | 356 |
|
353 |
// The first loop might have fewer results than the requested count value from the properties file, |
|
354 |
// so in this case use count returned from IdentiferManger for the loop count/increment (loop will only execute once). |
|
355 |
if (objsToSync.getCount() < count) count = objsToSync.getCount(); |
|
356 |
|
|
357 |
for (int i = 0; (i + count -1) < total; i += count) { |
|
357 |
// The first loop might have fewer results than the requested count |
|
358 |
// value from the properties file, |
|
359 |
// so in this case use count returned from IdentiferManger for the |
|
360 |
// loop count/increment (loop will only execute once). |
|
361 |
if (objsToSync.getCount() < count) |
|
362 |
count = objsToSync.getCount(); |
|
363 |
|
|
364 |
for (int i = 0; (i + count - 1) < total; i += count) { |
|
358 | 365 |
try { |
359 | 366 |
logMetacat.debug("syncTask # requested: " + count |
360 | 367 |
+ ", start: " + start + ", total: " + total |
361 | 368 |
+ ", count: " + objsToSync.getCount()); |
362 | 369 |
tmpIds = sync(objsToSync); |
363 | 370 |
syncedIds.addAll(tmpIds); |
364 |
|
|
371 |
|
|
365 | 372 |
// Set start for the next db retrieval, loop interation |
366 | 373 |
start += objsToSync.getCount(); |
367 |
if (start >= total) break; |
|
374 |
if (start >= total) |
|
375 |
break; |
|
368 | 376 |
objsToSync = IdentifierManager |
369 | 377 |
.getInstance() |
370 | 378 |
.querySystemMetadata(startTime, endTime, |
Also available in: Unified diff