Class FileRecordWriter
- java.lang.Object
-
- org.datavec.api.records.writer.impl.FileRecordWriter
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Configurable,RecordWriter
- Direct Known Subclasses:
CSVRecordWriter,LineRecordWriter,MatlabRecordWriter,SVMLightRecordWriter
public abstract class FileRecordWriter extends Object implements RecordWriter
-
-
Field Summary
Fields Modifier and Type Field Description protected Configurationconfstatic CharsetDEFAULT_CHARSETprotected Charsetencodingstatic StringNEW_LINEprotected DataOutputStreamoutprotected Partitionerpartitioner-
Fields inherited from interface org.datavec.api.records.writer.RecordWriter
APPEND
-
-
Constructor Summary
Constructors Constructor Description FileRecordWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the recod readerConfigurationgetConf()Return the configuration used by this object.voidinitialize(Configuration configuration, InputSplit split, Partitioner partitioner)Initialize the record reader with the given configuration andInputSplitvoidinitialize(InputSplit inputSplit, Partitioner partitioner)Initialize a record writer with the given input splitvoidsetConf(Configuration conf)Set the configuration to be used by this object.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.datavec.api.records.writer.RecordWriter
supportsBatch, write, writeBatch
-
-
-
-
Field Detail
-
DEFAULT_CHARSET
public static final Charset DEFAULT_CHARSET
-
out
protected DataOutputStream out
-
NEW_LINE
public static final String NEW_LINE
- See Also:
- Constant Field Values
-
encoding
protected Charset encoding
-
partitioner
protected Partitioner partitioner
-
conf
protected Configuration conf
-
-
Method Detail
-
initialize
public void initialize(InputSplit inputSplit, Partitioner partitioner) throws Exception
Description copied from interface:RecordWriterInitialize a record writer with the given input split- Specified by:
initializein interfaceRecordWriter- Parameters:
inputSplit- the input split to initialize with- Throws:
Exception
-
initialize
public void initialize(Configuration configuration, InputSplit split, Partitioner partitioner) throws Exception
Description copied from interface:RecordWriterInitialize the record reader with the given configuration andInputSplit- Specified by:
initializein interfaceRecordWriter- Parameters:
configuration- the configuration to iniailize withsplit- the split to use- Throws:
Exception
-
close
public void close()
Description copied from interface:RecordWriterClose the recod reader- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceRecordWriter
-
setConf
public void setConf(Configuration conf)
Description copied from interface:ConfigurableSet the configuration to be used by this object.- Specified by:
setConfin interfaceConfigurable
-
getConf
public Configuration getConf()
Description copied from interface:ConfigurableReturn the configuration used by this object.- Specified by:
getConfin interfaceConfigurable
-
-