org.apache.oozie.dependency
Interface URIHandler

All Known Implementing Classes:
FSURIHandler, HCatURIHandler

public interface URIHandler


Nested Class Summary
static class URIHandler.Context
           
static class URIHandler.DependencyType
          Type of the dependency.
 
Method Summary
 void destroy()
          Destroy the URIHandler
 boolean exists(URI uri, org.apache.hadoop.conf.Configuration conf, String user)
          Check if the dependency identified by the URI is available
 boolean exists(URI uri, URIHandler.Context context)
          Check if the dependency identified by the URI is available
 List<Class<?>> getClassesForLauncher()
          Get list of classes to ship to launcher for LauncherURIHandler
 URIHandler.Context getContext(URI uri, org.apache.hadoop.conf.Configuration conf, String user)
          Get the Context which can be used to access URI of the same scheme and host
 URIHandler.DependencyType getDependencyType(URI uri)
          Get the dependency type of the URI.
 Class<? extends org.apache.oozie.action.hadoop.LauncherURIHandler> getLauncherURIHandlerClass()
          Get the URIHandler that will be used to handle the supported schemes in launcher
 Set<String> getSupportedSchemes()
          Get the list of uri schemes supported by this URIHandler
 String getURIWithDoneFlag(String uri, String doneFlag)
          Get the URI based on the done flag
 void init(org.apache.hadoop.conf.Configuration conf)
          Initialize the URIHandler
 void registerForNotification(URI uri, org.apache.hadoop.conf.Configuration conf, String user, String actionID)
          Register for notifications in case of a push dependency
 boolean unregisterFromNotification(URI uri, String actionID)
          Unregister from notifications in case of a push dependency
 void validate(String uri)
          Check whether the URI is valid or not
 

Method Detail

init

void init(org.apache.hadoop.conf.Configuration conf)
Initialize the URIHandler

Parameters:
conf - Configuration for initialization

getSupportedSchemes

Set<String> getSupportedSchemes()
Get the list of uri schemes supported by this URIHandler

Returns:
supported list of uri schemes

getLauncherURIHandlerClass

Class<? extends org.apache.oozie.action.hadoop.LauncherURIHandler> getLauncherURIHandlerClass()
Get the URIHandler that will be used to handle the supported schemes in launcher

Returns:
LauncherURIHandler that handles URI in the launcher

getClassesForLauncher

List<Class<?>> getClassesForLauncher()
Get list of classes to ship to launcher for LauncherURIHandler

Returns:
list of classes to ship to launcher

getDependencyType

URIHandler.DependencyType getDependencyType(URI uri)
                                            throws URIHandlerException
Get the dependency type of the URI. When the availability of the URI is to be determined by polling the type is DependencyType.PULL, and when the availability is received through notifications from a external entity like a JMS server the type is DependencyType.PUSH

Returns:
dependency type of URI
Throws:
URIHandlerException

registerForNotification

void registerForNotification(URI uri,
                             org.apache.hadoop.conf.Configuration conf,
                             String user,
                             String actionID)
                             throws URIHandlerException
Register for notifications in case of a push dependency

Parameters:
uri - The URI to check for availability
conf - Configuration to access the URI
user - name of the user the URI should be accessed as
actionID - The id of action which depends on the availability of the uri
Throws:
URIHandlerException

unregisterFromNotification

boolean unregisterFromNotification(URI uri,
                                   String actionID)
Unregister from notifications in case of a push dependency

Parameters:
uri - The URI to be removed from missing dependency
actionID - The id of action which was dependent on the uri.
Throws:
URIHandlerException

getContext

URIHandler.Context getContext(URI uri,
                              org.apache.hadoop.conf.Configuration conf,
                              String user)
                              throws URIHandlerException
Get the Context which can be used to access URI of the same scheme and host

Parameters:
uri - URI which identifies the scheme and host
conf - Configuration to access the URI
user - name of the user the URI should be accessed as
Returns:
Context to access URIs with same scheme and host
Throws:
URIHandlerException

exists

boolean exists(URI uri,
               URIHandler.Context context)
               throws URIHandlerException
Check if the dependency identified by the URI is available

Parameters:
uri - URI of the dependency
context - Context to access the URI
Returns:
true if the URI exists; false if the URI does not exist
Throws:
URIHandlerException

exists

boolean exists(URI uri,
               org.apache.hadoop.conf.Configuration conf,
               String user)
               throws URIHandlerException
Check if the dependency identified by the URI is available

Parameters:
uri - URI of the dependency
conf - Configuration to access the URI
user - name of the user the URI should be accessed as. If null the logged in user is used.
Returns:
true if the URI exists; false if the URI does not exist
Throws:
URIHandlerException

getURIWithDoneFlag

String getURIWithDoneFlag(String uri,
                          String doneFlag)
                          throws URIHandlerException
Get the URI based on the done flag

Parameters:
uri - URI of the dependency
doneFlag - flag that determines URI availability
Returns:
the final URI with the doneFlag incorporated
Throws:
URIHandlerException

validate

void validate(String uri)
              throws URIHandlerException
Check whether the URI is valid or not

Parameters:
uri -
Throws:
URIHandlerException

destroy

void destroy()
Destroy the URIHandler



Copyright © 2013 Apache Software Foundation. All Rights Reserved.