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 Configuration
conf
static Charset
DEFAULT_CHARSET
protected Charset
encoding
static String
NEW_LINE
protected DataOutputStream
out
protected Partitioner
partitioner
-
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 void
close()
Close the recod readerConfiguration
getConf()
Return the configuration used by this object.void
initialize(Configuration configuration, InputSplit split, Partitioner partitioner)
Initialize the record reader with the given configuration andInputSplit
void
initialize(InputSplit inputSplit, Partitioner partitioner)
Initialize a record writer with the given input splitvoid
setConf(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:RecordWriter
Initialize a record writer with the given input split- Specified by:
initialize
in 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:RecordWriter
Initialize the record reader with the given configuration andInputSplit
- Specified by:
initialize
in interfaceRecordWriter
- Parameters:
configuration
- the configuration to iniailize withsplit
- the split to use- Throws:
Exception
-
close
public void close()
Description copied from interface:RecordWriter
Close the recod reader- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceRecordWriter
-
setConf
public void setConf(Configuration conf)
Description copied from interface:Configurable
Set the configuration to be used by this object.- Specified by:
setConf
in interfaceConfigurable
-
getConf
public Configuration getConf()
Description copied from interface:Configurable
Return the configuration used by this object.- Specified by:
getConf
in interfaceConfigurable
-
-