org.apache.oozie.dependency
Class HCatURIHandler

java.lang.Object
  extended by org.apache.oozie.dependency.HCatURIHandler
All Implemented Interfaces:
URIHandler

public class HCatURIHandler
extends Object
implements URIHandler


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.oozie.dependency.URIHandler
URIHandler.Context, URIHandler.DependencyType
 
Constructor Summary
HCatURIHandler()
           
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HCatURIHandler

public HCatURIHandler()
Method Detail

init

public void init(org.apache.hadoop.conf.Configuration conf)
Description copied from interface: URIHandler
Initialize the URIHandler

Specified by:
init in interface URIHandler
Parameters:
conf - Configuration for initialization

getSupportedSchemes

public Set<String> getSupportedSchemes()
Description copied from interface: URIHandler
Get the list of uri schemes supported by this URIHandler

Specified by:
getSupportedSchemes in interface URIHandler
Returns:
supported list of uri schemes

getLauncherURIHandlerClass

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

Specified by:
getLauncherURIHandlerClass in interface URIHandler
Returns:
LauncherURIHandler that handles URI in the launcher

getClassesForLauncher

public List<Class<?>> getClassesForLauncher()
Description copied from interface: URIHandler
Get list of classes to ship to launcher for LauncherURIHandler

Specified by:
getClassesForLauncher in interface URIHandler
Returns:
list of classes to ship to launcher

getDependencyType

public URIHandler.DependencyType getDependencyType(URI uri)
                                            throws URIHandlerException
Description copied from interface: URIHandler
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

Specified by:
getDependencyType in interface URIHandler
Returns:
dependency type of URI
Throws:
URIHandlerException

registerForNotification

public void registerForNotification(URI uri,
                                    org.apache.hadoop.conf.Configuration conf,
                                    String user,
                                    String actionID)
                             throws URIHandlerException
Description copied from interface: URIHandler
Register for notifications in case of a push dependency

Specified by:
registerForNotification in interface URIHandler
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

public boolean unregisterFromNotification(URI uri,
                                          String actionID)
Description copied from interface: URIHandler
Unregister from notifications in case of a push dependency

Specified by:
unregisterFromNotification in interface URIHandler
Parameters:
uri - The URI to be removed from missing dependency
actionID - The id of action which was dependent on the uri.

getContext

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

Specified by:
getContext in interface URIHandler
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

public boolean exists(URI uri,
                      URIHandler.Context context)
               throws URIHandlerException
Description copied from interface: URIHandler
Check if the dependency identified by the URI is available

Specified by:
exists in interface URIHandler
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

public boolean exists(URI uri,
                      org.apache.hadoop.conf.Configuration conf,
                      String user)
               throws URIHandlerException
Description copied from interface: URIHandler
Check if the dependency identified by the URI is available

Specified by:
exists in interface URIHandler
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

public String getURIWithDoneFlag(String uri,
                                 String doneFlag)
                          throws URIHandlerException
Description copied from interface: URIHandler
Get the URI based on the done flag

Specified by:
getURIWithDoneFlag in interface URIHandler
Parameters:
uri - URI of the dependency
doneFlag - flag that determines URI availability
Returns:
the final URI with the doneFlag incorporated
Throws:
URIHandlerException

validate

public void validate(String uri)
              throws URIHandlerException
Description copied from interface: URIHandler
Check whether the URI is valid or not

Specified by:
validate in interface URIHandler
Throws:
URIHandlerException

destroy

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

Specified by:
destroy in interface URIHandler


Copyright © 2013 Apache Software Foundation. All Rights Reserved.