Skip to content

Commit

Permalink
[FLINK-15912][table] Clean TableFactoryUtil
Browse files Browse the repository at this point in the history
  • Loading branch information
JingsongLi authored and wuchong committed Feb 22, 2020
1 parent 4e92bdb commit 052eb77
Showing 1 changed file with 0 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.apache.flink.table.sinks.TableSink;
import org.apache.flink.table.sources.TableSource;

import java.util.Map;
import java.util.Optional;

/**
Expand Down Expand Up @@ -60,34 +59,6 @@ public static <T> TableSink<T> findAndCreateTableSink(TableSinkFactory.Context c
}
}

/**
* Returns a table source matching the properties.
*/
@SuppressWarnings("unchecked")
private static <T> TableSource<T> findAndCreateTableSource(Map<String, String> properties) {
try {
return TableFactoryService
.find(TableSourceFactory.class, properties)
.createTableSource(properties);
} catch (Throwable t) {
throw new TableException("findAndCreateTableSource failed.", t);
}
}

@SuppressWarnings("unchecked")
private static <T> TableSink<T> findAndCreateTableSink(Map<String, String> properties) {
TableSink tableSink;
try {
tableSink = TableFactoryService
.find(TableSinkFactory.class, properties)
.createTableSink(properties);
} catch (Throwable t) {
throw new TableException("findAndCreateTableSink failed.", t);
}

return tableSink;
}

/**
* Creates a table sink for a {@link CatalogTable} using table factory associated with the catalog.
*/
Expand Down

0 comments on commit 052eb77

Please sign in to comment.