public class RecordBatchSizer extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
RecordBatchSizer.ColumnSize
Column size information.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_VECTOR_SIZE |
int |
maxSize
Maximum width of a column; used for memory estimation in case of Varchars
|
int |
nullableCount
Count the nullable columns; used for memory estimation
|
| Constructor and Description |
|---|
RecordBatchSizer(RecordBatch batch) |
RecordBatchSizer(VectorAccessible va)
Create empirical metadata for a record batch given a vector accessible
(basically, an iterator over the vectors in the batch.)
|
RecordBatchSizer(VectorAccessible va,
SelectionVector2 sv2)
Create empirical metadata for a record batch given a vector accessible
(basically, an iterator over the vectors in the batch) along with a
selection vector for those records.
|
| Modifier and Type | Method and Description |
|---|---|
long |
actualSize() |
void |
applySv2() |
int |
avgDensity() |
VectorInitializer |
buildVectorInitializer()
The column size information gathered here represents empirically-derived
schema metadata.
|
List<RecordBatchSizer.ColumnSize> |
columns() |
int |
grossRowWidth() |
boolean |
hasSv2() |
int |
maxAvgColumnSize() |
int |
netRowWidth() |
int |
netRowWidthCap50()
Compute the "real" width of the row, taking into account each varchar column size
(historically capped at 50, and rounded up to power of 2 to match drill buf allocation)
and null marking columns.
|
long |
netSize() |
int |
rowCount() |
static int |
safeDivide(long num,
long denom) |
int |
stdRowWidth() |
String |
toString() |
public static final int MAX_VECTOR_SIZE
public int maxSize
public int nullableCount
public RecordBatchSizer(RecordBatch batch)
public RecordBatchSizer(VectorAccessible va)
va - iterator over the batch's vectorspublic RecordBatchSizer(VectorAccessible va, SelectionVector2 sv2)
va - iterator over the batch's vectorssv2 - selection vector associated with this batchpublic void applySv2()
public static int safeDivide(long num,
long denom)
public int rowCount()
public int stdRowWidth()
public int grossRowWidth()
public int netRowWidth()
public List<RecordBatchSizer.ColumnSize> columns()
public int netRowWidthCap50()
public long actualSize()
public boolean hasSv2()
public int avgDensity()
public long netSize()
public int maxAvgColumnSize()
public VectorInitializer buildVectorInitializer()
Copyright © 2017 The Apache Software Foundation. All rights reserved.