Revision 7326
Added by ben leinfelder over 12 years ago
src/edu/ucsb/nceas/metacat/dataone/hazelcast/HazelcastService.java | ||
---|---|---|
501 | 501 |
*/ |
502 | 502 |
private void resynchToRemote() { |
503 | 503 |
|
504 |
// add any identifiers not already present |
|
504 |
// add any identifiers not already present in the shared map
|
|
505 | 505 |
Set<Identifier> idKeys = loadAllKeys(); |
506 |
|
|
507 |
// only contribute what are not already shared |
|
508 |
idKeys.removeAll(identifiers); |
|
509 |
logMetacat.warn("local pid count not yet shared: " + idKeys.size() + ", shared pid count: " + identifiers.size()); |
|
510 |
|
|
506 | 511 |
//identifiers.addAll(idKeys); |
507 |
logMetacat.warn("Loading local keys into hzIdentifiers"); |
|
512 |
logMetacat.warn("Loading missing local keys into hzIdentifiers");
|
|
508 | 513 |
for (Identifier key: idKeys) { |
509 | 514 |
if (!identifiers.contains(key)) { |
510 | 515 |
logMetacat.debug("Adding missing hzIdentifiers key: " + key.getValue()); |
511 | 516 |
identifiers.add(key); |
512 | 517 |
} |
513 | 518 |
} |
514 |
logMetacat.warn("Initialized identifiers with local keys"); |
|
515 |
|
|
516 |
// loop through all the [shared] entries and save any missing ones locally |
|
517 |
logMetacat.warn("local pid count: " + idKeys.size() + ", shared pid count: " + identifiers.size()); |
|
519 |
logMetacat.warn("Initialized identifiers with missing local keys"); |
|
518 | 520 |
|
521 |
logMetacat.warn("Processing SystemMetadata for shared pid count: " + identifiers.size()); |
|
522 |
|
|
519 | 523 |
//loop through all the pids to find any null SM that needs to be synched |
520 | 524 |
Iterator<Identifier> sharedPids = identifiers.iterator(); |
521 | 525 |
while (sharedPids.hasNext()) { |
Also available in: Unified diff
use local Set processing to determine which pids (if any) should be contributed to the shared set by this node during the resync. Should save time rather than checking each and every pid against the shared set.