@Test public void shouldModifyTableNameForShortTableName() { when(resultSet.size()).thenReturn(0); TableReference tableRef = TableReference.create(Namespace.create("ns1"), "short"); String shortPrefixedTableName = oracleTableNameMapper .getShortPrefixedTableName(connectionSupplier, TEST_PREFIX, tableRef); assertThat(shortPrefixedTableName, is("a_ns__short_0000")); }
public String getShortPrefixedTableName( ConnectionSupplier connectionSupplier, String tablePrefix, TableReference tableRef) { Preconditions.checkState(tablePrefix.length() <= AtlasDbConstants.MAX_TABLE_PREFIX_LENGTH, "The tablePrefix can be at most %s characters long", AtlasDbConstants.MAX_TABLE_PREFIX_LENGTH); TableReference shortenedNamespaceTableRef = truncateNamespace(tableRef); String prefixedTableName = tablePrefix + DbKvs.internalTableName(shortenedNamespaceTableRef); String truncatedTableName = truncate(prefixedTableName, NAMESPACED_TABLE_NAME_LENGTH); String fullTableName = tablePrefix + DbKvs.internalTableName(tableRef); return truncatedTableName + "_" + getTableNumber(connectionSupplier, fullTableName, truncatedTableName); }
OracleTableNameMapper { public String getShortPrefixedTableName( ConnectionSupplier connectionSupplier, String tablePrefix, TableReference tableRef) { Preconditions.checkState(tablePrefix.length() <= AtlasDbConstants.MAX_TABLE_PREFIX_LENGTH, "The tablePrefix can be at most %s characters long", AtlasDbConstants.MAX_TABLE_PREFIX_LENGTH); TableReference shortenedNamespaceTableRef = truncateNamespace(tableRef); String prefixedTableName = tablePrefix + DbKvs.internalTableName(shortenedNamespaceTableRef); String truncatedTableName = truncate(prefixedTableName, NAMESPACED_TABLE_NAME_LENGTH); String fullTableName = tablePrefix + DbKvs.internalTableName(tableRef); return truncatedTableName + "_" + getTableNumber(connectionSupplier, fullTableName, truncatedTableName); } }
OracleTableNameMapper { public String getShortPrefixedTableName( ConnectionSupplier connectionSupplier, String tablePrefix, TableReference tableRef) { Preconditions.checkState(tablePrefix.length() <= AtlasDbConstants.MAX_TABLE_PREFIX_LENGTH, "The tablePrefix can be at most %s characters long", AtlasDbConstants.MAX_TABLE_PREFIX_LENGTH); TableReference shortenedNamespaceTableRef = truncateNamespace(tableRef); String prefixedTableName = tablePrefix + DbKvs.internalTableName(shortenedNamespaceTableRef); String truncatedTableName = truncate(prefixedTableName, NAMESPACED_TABLE_NAME_LENGTH); String fullTableName = tablePrefix + DbKvs.internalTableName(tableRef); return truncatedTableName + "_" + getTableNumber(connectionSupplier, fullTableName, truncatedTableName); }  }
OracleTableNameMapper { public String getShortPrefixedTableName( ConnectionSupplier connectionSupplier, String tablePrefix, TableReference tableRef) { Preconditions.checkState(tablePrefix.length() <= AtlasDbConstants.MAX_TABLE_PREFIX_LENGTH, "The tablePrefix can be at most %s characters long", AtlasDbConstants.MAX_TABLE_PREFIX_LENGTH); TableReference shortenedNamespaceTableRef = truncateNamespace(tableRef); String prefixedTableName = tablePrefix + DbKvs.internalTableName(shortenedNamespaceTableRef); String truncatedTableName = truncate(prefixedTableName, NAMESPACED_TABLE_NAME_LENGTH); String fullTableName = tablePrefix + DbKvs.internalTableName(tableRef); return truncatedTableName + "_" + getTableNumber(connectionSupplier, fullTableName, truncatedTableName); }  String getShortPrefixedTableName(
            ConnectionSupplier connectionSupplier,
            String tablePrefix,
            TableReference tableRef); }
OracleTableNameMapper { public String getShortPrefixedTableName( ConnectionSupplier connectionSupplier, String tablePrefix, TableReference tableRef) { Preconditions.checkState(tablePrefix.length() <= AtlasDbConstants.MAX_TABLE_PREFIX_LENGTH, "The tablePrefix can be at most %s characters long", AtlasDbConstants.MAX_TABLE_PREFIX_LENGTH); TableReference shortenedNamespaceTableRef = truncateNamespace(tableRef); String prefixedTableName = tablePrefix + DbKvs.internalTableName(shortenedNamespaceTableRef); String truncatedTableName = truncate(prefixedTableName, NAMESPACED_TABLE_NAME_LENGTH); String fullTableName = tablePrefix + DbKvs.internalTableName(tableRef); return truncatedTableName + "_" + getTableNumber(connectionSupplier, fullTableName, truncatedTableName); }  String getShortPrefixedTableName(
            ConnectionSupplier connectionSupplier,
            String tablePrefix,
            TableReference tableRef); static final int SUFFIX_NUMBER_LENGTH; static final int MAX_NAMESPACE_LENGTH; }