Revision 6889
Added by Chris Jones almost 13 years ago
src/edu/ucsb/nceas/metacat/dataone/hazelcast/HazelcastService.java | ||
---|---|---|
362 | 362 |
*/ |
363 | 363 |
@Override |
364 | 364 |
public void entryEvicted(EntryEvent<Identifier, SystemMetadata> event) { |
365 |
// nothing to do, entries are still in the backing store |
|
365 |
// ensure identifiers are listed in the hzIdentifiers set |
|
366 |
if ( !identifiers.contains(event.getKey()) ) { |
|
367 |
identifiers.add(event.getKey()); |
|
368 |
} |
|
366 | 369 |
|
367 | 370 |
} |
368 | 371 |
|
... | ... | |
377 | 380 |
public void entryRemoved(EntryEvent<Identifier, SystemMetadata> event) { |
378 | 381 |
// we typically don't remove objects in Metacat, but can remove System Metadata |
379 | 382 |
IdentifierManager.getInstance().deleteSystemMetadata(event.getValue().getIdentifier().getValue()); |
380 |
|
|
383 |
|
|
384 |
// keep the hzIdentifiers set in sync with the systemmetadata table |
|
385 |
if ( identifiers.contains(event.getKey()) ) { |
|
386 |
identifiers.remove(event.getKey()); |
|
387 |
|
|
388 |
} |
|
389 |
|
|
381 | 390 |
} |
382 | 391 |
|
383 | 392 |
/** |
... | ... | |
408 | 417 |
boolean isMetadata = D1NodeService.isScienceMetadata(event.getValue()); |
409 | 418 |
// TODO: do we need to do anything explicit here? |
410 | 419 |
} |
411 |
|
|
420 |
|
|
421 |
// ensure identifiers are listed in the hzIdentifiers set |
|
422 |
if ( !identifiers.contains(event.getKey()) ) { |
|
423 |
identifiers.add(event.getKey()); |
|
424 |
} |
|
425 |
|
|
412 | 426 |
} |
413 | 427 |
|
414 | 428 |
/** |
Also available in: Unified diff
Keep the hzIdentifiers set in sync with the Metacat systemmetadata table. If entries are added/updated in the hzSystemMetadata map, make sure the identifier is in the set. If (for some administrative reason) the entry is removed, remove the identifier from the set. This usually doesn't happen.