Project

General

Profile

« Previous | Next » 

Revision 6887

Add support for the distributed Set of unique identifiers in the storage cluster called 'hzIdentifiers'. This set is a persistent total list of all identifiers (even when entries in the hzSystemMetadata map are evicted). It reflects the state of the identifiers in the postgresql systemmetadata table, but is distributed across the cluster. Add the getIdentifiers() method, which returns the ISet of identifiers.

View differences:

src/edu/ucsb/nceas/metacat/dataone/hazelcast/HazelcastService.java
44 44
import com.hazelcast.core.Hazelcast;
45 45
import com.hazelcast.core.HazelcastInstance;
46 46
import com.hazelcast.core.IMap;
47
import com.hazelcast.core.ISet;
47 48
import com.hazelcast.core.InstanceEvent;
48 49
import com.hazelcast.core.InstanceListener;
49 50
import com.hazelcast.core.Member;
......
105 106
  /* The Hazelcast distributed system metadata map */
106 107
  private IMap<Identifier, SystemMetadata> systemMetadata;
107 108
  
109
  /* The name of the identifiers set */
110
  private String identifiersSet;
111
  
112
  /* The Hazelcast distributed identifiers set */
113
  private ISet<Identifier> identifiers;
114

  
108 115
  private HazelcastInstance hzInstance;
109 116
      
110 117
  /*
......
179 186
        PropertyService.getProperty("dataone.hazelcast.processCluster.password");
180 187
      addressList = 
181 188
        PropertyService.getProperty("dataone.hazelcast.processCluster.instances");
182
//      nodeMap = 
183
//        PropertyService.getProperty("dataone.hazelcast.processCluster.nodesMap");
184 189
      systemMetadataMap = 
185 190
        PropertyService.getProperty("dataone.hazelcast.storageCluster.systemMetadataMap");
186

  
191
      identifiersSet = PropertyService.getProperty("dataone.hazelcast.storageCluster.identifiersSet");
192
//    nodeMap = 
193
//    PropertyService.getProperty("dataone.hazelcast.processCluster.nodesMap");
187 194
      // Become a DataONE-process cluster client
188 195
//      String[] addresses = addressList.split(",");
189 196
//      hzClient = 
......
193 200
      // Get a reference to the shared system metadata map as a cluster member
194 201
      systemMetadata = Hazelcast.getMap(systemMetadataMap);
195 202
      
203
      // Get a reference to the shared identifiers set as a cluster member
204
      identifiers = Hazelcast.getSet(identifiersSet);
205
      
196 206
      // Listen for changes to the system metadata map
197 207
      systemMetadata.addEntryListener(this, true);
198 208
      
......
228 238
  }
229 239
  
230 240
  /**
241
   * Get the identifiers set
242
   * @return identifiers - the set of unique DataONE identifiers in the cluster
243
   */
244
  public ISet<Identifier> getIdentifiers() {
245
      return identifiers;
246
      
247
  }
248

  
249
  /**
231 250
   * When Metacat changes the underlying store, we need to refresh the
232 251
   * in-memory representation of it.
233 252
   * @param guid

Also available in: Unified diff