Class LocationsTableUtil
java.lang.Object
io.deephaven.enterprise.locations.locationstable.LocationsTableUtil
Provides utilities to assist in the creation and writing of a `LocationsTable`, which can be used to identify valid
EnterpriseTableLocationKeys-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe column name containing the integer version of column files for Deephaven format.static final StringThe column of file names, relative to the root of this table.static final StringThe column name containing the format as a String value ofTableLocation.Format(either "DEEPHAVEN" or "PARQUET").static final StringThe column name containing the epoch timestamp of the time the partition was last modified.static final StringThe column name sizes of each row group in parquet format.static final StringThe column of partition sizes, in rows. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TableDefinitiondefinitionWithPartitions(@NotNull Collection<ColumnDefinition<?>> partitioningCols) Create aTableDefinitionwhich includes allColumnDefinitions for a new `LocationsTable`static voidensureValidLocationsDefinition(@NotNull TableDefinition locationsTableDef) Ensures that all required columns of the appropriate type for a `LocationsTable` are included in the definition.static voidensureValidLocationsDefinition(@NotNull TableDefinition locationsTableDef, @NotNull Collection<ColumnDefinition<?>> partitioningCols) Ensures that all required columns of the appropriate type for a `LocationsTable` are included in the definition.static TablegenerateLocationsTable(@NotNull PollingTableLocationProvider<EnterpriseTableKey, ? extends EnterpriseTableLocationKey> pollingProvider, @NotNull List<ColumnDefinition<?>> columnPartitionKeys, @NotNull Path tableRoot) Produce an in-memory table containing the files and relevant metadata for a given directory.static voidwriteLocationsTable(@NotNull Table locationsTable, @NotNull Path locationsDir) Write the given locations table to disk at the defined path
-
Field Details
-
FILENAME_COLUMN_NAME
The column of file names, relative to the root of this table.- See Also:
-
SIZE_COLUMN_NAME
The column of partition sizes, in rows.- See Also:
-
FORMAT_COLUMN_NAME
The column name containing the format as a String value ofTableLocation.Format(either "DEEPHAVEN" or "PARQUET").- See Also:
-
LAST_MODIFIED_NANOS_COLUMN_NAME
The column name containing the epoch timestamp of the time the partition was last modified.- See Also:
-
COLUMN_VERSION_COLUMN_NAME
The column name containing the integer version of column files for Deephaven format.- See Also:
-
ROW_GROUP_SIZES_COLUMN_NAME
The column name sizes of each row group in parquet format.- See Also:
-
-
Constructor Details
-
LocationsTableUtil
public LocationsTableUtil()
-
-
Method Details
-
ensureValidLocationsDefinition
public static void ensureValidLocationsDefinition(@NotNull @NotNull TableDefinition locationsTableDef, @NotNull @NotNull Collection<ColumnDefinition<?>> partitioningCols) Ensures that all required columns of the appropriate type for a `LocationsTable` are included in the definition.- Parameters:
locationsTableDef- theTableDefinitionto checkpartitioningCols- the partitioning Column
-
ensureValidLocationsDefinition
public static void ensureValidLocationsDefinition(@NotNull @NotNull TableDefinition locationsTableDef) Ensures that all required columns of the appropriate type for a `LocationsTable` are included in the definition. Does not verify existence of partitioning columns or the existence of extra columns- Parameters:
locationsTableDef- theTableDefinitionto check
-
definitionWithPartitions
public static TableDefinition definitionWithPartitions(@NotNull @NotNull Collection<ColumnDefinition<?>> partitioningCols) Create aTableDefinitionwhich includes allColumnDefinitions for a new `LocationsTable`- Parameters:
partitioningCols- partitioning columns to define within theTableDefinition- Returns:
- a
TableDefinitionwhich includes all columns for a `LocationsTable`
-
writeLocationsTable
public static void writeLocationsTable(@NotNull @NotNull Table locationsTable, @NotNull @NotNull Path locationsDir) throws IOException Write the given locations table to disk at the defined path- Parameters:
locationsTable- theTableto write to disklocationsDir- the on-disk target for writing theTable- Throws:
IOException- if an error occurs while writing the locations table
-
generateLocationsTable
public static Table generateLocationsTable(@NotNull @NotNull PollingTableLocationProvider<EnterpriseTableKey, ? extends EnterpriseTableLocationKey> pollingProvider, @NotNull @NotNull List<ColumnDefinition<?>> columnPartitionKeys, @NotNull @NotNull Path tableRoot) Produce an in-memory table containing the files and relevant metadata for a given directory.- Parameters:
pollingProvider- provides all locations for the desired locations tablecolumnPartitionKeys- the partitioning colum(s)tableRoot- the directory to scan- Returns:
- an in-memory table suitable for use by
writeLocationsTable(Table, Path)
-