org.apache.tez.runtime.common.objectregistry
Interface ObjectRegistry


public interface ObjectRegistry

Preliminary version of a simple shared object cache to re-use objects across multiple tasks within the same container/JVM.


Method Summary
 Object add(ObjectLifeCycle lifeCycle, String key, Object value)
          Insert or update object into the registry.
 boolean delete(String key)
          Delete the object associated with the provided key
 Object get(String key)
          Return the object associated with the provided key
 

Method Detail

add

Object add(ObjectLifeCycle lifeCycle,
           String key,
           Object value)
Insert or update object into the registry. This will remove an object associated with the same key with a different life-cycle as there is only one instance of an Object stored for a given key irrespective of the life-cycle attached to the Object.

Parameters:
lifeCycle - What life-cycle is the Object valid for
key - Key to identify the Object
value - Object to be inserted
Returns:
Previous Object associated with the key attached if present else null. Could return the same object if the object was associated with the same key for a different life-cycle.

get

Object get(String key)
Return the object associated with the provided key

Parameters:
key - Key to find object
Returns:
Object if found else null

delete

boolean delete(String key)
Delete the object associated with the provided key

Parameters:
key - Key to find object
Returns:
True if an object was found and removed


Copyright © 2014 Apache Software Foundation. All rights reserved.