|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.terrier.utility.io.HadoopPlugin
public class HadoopPlugin
This class provides the main glue between Terrier and Hadoop. It has several main roles:
HadoopPlugin.JobFactory jf = HadoopPlugin.getJobFactory("HOD-TerrierIndexing");
if (jf == null)
throw new Exception("Could not get JobFactory from HadoopPlugin");
JobConf conf = jf.newJob();
....
jf.close(); //closing the JobFactory will ensure that the HOD session ends
When using your own code in Terrier MapReduce jobs, ensure that you configure the Terrier application before
anything else:
public void configure(JobConf jc)
{
try{
HadoopUtility.loadTerrierJob(jc);
} catch (Exception e) {
throw new Error("Cannot load ApplicationSetup", e);
}
}
| Nested Class Summary | |
|---|---|
static class |
HadoopPlugin.JobFactory
a Job Factory is responsible for creating Terrier MapReduce jobs. |
| Field Summary | |
|---|---|
protected org.apache.hadoop.conf.Configuration |
config
configuration used by this plugin |
protected org.apache.hadoop.fs.FileSystem |
hadoopFS
distributed file system used by this plugin |
protected static org.apache.log4j.Logger |
logger
The logger used |
protected static org.apache.hadoop.conf.Configuration |
singletonConfiguration
main configuration object to use for Hadoop access |
protected static HadoopPlugin |
singletonHadoopPlugin
instance of this class - it is a singleton |
| Constructor Summary | |
|---|---|
HadoopPlugin()
Constructs a new plugin |
|
| Method Summary | |
|---|---|
org.apache.hadoop.conf.Configuration |
getConfiguration()
Returns the Hadoop configuration underlying this plugin instance |
static org.apache.hadoop.fs.FileSystem |
getDefaultFileSystem()
What is the default file system according to Hadoop |
static String |
getDefaultFileSystemPrefix()
What is the String prefix of the default file system according to Hadoop |
static URI |
getDefaultFileSystemURI()
What is the URI of the default file system according to Hadoop |
static org.apache.hadoop.conf.Configuration |
getGlobalConfiguration()
Obtain the global Hadoop configuration in use by the plugin |
static HadoopPlugin.JobFactory |
getJobFactory(String sessionName)
Get a JobFactory with the specified session name. |
protected static HadoopPlugin.JobFactory |
getJobFactory(String sessionName,
boolean persistent)
implements the obtaining of job factories |
void |
initialise()
Initialises the Plugin, by connecting to the distributed file system |
static void |
setGlobalConfiguration(org.apache.hadoop.conf.Configuration _config)
Update the global Hadoop configuration in use by the plugin |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static HadoopPlugin singletonHadoopPlugin
protected static org.apache.hadoop.conf.Configuration singletonConfiguration
protected static final org.apache.log4j.Logger logger
protected org.apache.hadoop.conf.Configuration config
protected org.apache.hadoop.fs.FileSystem hadoopFS
| Constructor Detail |
|---|
public HadoopPlugin()
| Method Detail |
|---|
public static HadoopPlugin.JobFactory getJobFactory(String sessionName)
protected static HadoopPlugin.JobFactory getJobFactory(String sessionName,
boolean persistent)
public static void setGlobalConfiguration(org.apache.hadoop.conf.Configuration _config)
public static org.apache.hadoop.conf.Configuration getGlobalConfiguration()
public static String getDefaultFileSystemPrefix()
public static URI getDefaultFileSystemURI()
public static org.apache.hadoop.fs.FileSystem getDefaultFileSystem()
throws IOException
IOException
public void initialise()
throws Exception
initialise in interface ApplicationSetup.TerrierApplicationPluginExceptionpublic org.apache.hadoop.conf.Configuration getConfiguration()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||