Package org.datavec.api.records.writer
Interface RecordWriter
-
- All Superinterfaces:
AutoCloseable
,Closeable
,Configurable
- All Known Implementing Classes:
CSVRecordWriter
,FileRecordWriter
,LibSvmRecordWriter
,LineRecordWriter
,MatlabRecordWriter
,SVMLightRecordWriter
public interface RecordWriter extends Closeable, Configurable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Close the recod readervoid
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 splitboolean
supportsBatch()
Returns true if this record writer supports efficient batch writing usingwriteBatch(List)
PartitionMetaData
write(List<Writable> record)
Write a recordPartitionMetaData
writeBatch(List<List<Writable>> batch)
Write a batch of records-
Methods inherited from interface org.datavec.api.conf.Configurable
getConf, setConf
-
-
-
-
Field Detail
-
APPEND
static final String APPEND
- See Also:
- Constant Field Values
-
-
Method Detail
-
supportsBatch
boolean supportsBatch()
Returns true if this record writer supports efficient batch writing usingwriteBatch(List)
- Returns:
-
initialize
void initialize(InputSplit inputSplit, Partitioner partitioner) throws Exception
Initialize a record writer with the given input split- Parameters:
inputSplit
- the input split to initialize withpartitioner
-- Throws:
Exception
-
initialize
void initialize(Configuration configuration, InputSplit split, Partitioner partitioner) throws Exception
Initialize the record reader with the given configuration andInputSplit
- Parameters:
configuration
- the configuration to iniailize withsplit
- the split to usepartitioner
-- Throws:
Exception
-
write
PartitionMetaData write(List<Writable> record) throws IOException
Write a record- Parameters:
record
- the record to write- Throws:
IOException
-
writeBatch
PartitionMetaData writeBatch(List<List<Writable>> batch) throws IOException
Write a batch of records- Parameters:
batch
- the batch to write- Throws:
IOException
-
close
void close()
Close the recod reader- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
-