public class FileTap extends Tap<java.util.Properties,java.io.InputStream,java.io.OutputStream> implements FileType<java.util.Properties>
Tap
sub-class that allows for direct local file access.
This class can only open an single file, see DirTap
for reading from a directory tree.
FileTap must be used with the LocalFlowConnector
to create
Flow
instances that run in "local" mode.
CASCADING_SOURCE_PATH
Constructor and Description |
---|
FileTap(Scheme<java.util.Properties,java.io.InputStream,java.io.OutputStream,?,?> scheme,
java.nio.file.Path path)
Constructor FileTap creates a new FileTap instance using the given
Scheme and file path . |
FileTap(Scheme<java.util.Properties,java.io.InputStream,java.io.OutputStream,?,?> scheme,
java.nio.file.Path path,
SinkMode sinkMode)
|
FileTap(Scheme<java.util.Properties,java.io.InputStream,java.io.OutputStream,?,?> scheme,
java.lang.String path)
Constructor FileTap creates a new FileTap instance using the given
Scheme and file path . |
FileTap(Scheme<java.util.Properties,java.io.InputStream,java.io.OutputStream,?,?> scheme,
java.lang.String path,
SinkMode sinkMode)
|
Modifier and Type | Method and Description |
---|---|
boolean |
commitResource(java.util.Properties conf) |
boolean |
createResource(java.util.Properties conf) |
boolean |
deleteResource(java.util.Properties conf) |
java.lang.String[] |
getChildIdentifiers(FlowProcess<? extends java.util.Properties> flowProcess) |
java.lang.String[] |
getChildIdentifiers(FlowProcess<? extends java.util.Properties> flowProcess,
int depth,
boolean fullyQualified) |
java.lang.String[] |
getChildIdentifiers(java.util.Properties conf) |
java.lang.String[] |
getChildIdentifiers(java.util.Properties conf,
int depth,
boolean fullyQualified) |
java.lang.String |
getFullIdentifier(java.util.Properties conf) |
java.lang.String |
getIdentifier() |
long |
getModifiedTime(java.util.Properties conf) |
protected java.lang.String |
getOutputIdentifier()
Only used with
openForWrite(FlowProcess, OutputStream) calls. |
protected java.nio.file.Path |
getPath() |
long |
getSize(FlowProcess<? extends java.util.Properties> flowProcess) |
long |
getSize(java.util.Properties conf) |
boolean |
isDirectory(FlowProcess<? extends java.util.Properties> flowProcess) |
boolean |
isDirectory(java.util.Properties conf) |
TupleEntryIterator |
openForRead(FlowProcess<? extends java.util.Properties> flowProcess,
java.io.InputStream input) |
TupleEntryCollector |
openForWrite(FlowProcess<? extends java.util.Properties> flowProcess,
java.io.OutputStream output) |
boolean |
resourceExists(java.util.Properties conf) |
protected void |
verify() |
createResource, deleteResource, entryStream, entryStream, entryStreamCopy, entryStreamCopy, equals, flowConfInit, getConfigDef, getFullIdentifier, getModifiedTime, getNodeConfigDef, getScheme, getSinkFields, getSinkMode, getSourceFields, getStepConfigDef, getTrace, hasConfigDef, hashCode, hasNodeConfigDef, hasStepConfigDef, id, isKeep, isReplace, isSink, isSource, isTemporary, isUpdate, openForRead, openForReadUnchecked, openForWrite, outgoingScopeFor, prepareResourceForRead, prepareResourceForWrite, presentSinkFields, presentSourceFields, resolveIncomingOperationArgumentFields, resolveIncomingOperationPassThroughFields, resourceExists, retrieveSinkFields, retrieveSourceFields, rollbackResource, setScheme, sinkConfInit, sourceConfInit, spliterator, splititerator, taps, toString, tupleStream, tupleStream, tupleStreamCopy, tupleStreamCopy
public FileTap(Scheme<java.util.Properties,java.io.InputStream,java.io.OutputStream,?,?> scheme, java.lang.String path)
Scheme
and file path
.scheme
- of type Schemepath
- of type Stringpublic FileTap(Scheme<java.util.Properties,java.io.InputStream,java.io.OutputStream,?,?> scheme, java.nio.file.Path path)
Scheme
and file path
.scheme
- of type Schemepath
- of type Pathpublic FileTap(Scheme<java.util.Properties,java.io.InputStream,java.io.OutputStream,?,?> scheme, java.lang.String path, SinkMode sinkMode)
scheme
- of type Schemepath
- of type StringsinkMode
- of type SinkModeprotected void verify()
protected java.nio.file.Path getPath()
public java.lang.String getIdentifier()
getIdentifier
in class Tap<java.util.Properties,java.io.InputStream,java.io.OutputStream>
public java.lang.String getFullIdentifier(java.util.Properties conf)
getFullIdentifier
in class Tap<java.util.Properties,java.io.InputStream,java.io.OutputStream>
public TupleEntryIterator openForRead(FlowProcess<? extends java.util.Properties> flowProcess, java.io.InputStream input) throws java.io.IOException
openForRead
in class Tap<java.util.Properties,java.io.InputStream,java.io.OutputStream>
java.io.IOException
public TupleEntryCollector openForWrite(FlowProcess<? extends java.util.Properties> flowProcess, java.io.OutputStream output) throws java.io.IOException
openForWrite
in class Tap<java.util.Properties,java.io.InputStream,java.io.OutputStream>
java.io.IOException
protected java.lang.String getOutputIdentifier()
openForWrite(FlowProcess, OutputStream)
calls.public boolean createResource(java.util.Properties conf) throws java.io.IOException
createResource
in class Tap<java.util.Properties,java.io.InputStream,java.io.OutputStream>
java.io.IOException
public boolean deleteResource(java.util.Properties conf) throws java.io.IOException
deleteResource
in class Tap<java.util.Properties,java.io.InputStream,java.io.OutputStream>
java.io.IOException
public boolean commitResource(java.util.Properties conf) throws java.io.IOException
commitResource
in class Tap<java.util.Properties,java.io.InputStream,java.io.OutputStream>
java.io.IOException
public boolean resourceExists(java.util.Properties conf) throws java.io.IOException
resourceExists
in class Tap<java.util.Properties,java.io.InputStream,java.io.OutputStream>
java.io.IOException
public long getModifiedTime(java.util.Properties conf) throws java.io.IOException
getModifiedTime
in class Tap<java.util.Properties,java.io.InputStream,java.io.OutputStream>
java.io.IOException
public boolean isDirectory(FlowProcess<? extends java.util.Properties> flowProcess) throws java.io.IOException
isDirectory
in interface FileType<java.util.Properties>
java.io.IOException
public boolean isDirectory(java.util.Properties conf) throws java.io.IOException
isDirectory
in interface FileType<java.util.Properties>
java.io.IOException
public java.lang.String[] getChildIdentifiers(FlowProcess<? extends java.util.Properties> flowProcess) throws java.io.IOException
getChildIdentifiers
in interface FileType<java.util.Properties>
java.io.IOException
public java.lang.String[] getChildIdentifiers(java.util.Properties conf) throws java.io.IOException
getChildIdentifiers
in interface FileType<java.util.Properties>
java.io.IOException
public java.lang.String[] getChildIdentifiers(FlowProcess<? extends java.util.Properties> flowProcess, int depth, boolean fullyQualified) throws java.io.IOException
getChildIdentifiers
in interface FileType<java.util.Properties>
java.io.IOException
public java.lang.String[] getChildIdentifiers(java.util.Properties conf, int depth, boolean fullyQualified) throws java.io.IOException
getChildIdentifiers
in interface FileType<java.util.Properties>
java.io.IOException
public long getSize(FlowProcess<? extends java.util.Properties> flowProcess) throws java.io.IOException
Copyright © 2007-2017 Cascading Maintainers. All Rights Reserved.