Revision 7203
Added by ben leinfelder over 12 years ago
src/edu/ucsb/nceas/metacat/dataone/hazelcast/HazelcastService.java | ||
---|---|---|
28 | 28 |
|
29 | 29 |
import java.io.FileNotFoundException; |
30 | 30 |
import java.sql.SQLException; |
31 |
import java.util.ArrayList; |
|
32 |
import java.util.Collection; |
|
33 |
import java.util.Date; |
|
34 | 31 |
import java.util.HashSet; |
32 |
import java.util.Iterator; |
|
35 | 33 |
import java.util.List; |
36 | 34 |
import java.util.Set; |
37 |
import java.util.Map.Entry; |
|
38 | 35 |
import java.util.concurrent.ExecutorService; |
39 | 36 |
import java.util.concurrent.Executors; |
40 | 37 |
import java.util.concurrent.locks.Lock; |
... | ... | |
44 | 41 |
import org.dataone.service.types.v1.Identifier; |
45 | 42 |
import org.dataone.service.types.v1.Node; |
46 | 43 |
import org.dataone.service.types.v1.NodeReference; |
47 |
import org.dataone.service.types.v1.ObjectInfo; |
|
48 |
import org.dataone.service.types.v1.ObjectList; |
|
49 | 44 |
import org.dataone.service.types.v1.SystemMetadata; |
50 | 45 |
|
51 | 46 |
import com.hazelcast.config.Config; |
... | ... | |
63 | 58 |
import com.hazelcast.core.MembershipListener; |
64 | 59 |
import com.hazelcast.partition.Partition; |
65 | 60 |
import com.hazelcast.partition.PartitionService; |
66 |
import com.hazelcast.query.EntryObject; |
|
67 |
import com.hazelcast.query.Predicate; |
|
68 |
import com.hazelcast.query.PredicateBuilder; |
|
69 | 61 |
|
70 | 62 |
import edu.ucsb.nceas.metacat.IdentifierManager; |
71 | 63 |
import edu.ucsb.nceas.metacat.McdbDocNotFoundException; |
... | ... | |
498 | 490 |
// loop through all the [shared] entries and save any missing ones locally |
499 | 491 |
List<String> localPids = IdentifierManager.getInstance().getAllSystemMetadataGUIDs(); |
500 | 492 |
logMetacat.debug("local pid count: " + localPids.size() + ", shared pid count: " + identifiers.size()); |
501 |
for (Identifier pid: identifiers) { |
|
493 |
Iterator<Identifier> sharedPids = identifiers.iterator(); |
|
494 |
while (sharedPids.hasNext()) { |
|
495 |
Identifier pid = sharedPids.next(); |
|
502 | 496 |
if (!localPids.contains(pid.getValue())) { |
503 | 497 |
SystemMetadata sm = systemMetadata.get(pid); |
504 | 498 |
if (sm != null) { |
505 |
saveLocally(sm); |
|
499 |
// BRL - do nothing, loading from the shared map triggers an automatic save locally |
|
500 |
//saveLocally(sm); |
|
506 | 501 |
} |
507 | 502 |
} |
508 | 503 |
} |
Also available in: Unified diff
no need to call saveLocally explicitly since loading from the shared store triggers that behavior locally because of the configured listeners.
use an iterator over the shared identifiers in case this set is constantly changing.