public static class TestBuildSidePartitioningImpl.MockBatchSizePredictor extends Object implements BatchSizePredictor
BatchSizePredictor.Factory| Constructor and Description |
|---|
MockBatchSizePredictor() |
MockBatchSizePredictor(long batchSize,
int numRecords,
double fragmentationFactor,
double safetyFactor) |
| Modifier and Type | Method and Description |
|---|---|
long |
getBatchSize()
Gets the batchSize computed in the call to
BatchSizePredictor.updateStats(). |
int |
getNumRecords()
Gets the number of records computed in the call to
BatchSizePredictor.updateStats(). |
boolean |
hadDataLastTime()
True if the input batch had records in the last call to
BatchSizePredictor.updateStats(). |
long |
predictBatchSize(int desiredNumRecords,
boolean reserveHash)
Predicts the size of a batch using the current collected stats.
|
void |
updateStats()
This method can be called multiple times to collect stats about the latest data in the provided record batch.
|
public MockBatchSizePredictor()
public MockBatchSizePredictor(long batchSize,
int numRecords,
double fragmentationFactor,
double safetyFactor)
public long getBatchSize()
BatchSizePredictorBatchSizePredictor.updateStats(). Returns 0 if BatchSizePredictor.hadDataLastTime() is false.getBatchSize in interface BatchSizePredictorBatchSizePredictor.updateStats(). Returns 0 if BatchSizePredictor.hadDataLastTime() is false.public int getNumRecords()
BatchSizePredictorBatchSizePredictor.updateStats(). Returns 0 if BatchSizePredictor.hadDataLastTime() is false.getNumRecords in interface BatchSizePredictorBatchSizePredictor.updateStats(). Returns 0 if BatchSizePredictor.hadDataLastTime() is false.public boolean hadDataLastTime()
BatchSizePredictorBatchSizePredictor.updateStats(). False otherwise.hadDataLastTime in interface BatchSizePredictorBatchSizePredictor.updateStats(). False otherwise.public void updateStats()
BatchSizePredictorBatchSizePredictor.predictBatchSize(int, boolean).updateStats in interface BatchSizePredictorpublic long predictBatchSize(int desiredNumRecords,
boolean reserveHash)
BatchSizePredictorpredictBatchSize in interface BatchSizePredictordesiredNumRecords - The number of records contained in the batch whose size we want to predict.reserveHash - Whether or not to include a column containing hash values.Copyright © 2021 The Apache Software Foundation. All rights reserved.