Project

General

Profile

Revision 6714

evict the HazelCast SystemMetadata entry if we update the access control rules via Metacat's legacy API, otherwise stale SystemMetadata stays in memory instead of being looked up from the backing table store.

View differences:

src/edu/ucsb/nceas/metacat/MetacatHandler.java
3124 3124
                successList.addElement("MetacatHandler.handleSetAccessAction - " +
3125 3125
                		               "successfully replaced access block for doc id: " + 
3126 3126
                		               docList[0]);
3127
                
3128
                // force hazelcast to update system metadata
3129
                HazelcastService.getInstance().refreshSystemMetadataEntry(docList[0]);
3130
                
3127 3131
            } catch(AccessControlException ace) {
3128 3132
                errorList.addElement("MetacatHandler.handleSetAccessAction - " +
3129 3133
                		             "access control error when setting " + 
......
3255 3259
                    continue;
3256 3260
                }
3257 3261
            }
3262
            // force hazelcast to update system metadata
3263
            HazelcastService.getInstance().refreshSystemMetadataEntry(docList[0]);
3264
            
3258 3265
            //force replication when this action is called
3259 3266
            boolean isXml = true;
3260 3267
            if (publicId.equalsIgnoreCase("BIN")) {
src/edu/ucsb/nceas/metacat/dataone/hazelcast/HazelcastService.java
227 227
  public IMap<Identifier,SystemMetadata> getSystemMetadataMap() {
228 228
	  return systemMetadata;
229 229
  }
230
  
231
  /**
232
   * When Metacat changes the underlying store, we need to refresh the
233
   * in-memory representation of it.
234
   * @param guid
235
   */
236
  public void refreshSystemMetadataEntry(String guid) {
237
	Identifier identifier = new Identifier();
238
	identifier.setValue(guid);
239
	// force hazelcast to update system metadata in memory from the store
240
	HazelcastService.getInstance().getSystemMetadataMap().evict(identifier);
241
	
242
  }
230 243

  
231 244
  public ILock getLock(String identifier) {
232 245
    

Also available in: Unified diff