public final class RecordBatchSizerManager extends Object
Modifier and Type | Class and Description |
---|---|
static class |
RecordBatchSizerManager.ColumnMemoryQuota
Field memory quota
|
static interface |
RecordBatchSizerManager.FieldOverflowState
An abstraction to allow column readers attach custom field overflow state
|
static class |
RecordBatchSizerManager.FieldOverflowStateContainer
Container object to hold current field overflow state
|
static class |
RecordBatchSizerManager.VarLenColumnBatchStats
Container object to supply variable columns statistics to the batch sizer
|
Constructor and Description |
---|
RecordBatchSizerManager(OptionManager options,
ParquetSchema schema,
long totalRecordsToRead,
RecordBatchStats.RecordBatchStatsContext batchStatsContext)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
allocate(Map<String,ValueVector> vectorMap)
Allocates value vectors for the current batch.
|
void |
close()
Closes all resources managed by this object
|
RecordBatchStats.RecordBatchStatsContext |
getBatchStatsContext() |
long |
getConfigMemorySizePerBatch() |
int |
getConfigRecordsPerBatch() |
RecordBatchSizerManager.ColumnMemoryQuota |
getCurrentFieldBatchMemory(String field) |
long |
getCurrentMemorySizePerBatch() |
int |
getCurrentRecordsPerBatch() |
RecordBatchSizerManager.FieldOverflowStateContainer |
getFieldOverflowContainer(String field) |
Map<String,RecordBatchSizerManager.FieldOverflowStateContainer> |
getFieldOverflowMap() |
ParquetSchema |
getSchema() |
void |
onEndOfBatch(int batchNumRecords,
List<RecordBatchSizerManager.VarLenColumnBatchStats> batchStats)
Enables this object to optimize the impact of overflows by computing more
accurate VL column precision.
|
boolean |
releaseFieldOverflowContainer(String field)
Releases the overflow data resources associated with this field; also removes the overflow
container from the overflow containers map.
|
void |
setup()
Tunes record batch parameters based on configuration and schema.
|
public RecordBatchSizerManager(OptionManager options, ParquetSchema schema, long totalRecordsToRead, RecordBatchStats.RecordBatchStatsContext batchStatsContext)
options
- drill optionsschema
- current reader schematotalRecordsToRead
- total number of rows to readpublic void setup()
public ParquetSchema getSchema()
public RecordBatchStats.RecordBatchStatsContext getBatchStatsContext()
public void allocate(Map<String,ValueVector> vectorMap) throws OutOfMemoryException
vectorMap
- a collection of value vectors keyed by their field namesOutOfMemoryException
public Map<String,RecordBatchSizerManager.FieldOverflowStateContainer> getFieldOverflowMap()
public RecordBatchSizerManager.FieldOverflowStateContainer getFieldOverflowContainer(String field)
field
- materialized fieldpublic boolean releaseFieldOverflowContainer(String field)
field
- materialized fieldpublic RecordBatchSizerManager.ColumnMemoryQuota getCurrentFieldBatchMemory(String field)
field
- materialized fieldpublic int getCurrentRecordsPerBatch()
public long getCurrentMemorySizePerBatch()
public int getConfigRecordsPerBatch()
public long getConfigMemorySizePerBatch()
public void onEndOfBatch(int batchNumRecords, List<RecordBatchSizerManager.VarLenColumnBatchStats> batchStats)
batchNumRecords
- number of records in this batchbatchStats
- columns statisticspublic void close()
Copyright © 1970 The Apache Software Foundation. All rights reserved.