Package org.apache.nutch.indexwriter.csv
Class CSVIndexWriter
java.lang.Object
org.apache.nutch.indexwriter.csv.CSVIndexWriter
- All Implemented Interfaces:
Configurable,IndexWriter,Pluggable
Write Nutch documents to a CSV file (comma separated values), i.e., dump
index as CSV or tab-separated plain text table. Format (encoding, separators,
etc.) is configurable by a couple of options, see output of
describe().
Note: works only in local mode, to be used with index option
-noCommit.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classrepresent separators (also quote and escape characters) as char(s) and byte(s) in the output encoding for efficiency. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FSDataOutputStreamprotected Charsetencoding of CSV fileFields inherited from interface org.apache.nutch.indexer.IndexWriter
X_POINT_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidcommit()(nothing to commit)void(deletion of documents is not supported)describe()ReturnsMapwith the specific parameters the IndexWriter instance can take.getConf()static voidvoidopen(Configuration conf, String name) voidopen(IndexWriterParams parameters) Initializes the internal variables from a given index writer configuration.voidsetConf(Configuration conf) voidupdate(NutchDocument doc) voidwrite(NutchDocument doc)
-
Field Details
-
encoding
encoding of CSV file -
csvout
-
-
Constructor Details
-
CSVIndexWriter
public CSVIndexWriter()
-
-
Method Details
-
open
- Specified by:
openin interfaceIndexWriter- Parameters:
conf- Nutch configurationname- target name of theIndexWriterto be opened- Throws:
IOException- Some exception thrown by some writer.
-
open
Initializes the internal variables from a given index writer configuration.- Specified by:
openin interfaceIndexWriter- Parameters:
parameters- Params from the index writer configuration.- Throws:
IOException- Some exception thrown by writer.
-
write
- Specified by:
writein interfaceIndexWriter- Throws:
IOException
-
delete
(deletion of documents is not supported)- Specified by:
deletein interfaceIndexWriter
-
update
- Specified by:
updatein interfaceIndexWriter- Throws:
IOException
-
close
- Specified by:
closein interfaceIndexWriter- Throws:
IOException
-
commit
public void commit()(nothing to commit)- Specified by:
commitin interfaceIndexWriter
-
getConf
- Specified by:
getConfin interfaceConfigurable
-
describe
ReturnsMapwith the specific parameters the IndexWriter instance can take.- Specified by:
describein interfaceIndexWriter- Returns:
- The values of each row. It must have the form <KEY,<DESCRIPTION,VALUE>>.
-
setConf
- Specified by:
setConfin interfaceConfigurable
-
main
- Throws:
Exception
-