Package edu.caltech.nanodb.storage
Class StatsWriter
- java.lang.Object
-
- edu.caltech.nanodb.storage.StatsWriter
-
public class StatsWriter extends java.lang.Object
This class encapsulates the operations of reading and writing table-statistics to a data file.
-
-
Field Summary
Fields Modifier and Type Field Description private static int
COLSTAT_NULLMASK_MAX_VALUE
A bit-mask used for storing column-stats, to record whether or not the "maximum value" value is present for the column.private static int
COLSTAT_NULLMASK_MIN_VALUE
A bit-mask used for storing column-stats, to record whether or not the "minimum value" value is present for the column.private static int
COLSTAT_NULLMASK_NUM_DISTINCT_VALUES
A bit-mask used for storing column-stats, to record whether or not the "number of distinct values" value is present for the column.private static int
COLSTAT_NULLMASK_NUM_NULL_VALUES
A bit-mask used for storing column-stats, to record whether or not the "number of NULL values" value is present for the column.private static org.apache.logging.log4j.Logger
logger
A logging object for reporting anything interesting that happens.
-
Constructor Summary
Constructors Modifier Constructor Description private
StatsWriter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TableStats
readTableStats(PageReader pgReader, Schema schema)
Reads the table-statistics from the specified data file.static void
writeTableStats(Schema schema, TableStats stats, PageWriter pgWriter)
Writes the specified table-statistics to a data file.
-
-
-
Field Detail
-
logger
private static org.apache.logging.log4j.Logger logger
A logging object for reporting anything interesting that happens.
-
COLSTAT_NULLMASK_NUM_DISTINCT_VALUES
private static final int COLSTAT_NULLMASK_NUM_DISTINCT_VALUES
A bit-mask used for storing column-stats, to record whether or not the "number of distinct values" value is present for the column.- See Also:
- Constant Field Values
-
COLSTAT_NULLMASK_NUM_NULL_VALUES
private static final int COLSTAT_NULLMASK_NUM_NULL_VALUES
A bit-mask used for storing column-stats, to record whether or not the "number of NULL values" value is present for the column.- See Also:
- Constant Field Values
-
COLSTAT_NULLMASK_MIN_VALUE
private static final int COLSTAT_NULLMASK_MIN_VALUE
A bit-mask used for storing column-stats, to record whether or not the "minimum value" value is present for the column.- See Also:
- Constant Field Values
-
COLSTAT_NULLMASK_MAX_VALUE
private static final int COLSTAT_NULLMASK_MAX_VALUE
A bit-mask used for storing column-stats, to record whether or not the "maximum value" value is present for the column.- See Also:
- Constant Field Values
-
-
Method Detail
-
writeTableStats
public static void writeTableStats(Schema schema, TableStats stats, PageWriter pgWriter)
Writes the specified table-statistics to a data file.- Parameters:
schema
- the schema of the tablestats
- the statistics to save for the tablepgWriter
- a page-writer specifying where the data should be written to
-
readTableStats
public static TableStats readTableStats(PageReader pgReader, Schema schema)
Reads the table-statistics from the specified data file.- Parameters:
pgReader
- a page-reader specifying where the data should be read fromschema
- the schema of the table- Returns:
- the table statistics loaded from the file
-
-