org.apache.oozie.dependency.hcat
Class SimpleHCatDependencyCache

java.lang.Object
  extended by org.apache.oozie.dependency.hcat.SimpleHCatDependencyCache
All Implemented Interfaces:
HCatDependencyCache

public class SimpleHCatDependencyCache
extends Object
implements HCatDependencyCache


Constructor Summary
SimpleHCatDependencyCache()
           
 
Method Summary
 void addMissingDependency(org.apache.oozie.util.HCatURI hcatURI, String actionID)
          Add a missing partition dependency and the actionID waiting on it
 void destroy()
          Destroy the cache
 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
 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleHCatDependencyCache

public SimpleHCatDependencyCache()
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


Copyright © 2013 Apache Software Foundation. All Rights Reserved.