Class DeephavenSchema

java.lang.Object
io.deephaven.enterprise.schema.Schema.AbstractSchema
io.deephaven.enterprise.schema.impl.DeephavenSchema
All Implemented Interfaces:
SchemaInternal, Schema

@InternalUseOnly public final class DeephavenSchema extends Schema.AbstractSchema implements SchemaInternal
This implementation of SchemaInternal delegates to a Legacy Schema instance
  • Method Details

    • of

      public static DeephavenSchema of(@NotNull io.deephaven.shadow.enterprise.com.illumon.iris.db.schema.Schema legacySchema)
      Construct a DeephavenSchema instance which delegates to a Legacy instance
      Parameters:
      legacySchema - a Legacy Schema instance to which we will delegate most work
      Returns:
      a new DeephavenSchema instance
    • getLegacySchema

      @NotNull @InternalUseOnly public io.deephaven.shadow.enterprise.com.illumon.iris.db.schema.Schema getLegacySchema()
      Description copied from interface: SchemaInternal
      Provides direct access to the underlying Legacy Schema instance. For internal use only.
      Specified by:
      getLegacySchema in interface SchemaInternal
      Returns:
      the underlying Legacy Schema instance
    • getNamespace

      @NotNull public @NotNull String getNamespace()
      Description copied from interface: Schema
      Gets the namespace of the table
      Specified by:
      getNamespace in interface Schema
      Returns:
      The namespace of the table
    • getTableName

      @NotNull public @NotNull String getTableName()
      Description copied from interface: Schema
      Gets the name of the table
      Specified by:
      getTableName in interface Schema
      Returns:
      The name of the table
    • getNamespaceSet

      @NotNull public @NotNull NamespaceSet getNamespaceSet()
      Description copied from interface: Schema
      Gets the NamespaceSet to which this schema belongs
      Specified by:
      getNamespaceSet in interface Schema
      Returns:
      The NamespaceSet to which this schema belongs
    • getLegacyTableDefinition

      @NotNull @InternalUseOnly public io.deephaven.shadow.enterprise.com.illumon.iris.db.tables.TableDefinition getLegacyTableDefinition()
      Description copied from interface: SchemaInternal
      Provides direct access to the underlying Legacy TableDefinition instance. For internal use only.
      Specified by:
      getLegacyTableDefinition in interface SchemaInternal
      Returns:
      the underlying Legacy TableDefinition instance
    • getTableDefinition

      @NotNull public @NotNull TableDefinition getTableDefinition()
      Description copied from interface: Schema
      Gets the TableDefinition corresponding to this Schema
      Specified by:
      getTableDefinition in interface Schema
      Returns:
      The TableDefinition corresponding to this Schema
    • getVersion

      @NotNull public @NotNull SchemaVersion getVersion()
      Description copied from interface: Schema
      Gets the version information of this schema
      Specified by:
      getVersion in interface Schema
      Returns:
      The version of this schema
    • getColumnDescriptions

      @NotNull public @NotNull Map<String,String> getColumnDescriptions()
      Description copied from interface: Schema
      Get an unmodifiable map of column names to column descriptions. Columns which do not have a description defined may not be represented in the map.
      Specified by:
      getColumnDescriptions in interface Schema
      Returns:
      A map of column names to column descriptions
    • getTableDescription

      @NotNull public @NotNull String getTableDescription()
      Description copied from interface: Schema
      Gets the table description from the schema.
      Specified by:
      getTableDescription in interface Schema
      Returns:
      The table description from the schema.
    • getInputTableStateSpec

      public Optional<InputTableStateSpec> getInputTableStateSpec()
      Description copied from interface: Schema
      Return the input table specification from this schema.
      Specified by:
      getInputTableStateSpec in interface Schema
      Returns:
      The input table specification if present, or null.
    • getImportSources

      @NotNull public @NotNull List<ImportSource> getImportSources()
      Description copied from interface: SchemaInternal
      Get all defined ImportSources.
      Specified by:
      getImportSources in interface SchemaInternal
      Returns:
      all defined import sources, might be empty
    • getImportSources

      @NotNull public @NotNull List<ImportSource> getImportSources(@NotNull @NotNull String type)
      Description copied from interface: SchemaInternal
      Get all ImportSources of the given type.
      Specified by:
      getImportSources in interface SchemaInternal
      Parameters:
      type - the import source type
      Returns:
      all import sources of the given type, may be null.
    • getImportSource

      @Nullable public @Nullable ImportSource getImportSource(@NotNull @NotNull String type, @Nullable @Nullable String sourceName)
      Description copied from interface: SchemaInternal
      Get the ImportSource with the given type and name. The first matching ImportSource is returned, where it is possible to have more than one. If sourceName is null, the first import source of the specified type will be returned.
      Specified by:
      getImportSource in interface SchemaInternal
      Parameters:
      type - the import source type
      sourceName - the import source name, may be null
      Returns:
      the identified import source, or null if not found
    • getAttributes

      @NotNull public @NotNull Map<String,String> getAttributes()
      Description copied from interface: SchemaInternal
      Get all top level attributes for this schema.
      Specified by:
      getAttributes in interface SchemaInternal
      Returns:
      a map containing all attributes set for this schema. Might be empty.
    • getAttributeValue

      @Nullable public @Nullable String getAttributeValue(@NotNull @NotNull String attributeName)
      Description copied from interface: SchemaInternal
      Get the value for the named attribute.
      Specified by:
      getAttributeValue in interface SchemaInternal
      Parameters:
      attributeName - the attribute to fetch
      Returns:
      the value for the attribute, or null if it is not set
    • getPartitionKeyFormula

      @Nullable public @Nullable String getPartitionKeyFormula()
      Description copied from interface: SchemaInternal
      Get the partitioning key formula for this schema.
      Specified by:
      getPartitionKeyFormula in interface SchemaInternal
      Returns:
      the partitioning key formula if set, else null
    • hasLoggers

      public boolean hasLoggers()
      Description copied from interface: SchemaInternal
      Returns true if this schema has any Loggers or LoggerListeners.
      Specified by:
      hasLoggers in interface SchemaInternal
      Returns:
      true if this schema has any Loggers or LoggerListeners
    • hasListeners

      public boolean hasListeners()
      Description copied from interface: SchemaInternal
      Returns true if this schema has any Listeners or LoggerListeners.
      Specified by:
      hasListeners in interface SchemaInternal
      Returns:
      true if this schema has any Listeners or LoggerListeners
    • getLoggers

      @NotNull public @NotNull List<Logger> getLoggers()
      Description copied from interface: SchemaInternal
      Get an immutable list of the Logger instances for this schema. This includes LoggerListeners.
      Specified by:
      getLoggers in interface SchemaInternal
      Returns:
      an immutable list of Loggers
    • getV2Loggers

      @NotNull public @NotNull List<V2Logger> getV2Loggers()
      Description copied from interface: SchemaInternal
      Get an immutable list of the V2Logger instances for this schema.
      Specified by:
      getV2Loggers in interface SchemaInternal
      Returns:
      an immutable list of V2 loggers
    • getListeners

      @NotNull public @NotNull List<Listener> getListeners()
      Description copied from interface: SchemaInternal
      Get an immutable list of the Listener instances for this schema. This includes LoggerListeners.
      Specified by:
      getListeners in interface SchemaInternal
      Returns:
      an immutable list of Listeners
    • getValidator

      @Nullable public @Nullable Validator getValidator()
      Description copied from interface: SchemaInternal
      Get an immutable Validator for this schema.
      Specified by:
      getValidator in interface SchemaInternal
      Returns:
      a Validator if configured, else null
    • getDataIndexSets

      @NotNull public @NotNull List<String[]> getDataIndexSets()
      Description copied from interface: SchemaInternal
      Get the set of Data Indexes for this table. Each element in the list is a set of columns which produce a key for which the table has been indexed by.
      Specified by:
      getDataIndexSets in interface SchemaInternal
      Returns:
      a list of Data Index sets
    • getExtendedStorage

      @Nullable public @Nullable ExtendedStorage getExtendedStorage()
      Description copied from interface: SchemaInternal
      Return the extended storage for this schema
      Specified by:
      getExtendedStorage in interface SchemaInternal
      Returns:
      an ExtendedStorage if present, else null
    • getDefaultMergeFormat

      @NotNull public io.deephaven.shadow.enterprise.com.illumon.iris.db.tables.databases.Database.StorageFormat getDefaultMergeFormat()
      Specified by:
      getDefaultMergeFormat in interface SchemaInternal
      Returns:
      the preferred merge storage format
    • getMergeCodecName

      @Nullable public @Nullable String getMergeCodecName(@NotNull @NotNull String mergeFormat)
      Description copied from interface: SchemaInternal
      For the specified merge format, return the defined codec name, if any.
      Specified by:
      getMergeCodecName in interface SchemaInternal
      Parameters:
      mergeFormat - the merge format
      Returns:
      the codec name, if defined
    • getGroupingColumns

      @NotNull public @NotNull List<String> getGroupingColumns()
      Specified by:
      getGroupingColumns in interface SchemaInternal
      Returns:
      An immutable collection of columns defined within the schema as Grouping
    • getPartitioningColumns

      @NotNull public @NotNull List<String> getPartitioningColumns()
      Specified by:
      getPartitioningColumns in interface SchemaInternal
      Returns:
      An immutable collection of columns defined within the schema as Partitioning
    • getSymbolTableTypes

      @NotNull public @NotNull Map<String,io.deephaven.shadow.enterprise.com.illumon.dataobjects.ColumnDefinition.SymbolTableType> getSymbolTableTypes()
      Specified by:
      getSymbolTableTypes in interface SchemaInternal
      Returns:
      an immutable map of columns with a defined SymbolTableType
    • getStorageType

      public StorageType getStorageType()
      Description copied from interface: SchemaInternal
      Get the StorageType as an integer enum value.
      Specified by:
      getStorageType in interface SchemaInternal
      Returns:
      the storage type
    • getTableType

      @NotNull public @NotNull io.deephaven.shadow.enterprise.com.illumon.iris.db.v2.locations.TableType getTableType(boolean intraday)
      Description copied from interface: SchemaInternal
      Get the table type for this schema, depending on if it was an intraday table or not. Note that the intraday setting is ignored for User table types. Note: This method's table type inference does not account for new table types; in particular, for User tables. To do so, use SchemaInternal.getTableTypeV2(boolean) instead. This method is not scheduled for removal, but should only be used within Legacy workers or infrastructure code.
      Specified by:
      getTableType in interface SchemaInternal
      Parameters:
      intraday - true if the returned type should reflect an intraday table
      Returns:
      The table type
    • getTableTypeV2

      @NotNull public @NotNull io.deephaven.shadow.enterprise.com.illumon.iris.db.v2.locations.TableType getTableTypeV2(boolean intraday)
      Description copied from interface: SchemaInternal
      Get the table type for this schema, depending on if it was an intraday table or not. The intraday setting is used even for User table types.
      Specified by:
      getTableTypeV2 in interface SchemaInternal
      Parameters:
      intraday - true if the returned type should reflect an intraday table
      Returns:
      The table type