com.cloudera.sqoop.shims
Class ShimLoader

java.lang.Object
  extended by com.cloudera.sqoop.shims.ShimLoader

public abstract class ShimLoader
extends java.lang.Object

Provides a service locator for the appropriate shim, dynamically chosen based on the Hadoop version in the classpath.


Field Summary
static org.apache.commons.logging.Log LOG
           
static java.lang.String SHIM_JAR_DIR_PROPERTY
          Which directory Sqoop checks for shim jars.
 
Method Summary
static HadoopShim getHadoopShim()
          Factory method to get an instance of HadoopShim based on the version of Hadoop on the classpath.
static HadoopShim getHadoopShim(org.apache.hadoop.conf.Configuration conf)
          Factory method to get an instance of HadoopShim based on the version of Hadoop on the classpath.
static
<T> java.lang.Class<? extends T>
getShimClass(java.lang.String className)
          Given the name of a class, try to load the shim jars and return the Class object referring to that class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.commons.logging.Log LOG

SHIM_JAR_DIR_PROPERTY

public static final java.lang.String SHIM_JAR_DIR_PROPERTY
Which directory Sqoop checks for shim jars.

See Also:
Constant Field Values
Method Detail

getHadoopShim

public static HadoopShim getHadoopShim(org.apache.hadoop.conf.Configuration conf)
Factory method to get an instance of HadoopShim based on the version of Hadoop on the classpath.

Parameters:
conf - an optional Configuration whose internal ClassLoader should be updated with the jar containing the HadoopShim.

getHadoopShim

public static HadoopShim getHadoopShim()
Factory method to get an instance of HadoopShim based on the version of Hadoop on the classpath.


getShimClass

public static <T> java.lang.Class<? extends T> getShimClass(java.lang.String className)
                                                 throws java.lang.ClassNotFoundException
Given the name of a class, try to load the shim jars and return the Class object referring to that class.

Parameters:
className - a class to load out of the shim jar
Returns:
the class object loaded from the shim jar for the given class.
Throws:
java.lang.ClassNotFoundException


Copyright © 2010 Cloudera, Inc.