Class OnDiskDatabase

All Implemented Interfaces:
Database
Direct Known Subclasses:
OnDiskQueryDatabase

public abstract class OnDiskDatabase
extends AbstractDatabase
Base class for local database implementations.
  • Field Details

  • Constructor Details

    • OnDiskDatabase

      public OnDiskDatabase​(@Nullable com.fishlib.io.logger.Logger log, @NotNull com.fishlib.configuration.Configuration configuration, @NotNull NamespaceSet newNamespaceSet)
      Create a Database that uses a well-known directory layout to configure itself and store its metadata.
      Parameters:
      log - The log
      configuration - use this Configuration
      newNamespaceSet - Which namespace set (directory) to add new namespaces to (e.g. Systems or Users)
    • OnDiskDatabase

      public OnDiskDatabase​(@Nullable com.fishlib.io.logger.Logger log, @NotNull File rootDirectory, @NotNull com.fishlib.configuration.Configuration configuration, @NotNull NamespaceSet newNamespaceSet)
      Create a Database that uses a well-known directory layout, at the given root, to configure itself and store its metadata.
      Parameters:
      log - The log
      rootDirectory - The root for the well-known layout. If null, a default location is used.
      configuration - use this Configuration to get the filtering properties to pass on
      newNamespaceSet - Which namespace set (directory) to add new namespaces to (e.g. Systems or Users)
    • OnDiskDatabase

      protected OnDiskDatabase​(@Nullable com.fishlib.io.logger.Logger log, @NotNull com.fishlib.configuration.Configuration configuration, @NotNull File rootDirectory, @NotNull NamespaceSet newNamespaceSet, @NotNull SchemaService schemaService)
      Delegate to OnDiskDatabase(Logger, File, SchemaService, NamespaceSet, boolean, boolean), ensuring that log is valid, and determining namespaceAclFilterEnabled and tableNamesAclFilterEnabled from configuration properties.
      Parameters:
      log - The log
      configuration - use this Configuration to get the filtering properties to pass on
      rootDirectory - The root for the well-known layout. If null, a default location is used.
      newNamespaceSet - Which namespace set (directory) to add new namespaces to (e.g. Systems or Users)
      schemaService - initialize with this schema service
    • OnDiskDatabase

      protected OnDiskDatabase​(@NotNull com.fishlib.io.logger.Logger log, @NotNull File rootDirectory, @NotNull SchemaService schemaService, @NotNull NamespaceSet newNamespaceSet, boolean namespaceAclFilterEnabled, boolean tableNamesAclFilterEnabled)
      Create a Database that uses a well-known directory layout, at the given root, to configure itself and store its metadata.
      Parameters:
      log - The log
      rootDirectory - The root for the well-known layout. If null, a default location is used.
      schemaService - initialize with this schema service
      newNamespaceSet - Which namespace set (directory) to add new namespaces to (e.g. Systems or Users)
      namespaceAclFilterEnabled - should getNamespaces() only return namespaces with at least one visible table.
      tableNamesAclFilterEnabled - should getTableNames() only return visible tables
  • Method Details

    • getSchemaService

      public SchemaService getSchemaService()
      Description copied from interface: Database
      Get the SchemaService for retrieving Schemas from which TableDefinitions can be retrieved.
      Returns:
      The SchemaService that this Database was created with.
    • getRootDirectory

      public File getRootDirectory()
    • setAuditEventLogger

      public void setAuditEventLogger​(AuditEventLogFormat2Logger auditEventLogger, OnDiskDatabase.AuditEventLogDetails auditEventLogDetails)
    • getAuditEventLogLogger

      @Nullable public AuditEventLogFormat2Logger getAuditEventLogLogger()
      Get the audit event logger associated with this database.
      Returns:
      the audit event logger, or null if one hasn't been associated with this database
    • setUserContext

      public PermissionFilterProvider setUserContext​(@Nullable com.fishlib.io.logger.Logger log, @Nullable com.fishlib.auth.UserContext userContext)
      Set the user context for this database connection.
      Parameters:
      log - The logger to use for this database connection
      userContext - The user context for this database connection
      Returns:
      The PermissionFilterProvider that retrieves the filters given the user context.
    • setUserContextAndFilterProvider

      public void setUserContextAndFilterProvider​(com.fishlib.auth.UserContext userContext, PermissionFilterProvider permissionFilterProvider)
      Set the user context and permission filter provider for this database connection.
      Parameters:
      userContext - the user context for this database connection
      permissionFilterProvider - the PermissionFilterProvider that retrieves the filters
    • getUserContext

      public com.fishlib.auth.UserContext getUserContext()
      Description copied from interface: Database
      Gets the user authentication context.
      Returns:
      user authentication context
    • getNamespaces

      public List<String> getNamespaces()
      Description copied from interface: Database
      Retrieves all namespace names from the database.
      Returns:
      The list of namespace names
    • getSystemNamespaces

      public List<String> getSystemNamespaces()
      Description copied from interface: Database
      Retrieves system namespace names from the database.
      Returns:
      The list of namespace names
    • getUserNamespaces

      public List<String> getUserNamespaces()
      Description copied from interface: Database
      Retrieves user namespace names from the database.
      Returns:
      The list of namespace names
    • getTableNames

      public List<String> getTableNames​(String namespace)
      Description copied from interface: Database
      Gets all table names from the specified namespace.
      Parameters:
      namespace - The namespace to list the contents of
      Returns:
      The list of table names
    • getTableV2

      public Table getTableV2​(String namespace, String tableName)
      Description copied from interface: Database
      Retrieves a table by namespace and name. Throws exceptions for unknown tables.
      Parameters:
      namespace - namespace of the table
      tableName - name of the table
      Returns:
      table in "v2" format
    • getPermissionFilterProvider

      public PermissionFilterProvider getPermissionFilterProvider()
    • getIntradayTableV2

      public Table getIntradayTableV2​(String namespace, String tableName, boolean live)
      Description copied from interface: Database
      Retrieves an intraday table by namespace and name. Throws exceptions for unknown tables.
      Parameters:
      namespace - namespace of the table
      tableName - name of the table
      live - true if the table should be live/updating; false otherwise
      Returns:
      intraday table
    • getIntradayTableV2

      public Table getIntradayTableV2​(String namespace, String tableName, Set<String> internalPartitionValues, boolean live)
      Description copied from interface: Database
      Retrieves the specified internal partitions of the specified intraday table. The result may contain locations for multiple column partition values, and so a subsequent filter (e.g. on "Date") will often be desired.

      Throws exceptions for unknown tables.

      Parameters:
      namespace - namespace of the table
      tableName - name of the table
      internalPartitionValues - locations will be restricted to these internal partition values
      live - true if the table should be live/updating; false otherwise
      Returns:
      single partition intraday table
    • getIntradayPartitions

      public List<String> getIntradayPartitions​(String namespace, String tableName)
      Description copied from interface: Database
      Get a list of all internal partition values available for the specified intraday table.
      Parameters:
      namespace - The namespace of the table
      tableName - The table name to examine in the intraday data space
      Returns:
      A list of internal partition values for top-level partitioning of the intraday table. Typically represents one partition per source.
    • getIntradayPartitionsAsTable

      public Table getIntradayPartitionsAsTable​(String namespace, String tableName)
      Description copied from interface: Database
      Get all internal partition values available for the specified intraday table, returned as table.
      Parameters:
      namespace - The namespace of the table
      tableName - The table name to examine in the intraday data space
      Returns:
      A table containing the internal partition values for top-level partitioning of the intraday table. Typically represents one partition per source.
    • getTableDefinition

      @Nullable public TableDefinition getTableDefinition​(String namespace, String tableName)
      Description copied from interface: Database
      Retrieves a table definition by namespace and name, generally from the schema service.
      Parameters:
      namespace - The namespace of the definition to retrieve
      tableName - The table name of the definition to retrieve
      Returns:
      The table definition retrieved, null if not found
    • checkAllowAddSchema

      protected void checkAllowAddSchema​(TableDefinitionSchema schema)
    • checkAllowAddNamespace

      protected void checkAllowAddNamespace​(NamespaceSet namespaceSet, String namespace)
    • checkAllowRemoveNamespace

      protected void checkAllowRemoveNamespace​(String namespace)
    • checkAllowAddTable

      protected void checkAllowAddTable​(TableDefinitionSchema schema, Table table)
    • checkAllowAddTableCentral

      protected void checkAllowAddTableCentral​(TableDefinitionSchema schema, Table table)
    • getTableWriter

      public TableWriter getTableWriter​(String namespace, String tableName, TableDefinition tableDefinition, boolean append)
      Description copied from interface: Database
      Gets a table writer for an unpartitioned table.
      Parameters:
      namespace - table namespace
      tableName - table name
      tableDefinition - table definition
      append - true to append to an existing partition; false to overwrite an existing partition.
      Returns:
      table writer
      ImplNote:
      If the schema for this table exists, it must match the given tableDefinition.
      OnDiskQueryDatabase will restrict this to User tables.
    • addTable

      public void addTable​(String namespace, String tableName, Table table, Database.StorageFormat storageFormat)
      Description copied from interface: Database
      Adds a non-partitioned table by name to the specified namespace.
      Parameters:
      namespace - table namespace
      tableName - table name
      table - table to add
      storageFormat - the storage format to use (ex DeephavenV1 or Parquet)
    • appendTable

      public void appendTable​(String namespace, String tableName, Table table)
      Description copied from interface: Database
      Appends to a non-partitioned table, or adds the table if it is not present. Adds a TableDefinition if necessary.
      Parameters:
      namespace - table namespace
      tableName - table name
      table - data to add or append
    • addTableDefinition

      public void addTableDefinition​(String namespace, String tableName, TableDefinition tableDefinition)
      Description copied from interface: Database
      Adds a table definition to the specified namespace. Throws an exception if the table definition already exists.
      Parameters:
      namespace - table namespace
      tableName - table name
      tableDefinition - table definition to add
    • checkAllowRemoveTableDefinition

      protected void checkAllowRemoveTableDefinition​(TableDefinitionSchema schema)
    • checkAllowRemoveTableDefinition

      protected void checkAllowRemoveTableDefinition​(String namespace, String tableName)
    • checkAllowRemoveTable

      protected void checkAllowRemoveTable​(TableDefinitionSchema schema)
    • checkAllowRemoveTableCentral

      protected void checkAllowRemoveTableCentral​(TableDefinitionSchema schema)
    • removeTable

      public void removeTable​(String namespace, String tableName)
      Description copied from interface: Database
      Removes a table. This method is a better choice than Database.deleteTables(String, String...), unless the underlying table no longer has consistent metadata. Throws an exception for tables that don't exist.
      Parameters:
      namespace - table namespace
      tableName - table name
    • repairMetadata

      public void repairMetadata​(String namespace, String tableName, boolean fix)
      Report on (and optionally fix) table location metadata issues for the specified namespace and table name. Specifically, this will validate that locations are non-empty directories (and optionally try to remove them if not), report on location size conflicts implied by the column files, and report on (and optionally repair if possible) missing or incorrect location size metadata.

      Note: This tool skips the usual namespace permission tests - the only requirement is that the process runs with sufficient filesystem permissions.
      Parameters:
      namespace - The namespace to operate on
      tableName - The table name to operate on
      fix - Whether to fix the metadata or simply log issues
    • repairMetadata

      public void repairMetadata​(String namespace, boolean fix)
      Report on (and optionally fix) all table location metadata for the specified namespace. Specifically, this will validate that locations are non-empty directories (and optionally try to remove them if not), report on location size conflicts implied by the column files, and report on (and optionally repair if possible) missing or incorrect location size metadata.

      Note: This tool skips the usual namespace permission tests - the only requirement is that the process runs with sufficient filesystem permissions.
      Parameters:
      namespace - The namespace to operate on
      fix - Whether to fix the metadata or simply log issues
    • repairMetadata

      public void repairMetadata​(NamespaceSet namespaceSet, boolean fix)
      Report on (and optionally fix) all table location metadata for the specified set of namespaces. Specifically, this will validate that locations are non-empty directories (and optionally try to remove them if not), report on location size conflicts implied by the column files, and report on (and optionally repair if possible) missing or incorrect location size metadata.

      Note: This tool skips the usual namespace permission tests - the only requirement is that the process runs with sufficient filesystem permissions.
      Parameters:
      namespaceSet - The namespace set to operate on
      fix - Whether to fix the metadata or simply log issues
    • deleteTables

      public void deleteTables​(String namespace, String... tableNames)
      Description copied from interface: Database
      Delete all files related to a set of tables. Database.removeTable(String, String) is a better option, unless the underlying table is damaged.
      Parameters:
      namespace - table namespace
      tableNames - table names to delete
    • deleteMatchingTables

      public void deleteMatchingTables​(String namespace, String tableNameRegex)
      Description copied from interface: Database
      Delete all files related to the set of tables whose names match the supplied regular expression.

      Note: This only works for tables that still have a definition file, although it need not be readable.

      Note: This is a dangerous API - don't use it if you don't fully understand the implications.

      Parameters:
      namespace - table namespace
      tableNameRegex - table names in the given namespace that match this regular expression will be cleaned up.
    • deleteNamespace

      public void deleteNamespace​(String namespace)
      Description copied from interface: Database
      Delete all files related to the specified namespace.

      Note: This is a dangerous API - don't use it if you don't fully understand the implications.

      Parameters:
      namespace - namespace to be deleted.
    • checkAllowCleanupNamespace

      protected void checkAllowCleanupNamespace​(String namespace)
    • removeTableDefinition

      @Deprecated public void removeTableDefinition​(String namespace, String tableName)
      Deprecated.
      Description copied from interface: Database
      Removes a table definition.
      Parameters:
      namespace - table namespace
      tableName - table name
    • checkAllowReplaceTableDefinition

      protected void checkAllowReplaceTableDefinition​(TableDefinitionSchema schema)
    • checkAllowReplaceTable

      protected void checkAllowReplaceTable​(TableDefinitionSchema schema, Table newTable)
    • checkAllowIntradayOperation

      protected void checkAllowIntradayOperation​(TableDefinitionSchema schema)
    • verifyNamespace

      protected abstract void verifyNamespace​(String namespace, @Nullable String tableName)
      Ensure the namespace exists.
      Parameters:
      namespace - name of the namespace to check
      tableName - optional table name for logging context
    • replaceTable

      public void replaceTable​(String namespace, String tableName, Table table, Database.StorageFormat storageFormat)
      Description copied from interface: Database
      Replaces a non-partitioned table with a new table, or adds the table, if it is not already present. Not guaranteed to be atomic in the case of failures.
      Parameters:
      namespace - table namespace
      tableName - table name
      table - data for the replacement table
      storageFormat - the storage format to use (ex DeephavenV1 or Parquet)
    • replaceTableDefinition

      public void replaceTableDefinition​(String namespace, String tableName, TableDefinition tableDefinition)
      Description copied from interface: Database
      Replaces a user table definition.

      Not guaranteed to be atomic in the case of failures.

      Does not throw an exception for tables that don't exist.

      Parameters:
      namespace - table namespace
      tableName - table name
      tableDefinition - table definition for the replacement
    • checkAllowAddColumnPartition

      protected void checkAllowAddColumnPartition​(TableDefinitionSchema schema, Table newTable)
    • checkAllowDeleteColumnPartition

      protected void checkAllowDeleteColumnPartition​(TableDefinitionSchema schema)
    • checkAllowReplaceColumnPartition

      protected void checkAllowReplaceColumnPartition​(TableDefinitionSchema schema, Table newTable)
    • logPartitionTableSnapshot

      public Database.LogHandle logPartitionTableSnapshot​(String namespace, String tableName, String partitioningColumnName, String columnPartitionValue, Table table, long logIntervalMillis, boolean append)
      Description copied from interface: Database
      Snapshots a table at a regular interval and writes the snapshot to a centrally managed table.
      Parameters:
      namespace - table namespace
      tableName - table name
      partitioningColumnName - name of the partitioning column
      columnPartitionValue - column partition value (e.g. "2015-09-25" for a Date partitioning column).
      table - table to snapshot and log (does not contain the partition column)
      logIntervalMillis - interval in milliseconds to log snapshots at
      append - true to append to an existing partition; false to replace the existing partition.
      Returns:
      log handle
    • logPartitionTableSnapshot

      public Database.LogHandle logPartitionTableSnapshot​(String namespace, String tableName, String partitioningColumnName, String columnPartitionValue, Table table, long logIntervalMillis, ReplayerInterface replayer, boolean append)
      Description copied from interface: Database
      Snapshots a table at a regular interval and writes the snapshot to a centrally managed table.
      Parameters:
      namespace - table namespace
      tableName - table name
      partitioningColumnName - name of the partitioning column
      columnPartitionValue - column partition value (e.g. "2015-09-25" for a Date partitioning column).
      table - table to snapshot and log (does not contain the partition column)
      logIntervalMillis - interval in milliseconds to log snapshots at
      replayer - data replayer
      append - true to append to an existing partition; false to replace the existing partition.
      Returns:
      log handle
    • logPartitionTableIncremental

      public Database.LogHandle logPartitionTableIncremental​(String namespace, String tableName, String partitioningColumnName, String columnPartitionValue, Table table, boolean append)
      Description copied from interface: Database
      Writes all changes in a table to a centrally managed table.
      Parameters:
      namespace - table namespace
      tableName - table name
      partitioningColumnName - name of the partitioning column
      columnPartitionValue - column partition value (e.g. "2015-09-25" for a Date partitioning column).
      table - table to log (does not contain the partition column)
      append - true to append to an existing partition; false to replace the existing partition.
      Returns:
      log handle
    • logPartitionTableIncremental

      public Database.LogHandle logPartitionTableIncremental​(String namespace, String tableName, String partitioningColumnName, String columnPartitionValue, Table table, ReplayerInterface replayer, boolean append)
      Description copied from interface: Database
      Writes all changes in a table to a centrally managed table.
      Parameters:
      namespace - table namespace
      tableName - table name
      partitioningColumnName - name of the partitioning column
      columnPartitionValue - column partition value (e.g. "2015-09-25" for a Date partitioning column).
      table - table to log (does not contain the partition column)
      replayer - data replayer
      append - true to append to an existing partition; false to replace the existing partition.
      Returns:
      log handle
    • getColumnPartitionTableWriter

      public TableWriter getColumnPartitionTableWriter​(String namespace, String tableName, String partitioningColumnName, String columnPartitionValue, TableDefinition prototypeTableDefinition, boolean append)
      Description copied from interface: Database
      Gets a table writer for a partitioned table.
      Parameters:
      namespace - table namespace
      tableName - table name
      partitioningColumnName - name of the partitioning column
      columnPartitionValue - column partition value (e.g. "2015-09-25" for a Date partitioning column).
      prototypeTableDefinition - table definition
      append - true to append to an existing partition; false to overwrite an existing partition.
      Returns:
      table writer
    • addTablePartition

      public void addTablePartition​(String namespace, String tableName, String internalPartitionValue, String columnPartitionValue, Table data, Database.StorageFormat storageFormat)
      Description copied from interface: Database
      Adds a single table partition (e.g. one date) to a partitioned table.

      Requires that a suitable TableDefinition has already been added.

      Throws an exception if the partition already exists.

      Parameters:
      namespace - table namespace
      tableName - table name
      internalPartitionValue - internal (not user-visible) partition value.
      columnPartitionValue - column partition value (e.g. "2015-09-25" for a Date partitioning column).
      data - data for this partition. Must *not* contain the partitioning column.
      storageFormat - the format used for storage
    • appendTablePartition

      public void appendTablePartition​(String namespace, String tableName, String internalPartitionValue, String columnPartitionValue, Table data)
      Description copied from interface: Database
      Adds or appends to a single table location (e.g. one date) to a partitioned table.

      Requires that a suitable TableDefinition has already been added.

      Parameters:
      namespace - table namespace
      tableName - table name
      internalPartitionValue - internal (not user-visible) partition value.
      columnPartitionValue - column partition value (e.g. "2015-09-25" for a Date partitioning column).
      data - data to append to this partition. Must *not* contain the partitioning column.
    • removeTablePartition

      public void removeTablePartition​(String namespace, String tableName, String internalPartitionValue, String columnPartitionValue)
      Description copied from interface: Database
      Removes a single table location (e.g. one date) from a partitioned table. Requires that a suitable TableDefinition still exists.
      Parameters:
      namespace - table namespace
      tableName - table name
      internalPartitionValue - internal (not user-visible) partition value.
      columnPartitionValue - column partition value (e.g. "2015-09-25" for a Date partitioning column).
    • replaceTablePartition

      public void replaceTablePartition​(String namespace, String tableName, String internalPartitionValue, String columnPartitionValue, Table data, Database.StorageFormat storageFormat)
      Description copied from interface: Database
      Replaces a single table location (e.g. one date) from/to a partitioned table.

      Requires that a suitable TableDefinition has already been added.

      Not guaranteed to be atomic in the case of failures.

      Parameters:
      namespace - table namespace
      tableName - table name
      internalPartitionValue - internal (not user-visible) partition value.
      columnPartitionValue - column partition value (e.g. "2015-09-25" for a Date partitioning column).
      data - data to replace this partition. Must *not* contain the partitioning column.
      storageFormat - the storage format to use (ex DeephavenV1 or Parquet)
    • storeTable

      protected abstract void storeTable​(TableDefinitionSchema schema, Table table, Database.StorageFormat storageFormat)
    • appendTable

      protected abstract void appendTable​(TableDefinitionSchema schema, Table table)
    • deleteTable

      protected abstract void deleteTable​(TableDefinitionSchema schema)
    • restoreTable

      protected abstract Table restoreTable​(TableDefinitionSchema schema, boolean isLive)
    • storeShadowTable

      protected abstract void storeShadowTable​(TableDefinitionSchema schema, Table table, Database.StorageFormat storageFormat)
    • moveTableToBackup

      protected abstract void moveTableToBackup​(TableDefinitionSchema schema)
    • installShadowTable

      protected abstract void installShadowTable​(TableDefinitionSchema schema)
    • rollbackTable

      protected abstract void rollbackTable​(TableDefinitionSchema schema)
    • deleteBackupTable

      protected abstract void deleteBackupTable​(TableDefinitionSchema schema)
    • storeColumnPartition

      protected abstract void storeColumnPartition​(TableDefinitionSchema schema, String internalPartitionValue, String columnPartitionValue, Table data, Database.StorageFormat storageFormat)
    • appendColumnPartition

      protected abstract void appendColumnPartition​(TableDefinitionSchema schema, String internalPartitionValue, String columnPartitionValue, Table data)
    • deleteColumnPartition

      protected abstract void deleteColumnPartition​(TableDefinitionSchema schema, String internalPartitionValue, String columnPartitionValue)
    • overwriteColumnPartition

      protected abstract void overwriteColumnPartition​(TableDefinitionSchema schema, String internalPartitionValue, String columnPartitionValue, Table data, Database.StorageFormat storageFormat)
    • getIntradayPartitions

      protected abstract List<String> getIntradayPartitions​(TableDefinitionSchema schema)
    • getIntradayTableV2

      protected abstract Table getIntradayTableV2​(TableDefinitionSchema schema, boolean live)
    • getIntradayTableV2

      protected Table getIntradayTableV2​(TableDefinitionSchema schema, String partitionName, boolean live)
    • getIntradayTableV2

      protected abstract Table getIntradayTableV2​(TableDefinitionSchema schema, Set<String> partitionNames, boolean live)
    • getTableDefinitionsTable

      public Table getTableDefinitionsTable()
    • getColumnDefinitionsTable

      public Table getColumnDefinitionsTable()
    • appendCentral

      public void appendCentral​(String namespace, String tableName, String columnPartitionValue, Table table, boolean flush)
      Description copied from interface: Database
      Append to a table via a centralized table appender.

      Note: The table data is appended to a system-defined internal partition, and the specified column partition value.

      Parameters:
      namespace - table namespace
      tableName - table name
      columnPartitionValue - column partition value (e.g. "2015-09-25" for a Date partitioning column).
      table - new data
      flush - true to flush the table to disk; false to wait for flushing (if the implementation supports waiting)
    • hasNamespace

      public boolean hasNamespace​(String namespace)
      Description copied from interface: Database
      Determines if the namespace is present in the DB.
      Parameters:
      namespace - namespace
      Returns:
      true if the namespace exists; false otherwise.
    • getCatalog

      public Table getCatalog()
      Description copied from interface: Database
      Gets a table containing information on all tables in the DB.
      Returns:
      table containing information on all tables in the DB
    • hasTable

      public boolean hasTable​(String namespace, String tableName)
      Description copied from interface: Database
      Determines if the table is defined in the DB.
      Parameters:
      namespace - namespace
      tableName - table name
      Returns:
      true if the table definition exists; false otherwise.
    • hasIntradayTable

      public boolean hasIntradayTable​(String namespace, String tableName)
      Description copied from interface: Database
      Determines if the table is present in the DB and currently has intraday data.
      Parameters:
      namespace - namespace
      tableName - table name
      Returns:
      true if the table exists and has intraday data; false otherwise.
    • hasImportedData

      public boolean hasImportedData​(String namespace, String tableName, String columnPartitionValue)
      Description copied from interface: Database
      Determines if the historical table's column partition is present in the DB.
      Parameters:
      namespace - namespace
      tableName - table name
      columnPartitionValue - column partition value (e.g. "2015-09-25" for a Date partitioning column).
      Returns:
      true if the table's column partition exists; false otherwise.
    • hasIntradayData

      public boolean hasIntradayData​(String namespace, String tableName, String columnPartitionValue)
      Description copied from interface: Database
      Determines if the intraday table's column partition is present in the DB.
      Parameters:
      namespace - namespace
      tableName - table name
      columnPartitionValue - column partition value (e.g. "2015-09-25" for a Date partitioning column).
      Returns:
      true if the intraday table's column partition exists; false otherwise.
    • hasData

      protected abstract boolean hasData​(NamespaceSet set, TableDefinition tDef, @Nullable String columnPartitionValue, boolean intraday)
      Parameters:
      tDef - the definition of the table
      columnPartitionValue - partitioning column value to check. Null indicates "any" value.
      intraday - if false, only historical partitions are checked.
      Returns:
      True if the specified table location has data.