public abstract class Statistics<T extends Comparable<T>> extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Statistics.Builder
Builder class to build Statistics objects.
|
| Constructor and Description |
|---|
Statistics() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other)
Equality comparison method to compare two statistics objects.
|
abstract T |
genericGetMax() |
abstract T |
genericGetMin() |
static Statistics.Builder |
getBuilderForReading(PrimitiveType.PrimitiveTypeName type)
Returns a builder to create new statistics object.
|
abstract byte[] |
getMaxBytes()
Abstract method to return the max value as a byte array
|
abstract byte[] |
getMinBytes()
Abstract method to return the min value as a byte array
|
long |
getNumNulls()
Returns the null count
|
static Statistics |
getStatsBasedOnType(PrimitiveType.PrimitiveTypeName type)
Returns the typed statistics object based on the passed type parameter
|
int |
hashCode()
Hash code for the statistics object
|
boolean |
hasNonNullValue()
Returns whether there have been non-null values added to this statistics
|
void |
incrementNumNulls()
Increments the null count by one
|
void |
incrementNumNulls(long increment)
Increments the null count by the parameter value
|
boolean |
isEmpty()
Returns a boolean specifying if the Statistics object is empty,
i.e does not contain valid statistics for the page/column yet
|
boolean |
isNumNullsSet() |
abstract boolean |
isSmallerThan(long size)
Abstract method to return whether the min and max values fit in the given
size.
|
protected void |
markAsNotEmpty()
Sets the page/column as having a valid non-null value
kind of misnomer here
|
void |
mergeStatistics(Statistics stats)
Method to merge this statistics object with the object passed
as parameter.
|
protected abstract void |
mergeStatisticsMinMax(Statistics stats)
Abstract method to merge this statistics min and max with the values
of the parameter object.
|
abstract void |
setMinMaxFromBytes(byte[] minBytes,
byte[] maxBytes)
Deprecated.
will be removed in 2.0.0. Use
#getBuilderForReading(PrimitiveType) instead. |
void |
setNumNulls(long nulls)
Deprecated.
will be removed in 2.0.0. Use
#getBuilderForReading(PrimitiveType) instead. |
abstract String |
toString()
toString() to display min, max, num_nulls in a string
|
void |
updateStats(Binary value)
updates statistics min and max using the passed value
|
void |
updateStats(boolean value)
updates statistics min and max using the passed value
|
void |
updateStats(double value)
updates statistics min and max using the passed value
|
void |
updateStats(float value)
updates statistics min and max using the passed value
|
void |
updateStats(int value)
updates statistics min and max using the passed value
|
void |
updateStats(long value)
updates statistics min and max using the passed value
|
public static Statistics getStatsBasedOnType(PrimitiveType.PrimitiveTypeName type)
type - PrimitiveTypeName type of the columnpublic static Statistics.Builder getBuilderForReading(PrimitiveType.PrimitiveTypeName type)
type - type of the columnpublic void updateStats(int value)
value - value to use to update min and maxpublic void updateStats(long value)
value - value to use to update min and maxpublic void updateStats(float value)
value - value to use to update min and maxpublic void updateStats(double value)
value - value to use to update min and maxpublic void updateStats(boolean value)
value - value to use to update min and maxpublic void updateStats(Binary value)
value - value to use to update min and maxpublic boolean equals(Object other)
public int hashCode()
public void mergeStatistics(Statistics stats)
stats - Statistics object to merge withprotected abstract void mergeStatisticsMinMax(Statistics stats)
stats - Statistics object to merge with@Deprecated public abstract void setMinMaxFromBytes(byte[] minBytes, byte[] maxBytes)
#getBuilderForReading(PrimitiveType) instead.minBytes - byte array to set the min value tomaxBytes - byte array to set the max value topublic abstract T genericGetMin()
public abstract T genericGetMax()
public abstract byte[] getMaxBytes()
public abstract byte[] getMinBytes()
public abstract boolean isSmallerThan(long size)
size - a size in bytespublic abstract String toString()
public void incrementNumNulls()
public void incrementNumNulls(long increment)
increment - value to increment the null count bypublic long getNumNulls()
-1 if the null count is not set@Deprecated public void setNumNulls(long nulls)
#getBuilderForReading(PrimitiveType) instead.nulls - null count to set the count topublic boolean isEmpty()
public boolean hasNonNullValue()
public boolean isNumNullsSet()
protected void markAsNotEmpty()
Copyright © 2018 The Apache Software Foundation. All rights reserved.