Revision 7117
Added by ben leinfelder over 12 years ago
src/edu/ucsb/nceas/metacat/dataone/hazelcast/HazelcastService.java | ||
---|---|---|
403 | 403 |
*/ |
404 | 404 |
@Override |
405 | 405 |
public void entryUpdated(EntryEvent<Identifier, SystemMetadata> event) { |
406 |
|
|
407 |
logMetacat.debug("Entry added/updated to System Metadata map: " + |
|
408 |
event.getKey().getValue()); |
|
409 |
PartitionService partitionService = Hazelcast.getPartitionService(); |
|
410 |
Partition partition = partitionService.getPartition(event.getKey()); |
|
411 |
Member ownerMember = partition.getOwner(); |
|
412 |
SystemMetadata sysmeta = event.getValue(); |
|
413 |
if (!ownerMember.localMember()) { |
|
406 |
|
|
407 |
logMetacat.debug("Entry added/updated to System Metadata map: " + event.getKey().getValue()); |
|
408 |
PartitionService partitionService = Hazelcast.getPartitionService(); |
|
409 |
Partition partition = partitionService.getPartition(event.getKey()); |
|
410 |
Member ownerMember = partition.getOwner(); |
|
411 |
SystemMetadata sysmeta = event.getValue(); |
|
412 |
if (!ownerMember.localMember()) { |
|
413 |
if (sysmeta == null) { |
|
414 |
logMetacat.warn("No SystemMetadata provided in the event, getting from shared map: " + event.getKey().getValue()); |
|
415 |
sysmeta = getSystemMetadataMap().get(event.getKey()); |
|
414 | 416 |
if (sysmeta == null) { |
415 |
logMetacat.warn("No SystemMetadata provided in the event, getting from shared map: " + event.getKey().getValue()); |
|
416 |
sysmeta = getSystemMetadataMap().get(event.getKey()); |
|
417 |
if (sysmeta == null) { |
|
418 |
// this is a problem |
|
419 |
logMetacat.error("Could not find SystemMetadata in shared map for: " + event.getKey().getValue()); |
|
420 |
} |
|
417 |
// this is a problem |
|
418 |
logMetacat.error("Could not find SystemMetadata in shared map for: " + event.getKey().getValue()); |
|
419 |
// TODO: should probably return at this point since the save will fail |
|
421 | 420 |
} |
422 |
// need to pull the entry into the local store |
|
423 |
saveLocally(event.getValue()); |
|
424 | 421 |
} |
425 |
|
|
426 |
// TODO evaluate the type of system metadata change, decide if it |
|
427 |
// warrants a replication event, what type (DATA, METADATA, RESOURCE), |
|
428 |
// iteratively lock the PID, create and submit the tasks, and expect a |
|
429 |
// result back. Deal with exceptions. |
|
430 |
if (sysmeta != null) { |
|
431 |
boolean isMetadata = D1NodeService.isScienceMetadata(event.getValue()); |
|
432 |
// TODO: do we need to do anything explicit here? |
|
433 |
} |
|
422 |
// need to pull the entry into the local store |
|
423 |
saveLocally(event.getValue()); |
|
424 |
} |
|
434 | 425 |
|
435 |
// ensure identifiers are listed in the hzIdentifiers set
|
|
436 |
if ( !identifiers.contains(event.getKey()) ) {
|
|
437 |
identifiers.add(event.getKey());
|
|
438 |
}
|
|
426 |
// ensure identifiers are listed in the hzIdentifiers set
|
|
427 |
if (!identifiers.contains(event.getKey())) {
|
|
428 |
identifiers.add(event.getKey());
|
|
429 |
}
|
|
439 | 430 |
|
440 | 431 |
} |
441 | 432 |
|
Also available in: Unified diff
add comment about returning early when no system metadata can be found.
removed extraneous check on the content type of the SM -- was unused.
formatted indenting