Skip to content

Commit

Permalink
[FLINK-36502] [table] Remove deprecated methods in FactoryUtil (apach…
Browse files Browse the repository at this point in the history
…e#25559)

Co-authored-by: lihai <[email protected]>
  • Loading branch information
Sud0x67 and lihai authored Nov 8, 2024
1 parent bd6f292 commit b4bcde5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 118 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,63 +246,6 @@ public static DynamicTableSource createDynamicTableSource(
}
}

/**
* @deprecated Use {@link #createDynamicTableSource(DynamicTableSourceFactory, ObjectIdentifier,
* ResolvedCatalogTable, Map, ReadableConfig, ClassLoader, boolean)}
*/
@Deprecated
public static DynamicTableSource createDynamicTableSource(
@Nullable DynamicTableSourceFactory preferredFactory,
ObjectIdentifier objectIdentifier,
ResolvedCatalogTable catalogTable,
ReadableConfig configuration,
ClassLoader classLoader,
boolean isTemporary) {
return createDynamicTableSource(
preferredFactory,
objectIdentifier,
catalogTable,
Collections.emptyMap(),
configuration,
classLoader,
isTemporary);
}

/**
* Creates a {@link DynamicTableSource} from a {@link CatalogTable}.
*
* <p>It considers {@link Catalog#getFactory()} if provided.
*
* @deprecated Use {@link #createDynamicTableSource(DynamicTableSourceFactory, ObjectIdentifier,
* ResolvedCatalogTable, Map, ReadableConfig, ClassLoader, boolean)} instead.
*/
@Deprecated
public static DynamicTableSource createTableSource(
@Nullable Catalog catalog,
ObjectIdentifier objectIdentifier,
ResolvedCatalogTable catalogTable,
ReadableConfig configuration,
ClassLoader classLoader,
boolean isTemporary) {
final DefaultDynamicTableContext context =
new DefaultDynamicTableContext(
objectIdentifier,
catalogTable,
Collections.emptyMap(),
configuration,
classLoader,
isTemporary);

return createDynamicTableSource(
getDynamicTableFactory(DynamicTableSourceFactory.class, catalog, context),
objectIdentifier,
catalogTable,
Collections.emptyMap(),
configuration,
classLoader,
isTemporary);
}

/**
* Creates a {@link DynamicTableSink} from a {@link CatalogTable}.
*
Expand Down Expand Up @@ -349,63 +292,6 @@ public static DynamicTableSink createDynamicTableSink(
}
}

/**
* @deprecated Use {@link #createDynamicTableSink(DynamicTableSinkFactory, ObjectIdentifier,
* ResolvedCatalogTable, Map, ReadableConfig, ClassLoader, boolean)}
*/
@Deprecated
public static DynamicTableSink createDynamicTableSink(
@Nullable DynamicTableSinkFactory preferredFactory,
ObjectIdentifier objectIdentifier,
ResolvedCatalogTable catalogTable,
ReadableConfig configuration,
ClassLoader classLoader,
boolean isTemporary) {
return createDynamicTableSink(
preferredFactory,
objectIdentifier,
catalogTable,
Collections.emptyMap(),
configuration,
classLoader,
isTemporary);
}

/**
* Creates a {@link DynamicTableSink} from a {@link CatalogTable}.
*
* <p>It considers {@link Catalog#getFactory()} if provided.
*
* @deprecated Use {@link #createDynamicTableSink(DynamicTableSinkFactory, ObjectIdentifier,
* ResolvedCatalogTable, Map, ReadableConfig, ClassLoader, boolean)} instead.
*/
@Deprecated
public static DynamicTableSink createTableSink(
@Nullable Catalog catalog,
ObjectIdentifier objectIdentifier,
ResolvedCatalogTable catalogTable,
ReadableConfig configuration,
ClassLoader classLoader,
boolean isTemporary) {
final DefaultDynamicTableContext context =
new DefaultDynamicTableContext(
objectIdentifier,
catalogTable,
Collections.emptyMap(),
configuration,
classLoader,
isTemporary);

return createDynamicTableSink(
getDynamicTableFactory(DynamicTableSinkFactory.class, catalog, context),
objectIdentifier,
catalogTable,
Collections.emptyMap(),
configuration,
classLoader,
isTemporary);
}

/**
* Creates a utility that helps validating options for a {@link CatalogFactory}.
*
Expand Down Expand Up @@ -593,10 +479,10 @@ public static Module createModule(
* Discovers a factory using the given factory base class and identifier.
*
* <p>This method is meant for cases where {@link #createTableFactoryHelper(DynamicTableFactory,
* DynamicTableFactory.Context)} {@link #createTableSource(Catalog, ObjectIdentifier,
* ResolvedCatalogTable, ReadableConfig, ClassLoader, boolean)}, and {@link
* #createTableSink(Catalog, ObjectIdentifier, ResolvedCatalogTable, ReadableConfig,
* ClassLoader, boolean)} are not applicable.
* DynamicTableFactory.Context)} {@link #createDynamicTableSource(DynamicTableSourceFactory,
* ObjectIdentifier, ResolvedCatalogTable, Map, ReadableConfig, ClassLoader, boolean)}, and
* {@link #createDynamicTableSink(DynamicTableSinkFactory, ObjectIdentifier,
* ResolvedCatalogTable, Map, ReadableConfig, ClassLoader, boolean)} are not applicable.
*/
@SuppressWarnings("unchecked")
public static <T extends Factory> T discoverFactory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public static DynamicTableSink createTableSink(
partitionKeys,
options),
schema),
Collections.emptyMap(),
new Configuration(),
FactoryMocks.class.getClassLoader(),
false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import org.apache.calcite.rel.hint.RelHint;
import org.apache.calcite.rel.type.RelDataType;

import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
Expand Down Expand Up @@ -176,6 +177,7 @@ private DynamicTableSource createDynamicTableSource(
factory,
schemaTable.getContextResolvedTable().getIdentifier(),
catalogTable,
Collections.emptyMap(),
context.getTableConfig(),
context.getClassLoader(),
schemaTable.isTemporary());
Expand Down

0 comments on commit b4bcde5

Please sign in to comment.