|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cascading.tap.Tap cascading.tap.Hfs
public class Hfs
Class Hfs is the base class for all Hadoop file system access. Use Dfs
, Lfs
, or S3fs
for resources specific to Hadoop Distributed file system, the Local file system, or Amazon S3, respectively.
hdfs://...
will denonte Dfs, file://...
will denote Lfs, and
s3://aws_id:aws_secret@bucket/...
will denote S3fs.
Call setTemporaryDirectory(java.util.Map, String)
to use a different temporary file directory path
other than the current Hadoop default path.
Constructor Summary | |
---|---|
protected |
Hfs()
|
|
Hfs(Fields fields,
String stringPath)
Constructor Hfs creates a new Hfs instance. |
|
Hfs(Fields fields,
String stringPath,
boolean replace)
Constructor Hfs creates a new Hfs instance. |
|
Hfs(Fields fields,
String stringPath,
SinkMode sinkMode)
Constructor Hfs creates a new Hfs instance. |
protected |
Hfs(Scheme scheme)
|
|
Hfs(Scheme scheme,
String stringPath)
Constructor Hfs creates a new Hfs instance. |
|
Hfs(Scheme scheme,
String stringPath,
boolean replace)
Constructor Hfs creates a new Hfs instance. |
|
Hfs(Scheme scheme,
String stringPath,
SinkMode sinkMode)
Constructor Hfs creates a new Hfs instance. |
Method Summary | |
---|---|
boolean |
deletePath(JobConf conf)
Method deletePath deletes the resource represented by this instance. |
boolean |
equals(Object object)
|
protected FileSystem |
getDefaultFileSystem(JobConf jobConf)
|
URI |
getDefaultFileSystemURIScheme(JobConf jobConf)
Method getDefaultFileSystemURIScheme returns the URI scheme for the default Hadoop FileSystem. |
protected FileSystem |
getFileSystem(JobConf jobConf)
|
Path |
getPath()
Method getPath returns the Hadoop path to the resource represented by this Tap instance. |
long |
getPathModified(JobConf conf)
Method getPathModified returns the date this resource was last modified. |
Path |
getQualifiedPath(JobConf conf)
Method getQualifiedPath returns a FileSystem fully qualified Hadoop Path. |
static String |
getTemporaryDirectory(Map<Object,Object> properties)
Methdo getTemporaryDirectory returns the configured temporary directory from the given properties object. |
protected Path |
getTempPath(JobConf conf)
|
URI |
getURIScheme(JobConf jobConf)
|
int |
hashCode()
|
boolean |
isWriteDirect()
Method isWriteDirect returns true if this instances TupleEntryCollector should be used to sink values. |
boolean |
makeDirs(JobConf conf)
Method makeDirs makes all the directories this Tap instance represents. |
protected String |
makeTemporaryPathDir(String name)
|
protected URI |
makeURIScheme(JobConf jobConf)
|
TupleEntryIterator |
openForRead(JobConf conf)
Method openForRead opens the resource represented by this Tap instance. |
TupleEntryCollector |
openForWrite(JobConf conf)
Method openForWrite opens the resource represented by this Tap instance. |
boolean |
pathExists(JobConf conf)
Method pathExists return true if the path represented by this instance exists. |
protected void |
setStringPath(String stringPath)
|
static void |
setTemporaryDirectory(Map<Object,Object> properties,
String tempDir)
Method setTemporaryDirectory sets the temporary directory on the given properties object. |
protected void |
setUriScheme(URI uriScheme)
|
void |
sinkInit(JobConf conf)
Method sinkInit initializes this instance as a sink. |
void |
sourceInit(JobConf conf)
Method sourceInit initializes this instance as a source. |
String |
toString()
|
Methods inherited from class cascading.tap.Tap |
---|
flowInit, getIdentifier, getScheme, getSinkFields, getSinkMode, getSourceFields, isAppend, isEquivalentTo, isKeep, isReplace, isSink, isSource, isUpdate, outgoingScopeFor, resolveFields, resolveIncomingOperationFields, setScheme, setWriteDirect, sink, source, taps |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected Hfs()
@ConstructorProperties(value="scheme") protected Hfs(Scheme scheme)
@ConstructorProperties(value={"fields","stringPath"}) public Hfs(Fields fields, String stringPath)
fields
- of type FieldsstringPath
- of type String@ConstructorProperties(value={"fields","stringPath","replace"}) public Hfs(Fields fields, String stringPath, boolean replace)
fields
- of type FieldsstringPath
- of type Stringreplace
- of type boolean@ConstructorProperties(value={"fields","stringPath","sinkMode"}) public Hfs(Fields fields, String stringPath, SinkMode sinkMode)
fields
- of type FieldsstringPath
- of type StringsinkMode
- of type SinkMode@ConstructorProperties(value={"scheme","stringPath"}) public Hfs(Scheme scheme, String stringPath)
scheme
- of type SchemestringPath
- of type String@ConstructorProperties(value={"scheme","stringPath","replace"}) public Hfs(Scheme scheme, String stringPath, boolean replace)
scheme
- of type SchemestringPath
- of type Stringreplace
- of type boolean@ConstructorProperties(value={"scheme","stringPath","sinkMode"}) public Hfs(Scheme scheme, String stringPath, SinkMode sinkMode)
scheme
- of type SchemestringPath
- of type StringsinkMode
- of type SinkModeMethod Detail |
---|
public static void setTemporaryDirectory(Map<Object,Object> properties, String tempDir)
properties
- of type Mappublic static String getTemporaryDirectory(Map<Object,Object> properties)
properties
- of type Mapprotected void setStringPath(String stringPath)
protected void setUriScheme(URI uriScheme)
public URI getURIScheme(JobConf jobConf) throws IOException
IOException
protected URI makeURIScheme(JobConf jobConf) throws IOException
IOException
public URI getDefaultFileSystemURIScheme(JobConf jobConf) throws IOException
jobConf
- of type JobConf
IOException
- whenpublic boolean isWriteDirect()
Tap
TupleEntryCollector
should be used to sink values.
isWriteDirect
in class Tap
protected FileSystem getDefaultFileSystem(JobConf jobConf) throws IOException
IOException
protected FileSystem getFileSystem(JobConf jobConf) throws IOException
IOException
public Path getPath()
Tap
getPath
in class Tap
Tap.getPath()
public Path getQualifiedPath(JobConf conf) throws IOException
Tap
getQualifiedPath
in class Tap
conf
- of type JobConf
IOException
- whenpublic void sourceInit(JobConf conf) throws IOException
Tap
Flow
instance or if it participates in multiple times in a given Flow or across different Flows in
a Cascade
.
In the context of a Flow, it will be called after
FlowListener.onStarting(cascading.flow.Flow)
sourceInit
in class Tap
conf
- of type JobConf
IOException
- on resource initialization failure.public void sinkInit(JobConf conf) throws IOException
Tap
Flow
instance or if it participates in multiple times in a given Flow or across different Flows in
a Cascade
.
Note this method will be called in context of this Tap being used as a traditional 'sink' and as a 'trap'.
In the context of a Flow, it will be called after
FlowListener.onStarting(cascading.flow.Flow)
sinkInit
in class Tap
conf
- of type JobConf
IOException
- on resource initialization failure.public boolean makeDirs(JobConf conf) throws IOException
Tap
makeDirs
in class Tap
conf
- of type JobConf
IOException
- when there is an error making directoriespublic boolean deletePath(JobConf conf) throws IOException
Tap
deletePath
in class Tap
conf
- of type JobConf
IOException
- when the resource cannot be deletedpublic boolean pathExists(JobConf conf) throws IOException
Tap
pathExists
in class Tap
conf
- of type JobConf
IOException
- when the status cannot be determinedpublic long getPathModified(JobConf conf) throws IOException
Tap
getPathModified
in class Tap
conf
- of type JobConf
IOException
- when the modified date cannot be determinedprotected Path getTempPath(JobConf conf)
protected String makeTemporaryPathDir(String name)
public String toString()
toString
in class Object
Object.toString()
public boolean equals(Object object)
equals
in class Tap
Tap.equals(Object)
public int hashCode()
hashCode
in class Tap
Tap.hashCode()
public TupleEntryIterator openForRead(JobConf conf) throws IOException
Tap
openForRead
in class Tap
conf
- of type JobConf
IOException
- when the resource cannot be openedpublic TupleEntryCollector openForWrite(JobConf conf) throws IOException
Tap
openForWrite
in class Tap
conf
- of type JobConf
IOException
- when
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |