Project

General

Profile

« Previous | Next » 

Revision 7206

pause/resume was not enough. trying shutdown/restart

View differences:

HazelcastService.java
183 183
	Hazelcast.init(config);
184 184
  this.hzInstance = Hazelcast.getDefaultInstance();
185 185
  
186
  	logMetacat.debug("Initialized hzInstance");
187

  
186 188
    // Get configuration properties on instantiation
187 189
    try {
188 190
      groupName = 
......
206 208
      // NOTE: this loads the map from the backing store and can take a long time for large collections
207 209
      systemMetadata = Hazelcast.getMap(systemMetadataMap);
208 210
      
211
      logMetacat.debug("Initialized systemMetadata");
212

  
209 213
      // Get a reference to the shared identifiers set as a cluster member
210 214
      identifiers = Hazelcast.getSet(identifiersSet);
211 215
      identifiers.addAll(loadAllKeys());
212 216
      
217
      logMetacat.debug("Initialized identifiers");
218
      
213 219
      // Listen for changes to the system metadata map
214 220
      systemMetadata.addEntryListener(this, true);
215 221
      
......
229 235
    
230 236
    // make sure we have all metadata locally
231 237
    try {
238
        logMetacat.debug("Temporarily shutting down which resynching system metadata");
239

  
232 240
    	// pause to make us not own any keys
233
    	hzInstance.getLifecycleService().pause();
241
    	hzInstance.getLifecycleService().shutdown();
234 242
    	// synch on restart
235 243
        resynchInThread();
236 244
	} catch (Exception e) {
......
520 528
				try {
521 529
					resynch();
522 530
					// now we can take ownership of keys
523
					hzInstance.getLifecycleService().resume();
531
					hzInstance.getLifecycleService().restart();
524 532
				} catch (Exception e) {
525 533
					logMetacat.error("Error in resynchInThread: " + e.getMessage(), e);
526 534
				}

Also available in: Unified diff