Class TableDefinitionCompatibility

java.lang.Object
io.deephaven.enterprise.compatibility.TableDefinitionCompatibility

public class TableDefinitionCompatibility extends Object
A compatibility class for converting enterprise TableDefinition into community TableDefinition
  • Method Details

    • convertToCommunity

      public static TableDefinition convertToCommunity(@NotNull io.deephaven.shadow.enterprise.com.illumon.iris.db.tables.TableDefinition dheDef)
      Convert the specified Enterprise format definition to a community TableDefinition. ColumnDefinition.ColumnType is converted 1:1. When processing data types DBDateTime is converted to Instant.
      Parameters:
      dheDef - the Enterprise definition to convert
      Returns:
      a community TableDefinition
    • convertToEnterprise

      public static io.deephaven.shadow.enterprise.com.illumon.iris.db.tables.TableDefinition convertToEnterprise(@NotNull @NotNull TableDefinition communityDef)
      This method does it's best to convert a Community definition to an enterprise one. The community definition does not contain all the same information, however, so certain things like namespace, tablename, isVarSizeString cannot be determined.
      Parameters:
      communityDef - the community definition.
      Returns:
      the converted enterprise definition
    • maybeMutateCommunityType

      public static Class<?> maybeMutateCommunityType(@Nullable @Nullable Class<?> inputType)
      Convert the column data types. Currently, the mappings are
      Parameters:
      inputType - the type to maybe convert
      Returns:
      the converted type
    • loadDefinitionFromDirectory

      @Nullable public static io.deephaven.shadow.enterprise.com.illumon.iris.db.tables.TableDefinition loadDefinitionFromDirectory(@NotNull @NotNull File sourceDirectory, @NotNull @NotNull String tableName)
      Load a TableDefinition from the definition file in the specified directory. Enterprise can store table definitions in either a generic "table.tbl" file or "tablename.tbl" file. We'll have to try each of them to guarantee that we can actually read one.
      Parameters:
      sourceDirectory - The directory to find the definition file in
      tableName - The table name to use when determining the implementation-defined definition file name
      Returns:
      The TableDefinition object, or null if not found and allowMissing
      Throws:
      UncheckedIOException - or other RuntimeException if the file is not found and !allowMissing, or read fails