|
virtual void | BeforeFirst (void) |
| reset the position of InputSplit to beginning
|
|
virtual void | HintChunkSize (size_t chunk_size) |
| hint the inputsplit how large the chunk size it should return when implementing NextChunk this is a hint so may not be enforced, but InputSplit will try adjust its internal buffer size to the hinted value
|
|
virtual size_t | GetTotalSize (void) |
| get the total size of the InputSplit
|
|
virtual bool | NextRecord (Blob *out_rec) |
| get the next record, the returning value is valid until next call to NextRecord, NextChunk or NextBatch caller can modify the memory content of out_rec
|
|
virtual bool | NextChunk (Blob *out_chunk) |
| get a chunk of memory that can contain multiple records, the caller needs to parse the content of the resulting chunk, for text file, out_chunk can contain data of multiple lines for recordio, out_chunk can contain multiple records(including headers)
|
|
virtual void | ResetPartition (unsigned rank, unsigned nsplit) |
| reset the Input split to a certain part id, The InputSplit will be pointed to the head of the new specified segment. This feature may not be supported by every implementation of InputSplit.
|
|
virtual bool | ReadChunk (void *buf, size_t *size) |
| read a chunk of data into buf the data can span multiple records, but cannot contain partial records
|
|
bool | ExtractNextChunk (Blob *out_rchunk, Chunk *chunk) |
| extract next chunk from the chunk
|
|
virtual bool | ExtractNextRecord (Blob *out_rec, Chunk *chunk)=0 |
| extract next record from the chunk
|
|
virtual bool | IsTextParser (void)=0 |
| query whether this object is a text parser
|
|
virtual bool | NextChunkEx (Chunk *chunk) |
| fill the given chunk with new data without using internal temporary chunk
|
|
virtual bool | NextBatchEx (Chunk *chunk, size_t) |
| fill the given chunk with new batch of data without using internal temporary chunk
|
|
virtual bool | NextBatch (Blob *out_chunk, size_t) |
| get a chunk of memory that can contain multiple records, with hint for how many records is needed, the caller needs to parse the content of the resulting chunk, for text file, out_chunk can contain data of multiple lines for recordio, out_chunk can contain multiple records(including headers)
|
|
virtual | ~InputSplit (void) DMLC_THROW_EXCEPTION |
| destructor
|
|
|
void | Init (FileSystem *fs, const char *uri, size_t align_bytes, const bool recurse_directories=false) |
| intialize the base before doing anything
|
|
virtual size_t | SeekRecordBegin (Stream *fi)=0 |
| seek to the beginning of the first record in current file pointer
|
|
virtual const char * | FindLastRecordBegin (const char *begin, const char *end)=0 |
| find the last occurance of record header
|
|
std::vector< URI > | ConvertToURIs (const std::string &uri) |
| split string list of files into vector of URIs
|
|
size_t | Read (void *ptr, size_t size) |
| same as stream.Read
|
|
|
static InputSplit * | Create (const char *uri, unsigned part_index, unsigned num_parts, const char *type) |
| factory function: create input split given a uri
|
|
static InputSplit * | Create (const char *uri, const char *index_uri, unsigned part_index, unsigned num_parts, const char *type, const bool shuffle=false, const int seed=0, const size_t batch_size=256, const bool recurse_directories=false) |
| factory function: create input split given a uri for input and index
|
|
class to construct input split from multiple files
virtual bool dmlc::io::InputSplitBase::NextChunk |
( |
Blob * |
out_chunk | ) |
|
|
inlinevirtual |
get a chunk of memory that can contain multiple records, the caller needs to parse the content of the resulting chunk, for text file, out_chunk can contain data of multiple lines for recordio, out_chunk can contain multiple records(including headers)
This function ensures there won't be partial record in the chunk caller can modify the memory content of out_chunk, the memory is valid until next call to NextRecord, NextChunk or NextBatch
Usually NextRecord is sufficient, NextChunk can be used by some multi-threaded parsers to parse the input content
- Parameters
-
out_chunk | used to store the result |
- Returns
- true if we can successfully get next record false if we reached end of split
- See also
- InputSplit::Create for definition of record
-
RecordIOChunkReader to parse recordio content from out_chunk
Implements dmlc::InputSplit.
Reimplemented in dmlc::io::IndexedRecordIOSplitter.
virtual bool dmlc::io::InputSplitBase::NextRecord |
( |
Blob * |
out_rec | ) |
|
|
inlinevirtual |
get the next record, the returning value is valid until next call to NextRecord, NextChunk or NextBatch caller can modify the memory content of out_rec
For text, out_rec contains a single line For recordio, out_rec contains one record content(with header striped)
- Parameters
-
out_rec | used to store the result |
- Returns
- true if we can successfully get next record false if we reached end of split
- See also
- InputSplit::Create for definition of record
Implements dmlc::InputSplit.
Reimplemented in dmlc::io::IndexedRecordIOSplitter.