cascading.tap.local
Class FileTap

java.lang.Object
  extended by cascading.tap.Tap<Properties,InputStream,OutputStream>
      extended by cascading.tap.local.FileTap
All Implemented Interfaces:
FlowElement, FileType<Properties>, Traceable, Serializable

public class FileTap
extends Tap<Properties,InputStream,OutputStream>
implements FileType<Properties>

Class FileTap is a Tap sub-class that allows for direct local file access.

FileTap must be used with the LocalFlowConnector to create Flow instances that run in "local" mode.

See Also:
Serialized Form

Constructor Summary
FileTap(Scheme<Properties,InputStream,OutputStream,?,?> scheme, String path)
          Constructor FileTap creates a new FileTap instance using the given Scheme and file path.
FileTap(Scheme<Properties,InputStream,OutputStream,?,?> scheme, String path, SinkMode sinkMode)
          Constructor FileTap creates a new FileTap instance using the given Scheme, file path, and SinkMode.
 
Method Summary
 boolean commitResource(Properties conf)
           
 boolean createResource(Properties conf)
           
 boolean deleteResource(Properties conf)
           
 String[] getChildIdentifiers(Properties conf)
           
 String[] getChildIdentifiers(Properties conf, int depth, boolean fullyQualified)
           
 String getFullIdentifier(Properties conf)
           
 String getIdentifier()
           
 long getModifiedTime(Properties conf)
           
 long getSize(Properties conf)
           
 boolean isDirectory(Properties conf)
           
 TupleEntryIterator openForRead(FlowProcess<Properties> flowProcess, InputStream input)
           
 TupleEntryCollector openForWrite(FlowProcess<Properties> flowProcess, OutputStream output)
           
 boolean resourceExists(Properties conf)
           
 
Methods inherited from class cascading.tap.Tap
createResource, deleteResource, equals, flowConfInit, getConfigDef, getFullIdentifier, getModifiedTime, getScheme, getSinkFields, getSinkMode, getSourceFields, getStepConfigDef, getTrace, hasConfigDef, hashCode, hasStepConfigDef, id, isEquivalentTo, isKeep, isReplace, isSink, isSource, isTemporary, isUpdate, openForRead, openForWrite, outgoingScopeFor, prepareResourceForRead, prepareResourceForWrite, presentSinkFields, presentSourceFields, resolveIncomingOperationArgumentFields, resolveIncomingOperationPassThroughFields, resourceExists, retrieveSinkFields, retrieveSourceFields, rollbackResource, setScheme, sinkConfInit, sourceConfInit, taps, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileTap

public FileTap(Scheme<Properties,InputStream,OutputStream,?,?> scheme,
               String path)
Constructor FileTap creates a new FileTap instance using the given Scheme and file path.

Parameters:
scheme - of type LocalScheme
path - of type String

FileTap

public FileTap(Scheme<Properties,InputStream,OutputStream,?,?> scheme,
               String path,
               SinkMode sinkMode)
Constructor FileTap creates a new FileTap instance using the given Scheme, file path, and SinkMode.

Parameters:
scheme - of type LocalScheme
path - of type String
sinkMode - of type SinkMode
Method Detail

getIdentifier

public String getIdentifier()
Specified by:
getIdentifier in class Tap<Properties,InputStream,OutputStream>

getFullIdentifier

public String getFullIdentifier(Properties conf)
Overrides:
getFullIdentifier in class Tap<Properties,InputStream,OutputStream>

openForRead

public TupleEntryIterator openForRead(FlowProcess<Properties> flowProcess,
                                      InputStream input)
                               throws IOException
Specified by:
openForRead in class Tap<Properties,InputStream,OutputStream>
Throws:
IOException

openForWrite

public TupleEntryCollector openForWrite(FlowProcess<Properties> flowProcess,
                                        OutputStream output)
                                 throws IOException
Specified by:
openForWrite in class Tap<Properties,InputStream,OutputStream>
Throws:
IOException

getSize

public long getSize(Properties conf)
             throws IOException
Specified by:
getSize in interface FileType<Properties>
Throws:
IOException

createResource

public boolean createResource(Properties conf)
                       throws IOException
Specified by:
createResource in class Tap<Properties,InputStream,OutputStream>
Throws:
IOException

deleteResource

public boolean deleteResource(Properties conf)
                       throws IOException
Specified by:
deleteResource in class Tap<Properties,InputStream,OutputStream>
Throws:
IOException

commitResource

public boolean commitResource(Properties conf)
                       throws IOException
Overrides:
commitResource in class Tap<Properties,InputStream,OutputStream>
Throws:
IOException

resourceExists

public boolean resourceExists(Properties conf)
                       throws IOException
Specified by:
resourceExists in class Tap<Properties,InputStream,OutputStream>
Throws:
IOException

getModifiedTime

public long getModifiedTime(Properties conf)
                     throws IOException
Specified by:
getModifiedTime in class Tap<Properties,InputStream,OutputStream>
Throws:
IOException

isDirectory

public boolean isDirectory(Properties conf)
                    throws IOException
Specified by:
isDirectory in interface FileType<Properties>
Throws:
IOException

getChildIdentifiers

public String[] getChildIdentifiers(Properties conf)
                             throws IOException
Specified by:
getChildIdentifiers in interface FileType<Properties>
Throws:
IOException

getChildIdentifiers

public String[] getChildIdentifiers(Properties conf,
                                    int depth,
                                    boolean fullyQualified)
                             throws IOException
Specified by:
getChildIdentifiers in interface FileType<Properties>
Throws:
IOException


Copyright © 2007-2015 Concurrent, Inc. All Rights Reserved.