use of org.apache.flink.annotation.VisibleForTesting in project flink by apache.
the class AWSAsyncSinkUtil method createAwsAsyncClient.
@VisibleForTesting
static <S extends SdkClient, T extends AwsAsyncClientBuilder<? extends T, S> & AwsClientBuilder<? extends T, S>> S createAwsAsyncClient(final Properties configProps, final T clientBuilder, final SdkAsyncHttpClient httpClient, final ClientOverrideConfiguration overrideConfiguration) {
if (configProps.containsKey(AWSConfigConstants.AWS_ENDPOINT)) {
final URI endpointOverride = URI.create(configProps.getProperty(AWSConfigConstants.AWS_ENDPOINT));
clientBuilder.endpointOverride(endpointOverride);
}
return clientBuilder.httpClient(httpClient).overrideConfiguration(overrideConfiguration).credentialsProvider(getCredentialsProvider(configProps)).region(getRegion(configProps)).build();
}
use of org.apache.flink.annotation.VisibleForTesting in project flink by apache.
the class InputPriorityGraphGenerator method calculatePipelinedAncestors.
/**
* Find the ancestors by going through PIPELINED edges.
*/
@VisibleForTesting
List<ExecNode<?>> calculatePipelinedAncestors(ExecNode<?> node) {
List<ExecNode<?>> ret = new ArrayList<>();
AbstractExecNodeExactlyOnceVisitor ancestorVisitor = new AbstractExecNodeExactlyOnceVisitor() {
@Override
protected void visitNode(ExecNode<?> node) {
boolean hasAncestor = false;
if (!boundaries.contains(node)) {
List<InputProperty> inputProperties = node.getInputProperties();
for (int i = 0; i < inputProperties.size(); i++) {
// we only go through PIPELINED edges
if (inputProperties.get(i).getDamBehavior().stricterOrEqual(safeDamBehavior)) {
continue;
}
hasAncestor = true;
node.getInputEdges().get(i).getSource().accept(this);
}
}
if (!hasAncestor) {
ret.add(node);
}
}
};
node.accept(ancestorVisitor);
return ret;
}
use of org.apache.flink.annotation.VisibleForTesting in project flink by apache.
the class CatalogTableStatisticsConverter method convertToColumnStatsMap.
@VisibleForTesting
public static Map<String, ColumnStats> convertToColumnStatsMap(Map<String, CatalogColumnStatisticsDataBase> columnStatisticsData) {
Map<String, ColumnStats> columnStatsMap = new HashMap<>();
for (Map.Entry<String, CatalogColumnStatisticsDataBase> entry : columnStatisticsData.entrySet()) {
if (entry.getValue() != null) {
ColumnStats columnStats = convertToColumnStats(entry.getValue());
columnStatsMap.put(entry.getKey(), columnStats);
}
}
return columnStatsMap;
}
use of org.apache.flink.annotation.VisibleForTesting in project flink by apache.
the class StreamExecMatch method translatePattern.
@VisibleForTesting
public static Tuple2<Pattern<RowData, RowData>, List<String>> translatePattern(MatchSpec matchSpec, TableConfig tableConfig, RelBuilder relBuilder, RowType inputRowType) {
final PatternVisitor patternVisitor = new PatternVisitor(tableConfig, relBuilder, inputRowType, matchSpec);
final Pattern<RowData, RowData> cepPattern;
if (matchSpec.getInterval().isPresent()) {
Time interval = translateTimeBound(matchSpec.getInterval().get());
cepPattern = matchSpec.getPattern().accept(patternVisitor).within(interval);
} else {
cepPattern = matchSpec.getPattern().accept(patternVisitor);
}
return new Tuple2<>(cepPattern, new ArrayList<>(patternVisitor.names));
}
Aggregations