org.apache.hadoop.hive.shims
Interface HadoopShims


public interface HadoopShims

In order to be compatible with multiple versions of Hadoop, all parts of the Hadoop interface that are not cross-version compatible are encapsulated in an implementation of this class. Users should use the ShimLoader class as a factory to obtain an implementation of HadoopShims corresponding to the version of Hadoop currently on the classpath.


Nested Class Summary
static interface HadoopShims.MiniDFSShim
          Shim around the functions in MiniDFSCluster that Hive uses.
 
Method Summary
 int compareText(org.apache.hadoop.io.Text a, org.apache.hadoop.io.Text b)
          We define this function here to make the code compatible between hadoop 0.17 and hadoop 0.20.
 boolean fileSystemDeleteOnExit(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path)
          Calls fs.deleteOnExit(path) if such a function exists.
 HadoopShims.MiniDFSShim getMiniDfs(org.apache.hadoop.conf.Configuration conf, int numDataNodes, boolean format, String[] racks)
          Returns a shim to wrap MiniDFSCluster.
 void inputFormatValidateInput(org.apache.hadoop.mapred.InputFormat fmt, org.apache.hadoop.mapred.JobConf conf)
          Calls fmt.validateInput(conf) if such a function exists.
 void setTmpFiles(String prop, String files)
          If JobClient.getCommandLineConfig exists, sets the given property/value pair in that Configuration object.
 boolean usesJobShell()
          Return true if the current version of Hadoop uses the JobShell for command line interpretation.
 

Method Detail

usesJobShell

boolean usesJobShell()
Return true if the current version of Hadoop uses the JobShell for command line interpretation.


fileSystemDeleteOnExit

boolean fileSystemDeleteOnExit(org.apache.hadoop.fs.FileSystem fs,
                               org.apache.hadoop.fs.Path path)
                               throws IOException
Calls fs.deleteOnExit(path) if such a function exists.

Returns:
true if the call was successful
Throws:
IOException

inputFormatValidateInput

void inputFormatValidateInput(org.apache.hadoop.mapred.InputFormat fmt,
                              org.apache.hadoop.mapred.JobConf conf)
                              throws IOException
Calls fmt.validateInput(conf) if such a function exists.

Throws:
IOException

setTmpFiles

void setTmpFiles(String prop,
                 String files)
If JobClient.getCommandLineConfig exists, sets the given property/value pair in that Configuration object. This applies for Hadoop 0.17 through 0.19


getMiniDfs

HadoopShims.MiniDFSShim getMiniDfs(org.apache.hadoop.conf.Configuration conf,
                                   int numDataNodes,
                                   boolean format,
                                   String[] racks)
                                   throws IOException
Returns a shim to wrap MiniDFSCluster. This is necessary since this class was moved from org.apache.hadoop.dfs to org.apache.hadoop.hdfs

Throws:
IOException

compareText

int compareText(org.apache.hadoop.io.Text a,
                org.apache.hadoop.io.Text b)
We define this function here to make the code compatible between hadoop 0.17 and hadoop 0.20. Hive binary that compiled Text.compareTo(Text) with hadoop 0.20 won't work with hadoop 0.17 because in hadoop 0.20, Text.compareTo(Text) is implemented in org.apache.hadoop.io.BinaryComparable, and Java compiler references that class, which is not available in hadoop 0.17.



Copyright © 2009 The Apache Software Foundation