public class HadoopPlugin extends Object implements ApplicationSetup.TerrierApplicationPlugin
Terrier can access a Hadoop Distributed File System (HDFS), allowing collections and indices to be placed there. To do so, ensure that your Hadoop conf/ is on your CLASSPATH, and that the Hadoop plugin is loaded by Terrier, by setting terrier.plugins=org.terrier.utility.io.HadoopPlugin in your terrier.properties file.
| Modifier and Type | Field and Description |
|---|---|
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.slf4j.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 and Description |
|---|
HadoopPlugin()
Constructs a new plugin
|
| Modifier and Type | Method and Description |
|---|---|
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
|
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
|
protected static HadoopPlugin singletonHadoopPlugin
protected static org.apache.hadoop.conf.Configuration singletonConfiguration
protected static final org.slf4j.Logger logger
protected org.apache.hadoop.conf.Configuration config
protected org.apache.hadoop.fs.FileSystem hadoopFS
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
IOExceptionpublic void initialise()
throws Exception
initialise in interface ApplicationSetup.TerrierApplicationPluginExceptionpublic org.apache.hadoop.conf.Configuration getConfiguration()
Terrier Information Retrieval Platform 5.2. Copyright © 2004-2019, University of Glasgow