org.apache.oozie.dependency.hcat
Class EhcacheHCatDependencyCache

java.lang.Object
  extended by org.apache.oozie.dependency.hcat.EhcacheHCatDependencyCache
All Implemented Interfaces:
Cloneable, net.sf.ehcache.event.CacheEventListener, HCatDependencyCache

public class EhcacheHCatDependencyCache
extends Object
implements HCatDependencyCache, net.sf.ehcache.event.CacheEventListener


Field Summary
static String CONF_CACHE_NAME
           
 
Constructor Summary
EhcacheHCatDependencyCache()
           
 
Method Summary
 void addMissingDependency(org.apache.oozie.util.HCatURI hcatURI, String actionID)
          Add a missing partition dependency and the actionID waiting on it
 Object clone()
           
 void destroy()
          Destroy the cache
 void dispose()
           
 Collection<String> getAvailableDependencyURIs(String actionID)
          Get a list of available dependency URIs for a actionID
 Collection<String> getWaitingActions(org.apache.oozie.util.HCatURI hcatURI)
          Get the list of actionIDs waiting for a partition
 void init(org.apache.hadoop.conf.Configuration conf)
          Initialize the cache with configuration
 Collection<String> markDependencyAvailable(String server, String db, String table, Map<String,String> partitions)
          Mark a partition dependency as available
 void notifyElementEvicted(net.sf.ehcache.Ehcache cache, net.sf.ehcache.Element element)
           
 void notifyElementExpired(net.sf.ehcache.Ehcache cache, net.sf.ehcache.Element element)
           
 void notifyElementPut(net.sf.ehcache.Ehcache arg0, net.sf.ehcache.Element arg1)
           
 void notifyElementRemoved(net.sf.ehcache.Ehcache arg0, net.sf.ehcache.Element arg1)
           
 void notifyElementUpdated(net.sf.ehcache.Ehcache arg0, net.sf.ehcache.Element arg1)
           
 void notifyRemoveAll(net.sf.ehcache.Ehcache arg0)
           
 boolean removeAvailableDependencyURIs(String actionID, Collection<String> dependencyURIs)
          Remove the list of available dependency URIs for a actionID once the missing dependencies are processed.
 boolean removeMissingDependency(org.apache.oozie.util.HCatURI hcatURI, String actionID)
          Remove a missing partition dependency associated with a actionID
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONF_CACHE_NAME

public static String CONF_CACHE_NAME
Constructor Detail

EhcacheHCatDependencyCache

public EhcacheHCatDependencyCache()
Method Detail

init

public void init(org.apache.hadoop.conf.Configuration conf)
Description copied from interface: HCatDependencyCache
Initialize the cache with configuration

Specified by:
init in interface HCatDependencyCache
Parameters:
conf - configuration

addMissingDependency

public void addMissingDependency(org.apache.oozie.util.HCatURI hcatURI,
                                 String actionID)
Description copied from interface: HCatDependencyCache
Add a missing partition dependency and the actionID waiting on it

Specified by:
addMissingDependency in interface HCatDependencyCache
Parameters:
hcatURI - dependency URI
actionID - ID of action which is waiting for the dependency

removeMissingDependency

public boolean removeMissingDependency(org.apache.oozie.util.HCatURI hcatURI,
                                       String actionID)
Description copied from interface: HCatDependencyCache
Remove a missing partition dependency associated with a actionID

Specified by:
removeMissingDependency in interface HCatDependencyCache
Parameters:
hcatURI - dependency URI
actionID - ID of action which is waiting for the dependency
Returns:
true if successful, else false

getWaitingActions

public Collection<String> getWaitingActions(org.apache.oozie.util.HCatURI hcatURI)
Description copied from interface: HCatDependencyCache
Get the list of actionIDs waiting for a partition

Specified by:
getWaitingActions in interface HCatDependencyCache
Parameters:
hcatURI - dependency URI
Returns:
list of actionIDs

markDependencyAvailable

public Collection<String> markDependencyAvailable(String server,
                                                  String db,
                                                  String table,
                                                  Map<String,String> partitions)
Description copied from interface: HCatDependencyCache
Mark a partition dependency as available

Specified by:
markDependencyAvailable in interface HCatDependencyCache
Parameters:
server - host:port of the server
db - name of the database
table - name of the table
partitions - list of available partitions
Returns:
list of actionIDs for which the dependency is now available

getAvailableDependencyURIs

public Collection<String> getAvailableDependencyURIs(String actionID)
Description copied from interface: HCatDependencyCache
Get a list of available dependency URIs for a actionID

Specified by:
getAvailableDependencyURIs in interface HCatDependencyCache
Parameters:
actionID - action id
Returns:
list of available dependency URIs

removeAvailableDependencyURIs

public boolean removeAvailableDependencyURIs(String actionID,
                                             Collection<String> dependencyURIs)
Description copied from interface: HCatDependencyCache
Remove the list of available dependency URIs for a actionID once the missing dependencies are processed.

Specified by:
removeAvailableDependencyURIs in interface HCatDependencyCache
Parameters:
actionID - action id
dependencyURIs - set of dependency URIs
Returns:
true if successful, else false

destroy

public void destroy()
Description copied from interface: HCatDependencyCache
Destroy the cache

Specified by:
destroy in interface HCatDependencyCache

clone

public Object clone()
             throws CloneNotSupportedException
Specified by:
clone in interface net.sf.ehcache.event.CacheEventListener
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

dispose

public void dispose()
Specified by:
dispose in interface net.sf.ehcache.event.CacheEventListener

notifyElementExpired

public void notifyElementExpired(net.sf.ehcache.Ehcache cache,
                                 net.sf.ehcache.Element element)
Specified by:
notifyElementExpired in interface net.sf.ehcache.event.CacheEventListener

notifyElementPut

public void notifyElementPut(net.sf.ehcache.Ehcache arg0,
                             net.sf.ehcache.Element arg1)
                      throws net.sf.ehcache.CacheException
Specified by:
notifyElementPut in interface net.sf.ehcache.event.CacheEventListener
Throws:
net.sf.ehcache.CacheException

notifyElementRemoved

public void notifyElementRemoved(net.sf.ehcache.Ehcache arg0,
                                 net.sf.ehcache.Element arg1)
                          throws net.sf.ehcache.CacheException
Specified by:
notifyElementRemoved in interface net.sf.ehcache.event.CacheEventListener
Throws:
net.sf.ehcache.CacheException

notifyElementUpdated

public void notifyElementUpdated(net.sf.ehcache.Ehcache arg0,
                                 net.sf.ehcache.Element arg1)
                          throws net.sf.ehcache.CacheException
Specified by:
notifyElementUpdated in interface net.sf.ehcache.event.CacheEventListener
Throws:
net.sf.ehcache.CacheException

notifyRemoveAll

public void notifyRemoveAll(net.sf.ehcache.Ehcache arg0)
Specified by:
notifyRemoveAll in interface net.sf.ehcache.event.CacheEventListener

notifyElementEvicted

public void notifyElementEvicted(net.sf.ehcache.Ehcache cache,
                                 net.sf.ehcache.Element element)
Specified by:
notifyElementEvicted in interface net.sf.ehcache.event.CacheEventListener


Copyright © 2013 Apache Software Foundation. All Rights Reserved.