public abstract class Statistics<T extends Serializable> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
isEmpty
isEmpty being false means this statistic has been initialized and the max and min is not null;
|
| Constructor and Description |
|---|
Statistics() |
| Modifier and Type | Method and Description |
|---|---|
abstract long |
calculateRamSize() |
abstract void |
deserialize(ByteBuffer byteBuffer) |
static Statistics<? extends Serializable> |
deserialize(ByteBuffer buffer,
TSDataType dataType) |
abstract void |
deserialize(InputStream inputStream)
read data from the inputStream.
|
static Statistics<? extends Serializable> |
deserialize(InputStream inputStream,
TSDataType dataType) |
boolean |
equals(Object o) |
long |
getCount() |
long |
getEndTime() |
abstract T |
getFirstValue() |
abstract T |
getLastValue() |
abstract T |
getMaxValue() |
abstract T |
getMinValue() |
int |
getSerializedSize() |
static int |
getSizeByType(TSDataType type) |
long |
getStartTime() |
static Statistics<? extends Serializable> |
getStatsByType(TSDataType type)
static method providing statistic instance for respective data type.
|
abstract int |
getStatsSize() |
abstract double |
getSumDoubleValue() |
abstract long |
getSumLongValue() |
abstract TSDataType |
getType() |
int |
hashCode() |
boolean |
isEmpty() |
void |
mergeStatistics(Statistics<? extends Serializable> stats)
merge parameter to this statistic
|
protected abstract void |
mergeStatisticsValue(Statistics<T> stats) |
int |
serialize(OutputStream outputStream) |
void |
setCount(int count) |
void |
setEmpty(boolean empty) |
void |
setEndTime(long endTime) |
void |
setStartTime(long startTime) |
String |
toString() |
void |
update(long time) |
void |
update(long[] time,
Binary[] values,
int batchSize) |
void |
update(long[] time,
boolean[] values,
int batchSize) |
void |
update(long[] time,
double[] values,
int batchSize) |
void |
update(long[] time,
float[] values,
int batchSize) |
void |
update(long[] time,
int batchSize) |
void |
update(long[] time,
int[] values,
int batchSize) |
void |
update(long[] time,
long[] values,
int batchSize) |
void |
update(long time,
Binary value) |
void |
update(long time,
boolean value) |
void |
update(long time,
double value) |
void |
update(long time,
float value) |
void |
update(long time,
int value) |
void |
update(long time,
long value) |
void |
updateStats(long min,
long max)
This method with two parameters is only used by
unsequence which
updates/inserts/deletes timestamp. |
protected boolean isEmpty
public static Statistics<? extends Serializable> getStatsByType(TSDataType type)
type - - data typepublic static int getSizeByType(TSDataType type)
public abstract TSDataType getType()
public int getSerializedSize()
public abstract int getStatsSize()
public int serialize(OutputStream outputStream) throws IOException
IOExceptionpublic abstract void deserialize(InputStream inputStream) throws IOException
IOExceptionpublic abstract void deserialize(ByteBuffer byteBuffer)
public abstract T getMinValue()
public abstract T getMaxValue()
public abstract T getFirstValue()
public abstract T getLastValue()
public abstract double getSumDoubleValue()
public abstract long getSumLongValue()
public void mergeStatistics(Statistics<? extends Serializable> stats)
StatisticsClassException - cannot merge statisticspublic void update(long time,
boolean value)
public void update(long time,
int value)
public void update(long time,
long value)
public void update(long time,
float value)
public void update(long time,
double value)
public void update(long time,
Binary value)
public void update(long time)
public void update(long[] time,
boolean[] values,
int batchSize)
public void update(long[] time,
int[] values,
int batchSize)
public void update(long[] time,
long[] values,
int batchSize)
public void update(long[] time,
float[] values,
int batchSize)
public void update(long[] time,
double[] values,
int batchSize)
public void update(long[] time,
Binary[] values,
int batchSize)
public void update(long[] time,
int batchSize)
protected abstract void mergeStatisticsValue(Statistics<T> stats)
public boolean isEmpty()
public void setEmpty(boolean empty)
public void updateStats(long min,
long max)
unsequence which
updates/inserts/deletes timestamp.min - min timestampmax - max timestamppublic static Statistics<? extends Serializable> deserialize(InputStream inputStream, TSDataType dataType) throws IOException
IOExceptionpublic static Statistics<? extends Serializable> deserialize(ByteBuffer buffer, TSDataType dataType)
public long getStartTime()
public long getEndTime()
public long getCount()
public void setStartTime(long startTime)
public void setEndTime(long endTime)
public void setCount(int count)
public abstract long calculateRamSize()
Copyright © 2022 The Apache Software Foundation. All rights reserved.