Class TableDefinitionCompatibility
java.lang.Object
io.deephaven.enterprise.compatibility.TableDefinitionCompatibility
A compatibility class for converting enterprise
TableDefinition into community
TableDefinition-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull ColumnDefinition<?>convertToCommunity(io.deephaven.shadow.enterprise.com.illumon.dataobjects.ColumnDefinition<?> enterpriseColumnDefinition) Convert the specified Enterprise format definition to a communityColumnDefinition.static TableDefinitionconvertToCommunity(io.deephaven.shadow.enterprise.com.illumon.iris.db.tables.TableDefinition dheDef) Convert the specified Enterprise format definition to a communityTableDefinition.static io.deephaven.shadow.enterprise.com.illumon.iris.db.tables.TableDefinitionconvertToEnterprise(@NotNull TableDefinition communityDef) This method does its best to convert a Community definition to an enterprise one.static io.deephaven.shadow.enterprise.com.illumon.dataobjects.ColumnDefinitionconvertToEnterprise(ColumnDefinition<?> col) Convert a Core column definition to a Legacy column definition.static io.deephaven.shadow.enterprise.com.illumon.iris.db.tables.TableDefinitionloadDefinitionFromDirectory(@NotNull File sourceDirectory, @NotNull String tableName) Load a TableDefinition from the definition file in the specified directory.static Class<?>maybeMutateCommunityType(@Nullable Class<?> inputType) Convert the column data types.
-
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 communityTableDefinition.ColumnDefinition.ColumnTypeis converted 1:1. When processing data typesDBDateTimeis converted toInstant.- Parameters:
dheDef- the Enterprise definition to convert- Returns:
- a community
TableDefinition
-
convertToCommunity
@NotNull public static @NotNull ColumnDefinition<?> convertToCommunity(io.deephaven.shadow.enterprise.com.illumon.dataobjects.ColumnDefinition<?> enterpriseColumnDefinition) Convert the specified Enterprise format definition to a communityColumnDefinition.ColumnDefinition.ColumnTypeis converted 1:1. When processing data typesDBDateTimeis converted toInstant.- Parameters:
enterpriseColumnDefinition- an enterprise column definition- Returns:
- the corresponding community column definition
-
convertToEnterprise
public static io.deephaven.shadow.enterprise.com.illumon.iris.db.tables.TableDefinition convertToEnterprise(@NotNull @NotNull TableDefinition communityDef) This method does its 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
-
convertToEnterprise
@NotNull public static io.deephaven.shadow.enterprise.com.illumon.dataobjects.ColumnDefinition convertToEnterprise(ColumnDefinition<?> col) Convert a Core column definition to a Legacy column definition.- Parameters:
col- the column definition to convert.- Returns:
- the Legacy column definition.
-
maybeMutateCommunityType
Convert the column data types. Currently, the mappings areStringSetis mapped toStringSetArrayStringSetis mapped toStringSetArrayWrapper
- 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 intableName- 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
-