Project

General

Profile

« Previous | Next » 

Revision 7204

increase logging and add back in the call to saveLocally() in case the SM object has already been loaded into the shared map but before this node came back online.

View differences:

src/edu/ucsb/nceas/metacat/dataone/hazelcast/HazelcastService.java
489 489
	private void resynch() throws Exception {
490 490
		// loop through all the [shared] entries and save any missing ones locally
491 491
		List<String> localPids = IdentifierManager.getInstance().getAllSystemMetadataGUIDs();
492
		logMetacat.debug("local pid count: " + localPids.size() + ", shared pid count: " + identifiers.size());
492
		logMetacat.warn("local pid count: " + localPids.size() + ", shared pid count: " + identifiers.size());
493 493
		Iterator<Identifier> sharedPids = identifiers.iterator();
494 494
		while (sharedPids.hasNext()) {
495 495
			Identifier pid = sharedPids.next();
496
			logMetacat.debug("checking for shared pid locally: " + pid.getValue());
496 497
			if (!localPids.contains(pid.getValue())) {
498
				logMetacat.warn("shared pid does not exist locally: " + pid.getValue());
497 499
				SystemMetadata sm = systemMetadata.get(pid);
498 500
				if (sm != null) {
499
					// BRL - do nothing, loading from the shared map triggers an automatic save locally
500
					//saveLocally(sm);
501
					// this may throw an exception if loading it to the shared map triggered entry updated events
502
					saveLocally(sm);
503
				} else {
504
					logMetacat.error("SystemMetadata for pid is null: " + pid.getValue());
501 505
				}
506
			} else {
507
				logMetacat.debug("shared pid already exisits locally: " + pid.getValue());
502 508
			}
503 509
		}
504 510
	}
505 511
	
506 512
	private void resynchInThread() {
513
		logMetacat.debug("launching system metadata resynch in a thread");
507 514
		ExecutorService executor = Executors.newSingleThreadExecutor();
508 515
		executor.execute(new Runnable() {
509 516
			@Override

Also available in: Unified diff