Revision 7216
Added by ben leinfelder over 12 years ago
src/edu/ucsb/nceas/metacat/dataone/hazelcast/HazelcastService.java | ||
---|---|---|
542 | 542 |
// loop through all the [shared] entries and save any missing ones locally |
543 | 543 |
List<String> localPids = IdentifierManager.getInstance().getAllSystemMetadataGUIDs(); |
544 | 544 |
logMetacat.warn("local pid count: " + localPids.size() + ", shared pid count: " + identifiers.size()); |
545 |
if (localPids.size() == identifiers.size()) { |
|
546 | 545 |
|
547 |
//loop through all the pids to find any nulls |
|
548 |
Iterator<Identifier> sharedPids = identifiers.iterator(); |
|
549 |
while (sharedPids.hasNext()) { |
|
550 |
Identifier pid = sharedPids.next(); |
|
551 |
logMetacat.trace("checking ownership for shared pid: " + pid.getValue()); |
|
546 |
//loop through all the pids to find any nulls |
|
547 |
Iterator<Identifier> sharedPids = identifiers.iterator(); |
|
548 |
while (sharedPids.hasNext()) { |
|
549 |
Identifier pid = sharedPids.next(); |
|
550 |
logMetacat.trace("looking up shared value for pid: " + pid.getValue()); |
|
551 |
SystemMetadata sm = systemMetadata.get(pid); |
|
552 |
if (sm == null) { |
|
553 |
logMetacat.warn("shared SystemMetadata for pid is null: " + pid.getValue()); |
|
554 |
// look up owner of the pid |
|
552 | 555 |
Partition partition = hzInstance.getPartitionService().getPartition(pid); |
553 | 556 |
Member owner = partition.getOwner(); |
554 | 557 |
boolean isLocalPid = owner.localMember(); |
555 |
logMetacat.warn("owner of pid: " + pid.getValue() + " isLocal: " + isLocalPid); |
|
558 |
logMetacat.debug("owner of pid: " + pid.getValue() + " isLocal: " + isLocalPid); |
|
559 |
// if we don't own it, we can look it up locally in hopes that we have our own copy |
|
556 | 560 |
if (!isLocalPid) { |
557 |
logMetacat.trace("looking up shared value for pid: " + pid.getValue()); |
|
558 |
SystemMetadata sm = systemMetadata.get(pid); |
|
559 |
if (sm == null) { |
|
560 |
logMetacat.error("shared SystemMetadata for pid is null: " + pid.getValue()); |
|
561 |
// get directly from backing store |
|
562 |
sm = IdentifierManager.getInstance().getSystemMetadata(pid.getValue()); |
|
563 |
if (sm != null) { |
|
564 |
logMetacat.trace("saving local SystemMetadata to shared map for pid: " + pid.getValue()); |
|
565 |
systemMetadata.put(pid, sm); |
|
566 |
} else { |
|
567 |
logMetacat.error("local SystemMetadata is null for pid: " + pid.getValue()); |
|
568 |
} |
|
561 |
// get directly from backing store |
|
562 |
sm = IdentifierManager.getInstance().getSystemMetadata(pid.getValue()); |
|
563 |
if (sm != null) { |
|
564 |
logMetacat.debug("saving local SystemMetadata to shared map for pid: " + pid.getValue()); |
|
565 |
systemMetadata.put(pid, sm); |
|
566 |
} else { |
|
567 |
logMetacat.error("local SystemMetadata is null for pid: " + pid.getValue()); |
|
569 | 568 |
} |
570 | 569 |
} |
571 | 570 |
} |
572 | 571 |
} |
572 |
|
|
573 | 573 |
} |
574 | 574 |
|
575 | 575 |
private void resynchInThread() { |
Also available in: Unified diff
do not check if this CN has a "perfect" copy of the SM identifiers -- we need any CN coming online to contribute the records that they have locally so that in the event that all three CNs have a partial view of things they all eventually share each others' SM entries.