@Namespace(value="dmlc") @Properties(inherit=tvm_runtime.class) public class InputSplit extends Pointer
| Modifier and Type | Class and Description |
|---|---|
static class |
InputSplit.Blob
\brief a blob of memory region
|
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter| Constructor and Description |
|---|
InputSplit(Pointer p)
Pointer cast constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
BeforeFirst()
\brief reset the position of InputSplit to beginning
|
long |
GetTotalSize()
\brief get the total size of the InputSplit
|
void |
HintChunkSize(long arg0)
\brief 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
|
boolean |
NextBatch(InputSplit.Blob out_chunk,
long arg1)
\brief 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)
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
|
boolean |
NextChunk(InputSplit.Blob out_chunk)
\brief 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
|
boolean |
NextRecord(InputSplit.Blob out_rec)
\brief 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)
|
void |
ResetPartition(int part_index,
int num_parts)
\brief reset the Input split to a certain part id,
The InputSplit will be pointed to the head of the new specified segment.
|
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zeropublic InputSplit(Pointer p)
Pointer(Pointer).public void HintChunkSize(@Cast(value="size_t") long arg0)
@Cast(value="size_t") public long GetTotalSize()
public void BeforeFirst()
@Cast(value="bool") public boolean NextRecord(InputSplit.Blob out_rec)
out_rec - used to store the resultfor definition of record@Cast(value="bool") public boolean NextChunk(InputSplit.Blob out_chunk)
out_chunk - used to store the resultfor definition of record,
to parse recordio content from out_chunk@Cast(value="bool") public boolean NextBatch(InputSplit.Blob out_chunk, @Cast(value="size_t") long arg1)
out_chunk - used to store the resultfor definition of record,
to parse recordio content from out_chunkpublic void ResetPartition(@Cast(value="unsigned") int part_index, @Cast(value="unsigned") int num_parts)
part_index - The part id of the new input.num_parts - The total number of parts.Copyright © 2024. All rights reserved.