org.apache.oozie.service
Class PartitionDependencyManagerService

java.lang.Object
  extended by org.apache.oozie.service.PartitionDependencyManagerService
All Implemented Interfaces:
Service

public class PartitionDependencyManagerService
extends Object
implements Service

Module that functions like a caching service to maintain partition dependency mappings


Field Summary
static String CACHE_MANAGER_IMPL
           
static String CONF_PREFIX
           
 
Fields inherited from interface org.apache.oozie.service.Service
DEFAULT_LOCK_TIMEOUT, lockTimeout, USE_XCOMMAND
 
Constructor Summary
PartitionDependencyManagerService()
           
 
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 service.
 Collection<String> getAvailableDependencyURIs(String actionID)
          Get a list of available dependency URIs for a actionID
 Class<? extends Service> getInterface()
          Return the public interface of the service.
 Collection<String> getWaitingActions(org.apache.oozie.util.HCatURI hcatURI)
          Get the list of actionIDs waiting for a partition
 void init(Services services)
          Initialize the service.
 void partitionAvailable(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
 

Field Detail

CONF_PREFIX

public static final String CONF_PREFIX
See Also:
Constant Field Values

CACHE_MANAGER_IMPL

public static final String CACHE_MANAGER_IMPL
See Also:
Constant Field Values
Constructor Detail

PartitionDependencyManagerService

public PartitionDependencyManagerService()
Method Detail

init

public void init(Services services)
          throws ServiceException
Description copied from interface: Service
Initialize the service.

Invoked by the Service singleton at start up time.

Specified by:
init in interface Service
Parameters:
services - services singleton initializing the service.
Throws:
ServiceException - thrown if the service could not initialize.

destroy

public void destroy()
Description copied from interface: Service
Destroy the service.

Invoked by the Service singleton at shutdown time.

Specified by:
destroy in interface Service

getInterface

public Class<? extends Service> getInterface()
Description copied from interface: Service
Return the public interface of the service.

Services are retrieved by its public interface. Specializations of services must return the public interface.

Specified by:
getInterface in interface Service
Returns:
the interface of the service.

addMissingDependency

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

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)
Remove a missing partition dependency associated with a actionID

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)
Get the list of actionIDs waiting for a partition

Parameters:
hcatURI - dependency URI
Returns:
list of actionIDs

partitionAvailable

public void partitionAvailable(String server,
                               String db,
                               String table,
                               Map<String,String> partitions)
Mark a partition dependency as available

Parameters:
server - host:port of the server
db - name of the database
table - name of the table
partitions - list of available partitions

getAvailableDependencyURIs

public Collection<String> getAvailableDependencyURIs(String actionID)
Get a list of available dependency URIs for a actionID

Parameters:
actionID - action id
Returns:
list of available dependency URIs

removeAvailableDependencyURIs

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

Parameters:
actionID - action id
dependencyURIs - set of dependency URIs
Returns:
true if successful, else false


Copyright © 2013 Apache Software Foundation. All Rights Reserved.