|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object it.unimi.di.mg4j.io.HadoopFileSystemIOFactory
public class HadoopFileSystemIOFactory
An I/O factory using a Hadoop file system.
The factory
provides some constructors (HadoopFileSystemIOFactory()
and
HadoopFileSystemIOFactory(String)
) that are suitable for use with
an ObjectParser
. For instance, the object specification
it.unimi.di.mg4j.io.HadoopFileSystemIOFactory(hdfs://127.0.0.1:9000/)
could be used with Scan
or IndexBuilder
to make them use a local HDFS
file system.
Note that if you use the constructors based on the default configuration
you must set up your configuration files suitably.
If you use an unconfigured Hadoop file system, you will get
a Hadoop LocalFileSystem
.
Field Summary |
---|
Fields inherited from interface it.unimi.di.mg4j.io.IOFactory |
---|
FILESYSTEM_FACTORY |
Constructor Summary | |
---|---|
HadoopFileSystemIOFactory()
Creates a factory using a file system with a default configuration. |
|
HadoopFileSystemIOFactory(FileSystem fileSystem)
Creates a factory using a given Hadoop file system. |
|
HadoopFileSystemIOFactory(String uri)
Creates a factory using a file system specified by a given URI with a default configuration |
|
HadoopFileSystemIOFactory(URI uri)
Creates a factory using a file system specified by a given URI with a default configuration. |
Method Summary | |
---|---|
void |
createNewFile(String name)
|
boolean |
delete(String name)
|
boolean |
exists(String name)
|
FSDataInputStream |
getInputStream(String name)
|
FSDataOutputStream |
getOutputStream(String name)
|
ReadableByteChannel |
getReadableByteChannel(String name)
|
WritableByteChannel |
getWritableByteChannel(String name)
|
long |
length(String name)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HadoopFileSystemIOFactory() throws IOException
IOException
public HadoopFileSystemIOFactory(URI uri) throws IOException
URI
with a default configuration.
uri
- a URI that will be passed to FileSystem.get(URI, Configuration)
.
IOException
public HadoopFileSystemIOFactory(String uri) throws IOException
URI
with a default configuration
This constructor is essentially identical to HadoopFileSystemIOFactory(URI)
, but
it can be used with an ObjectParser
.
uri
- a URI, specified as a string, that will be passed to FileSystem.get(URI, Configuration)
.
IOException
public HadoopFileSystemIOFactory(FileSystem fileSystem)
fileSystem
- a Hadoop file system.Method Detail |
---|
public FSDataInputStream getInputStream(String name) throws IOException
getInputStream
in interface IOFactory
IOException
public FSDataOutputStream getOutputStream(String name) throws IOException
getOutputStream
in interface IOFactory
IOException
public WritableByteChannel getWritableByteChannel(String name) throws IOException
getWritableByteChannel
in interface IOFactory
IOException
public ReadableByteChannel getReadableByteChannel(String name) throws IOException
getReadableByteChannel
in interface IOFactory
IOException
public boolean exists(String name) throws IOException
exists
in interface IOFactory
IOException
public boolean delete(String name) throws IOException
delete
in interface IOFactory
IOException
public void createNewFile(String name) throws IOException
createNewFile
in interface IOFactory
IOException
public long length(String name) throws IOException
length
in interface IOFactory
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |