This project has retired. For details please refer to its Attic page.
TextFileTableSource (Apache Crunch 0.9.0 API)

org.apache.crunch.io.text
Class TextFileTableSource<K,V>

java.lang.Object
  extended by org.apache.crunch.io.impl.FileSourceImpl<Pair<K,V>>
      extended by org.apache.crunch.io.impl.FileTableSourceImpl<K,V>
          extended by org.apache.crunch.io.text.TextFileTableSource<K,V>
All Implemented Interfaces:
ReadableSource<Pair<K,V>>, Source<Pair<K,V>>, TableSource<K,V>

public class TextFileTableSource<K,V>
extends FileTableSourceImpl<K,V>
implements ReadableSource<Pair<K,V>>

A Source that uses the KeyValueTextInputFormat to process input text. If a separator for the keys and values in the text file is not specified, a tab character is used.


Field Summary
 
Fields inherited from class org.apache.crunch.io.impl.FileSourceImpl
inputBundle, path, paths, ptype
 
Constructor Summary
TextFileTableSource(List<org.apache.hadoop.fs.Path> paths, PTableType<K,V> tableType)
           
TextFileTableSource(List<org.apache.hadoop.fs.Path> paths, PTableType<K,V> tableType, String separator)
           
TextFileTableSource(org.apache.hadoop.fs.Path path, PTableType<K,V> tableType)
           
TextFileTableSource(org.apache.hadoop.fs.Path path, PTableType<K,V> tableType, String separator)
           
TextFileTableSource(String path, PTableType<K,V> tableType)
           
TextFileTableSource(String path, PTableType<K,V> tableType, String separator)
           
 
Method Summary
 ReadableData<Pair<K,V>> asReadable()
           
 Iterable<Pair<K,V>> read(org.apache.hadoop.conf.Configuration conf)
          Returns an Iterable that contains the contents of this source.
 String toString()
           
 
Methods inherited from class org.apache.crunch.io.impl.FileTableSourceImpl
getTableType
 
Methods inherited from class org.apache.crunch.io.impl.FileSourceImpl
configureSource, equals, getBundle, getConverter, getLastModifiedAt, getPath, getPaths, getSize, getType, hashCode, inputConf, pathsAsString, read
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.crunch.Source
configureSource, getConverter, getLastModifiedAt, getSize, getType, inputConf
 

Constructor Detail

TextFileTableSource

public TextFileTableSource(String path,
                           PTableType<K,V> tableType)

TextFileTableSource

public TextFileTableSource(org.apache.hadoop.fs.Path path,
                           PTableType<K,V> tableType)

TextFileTableSource

public TextFileTableSource(List<org.apache.hadoop.fs.Path> paths,
                           PTableType<K,V> tableType)

TextFileTableSource

public TextFileTableSource(String path,
                           PTableType<K,V> tableType,
                           String separator)

TextFileTableSource

public TextFileTableSource(org.apache.hadoop.fs.Path path,
                           PTableType<K,V> tableType,
                           String separator)

TextFileTableSource

public TextFileTableSource(List<org.apache.hadoop.fs.Path> paths,
                           PTableType<K,V> tableType,
                           String separator)
Method Detail

toString

public String toString()
Overrides:
toString in class FileSourceImpl<Pair<K,V>>

read

public Iterable<Pair<K,V>> read(org.apache.hadoop.conf.Configuration conf)
                         throws IOException
Description copied from interface: ReadableSource
Returns an Iterable that contains the contents of this source.

Specified by:
read in interface ReadableSource<Pair<K,V>>
Parameters:
conf - The current Configuration instance
Returns:
the contents of this Source as an Iterable instance
Throws:
IOException

asReadable

public ReadableData<Pair<K,V>> asReadable()
Specified by:
asReadable in interface ReadableSource<Pair<K,V>>
Returns:
a ReadableData instance containing the data referenced by this ReadableSource.


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.