use of org.apache.flink.FlinkVersion in project flink by apache.
the class RowSerializerUpgradeTest method testSpecifications.
@Parameterized.Parameters(name = "Test Specification = {0}")
public static Collection<TestSpecification<?, ?>> testSpecifications() throws Exception {
ArrayList<TestSpecification<?, ?>> testSpecifications = new ArrayList<>();
// for RowSerializer we also test against 1.10 and newer because we have snapshots
// for this which go beyond what we have for the usual subclasses of
// TypeSerializerUpgradeTestBase
List<FlinkVersion> testVersions = new ArrayList<>();
testVersions.add(FlinkVersion.v1_10);
testVersions.addAll(MIGRATION_VERSIONS);
for (FlinkVersion flinkVersion : testVersions) {
testSpecifications.add(new TestSpecification<>("row-serializer", flinkVersion, RowSerializerSetup.class, RowSerializerVerifier.class));
}
return testSpecifications;
}
use of org.apache.flink.FlinkVersion in project flink by apache.
the class KafkaSerializerUpgradeTest method testSpecifications.
@Parameterized.Parameters(name = "Test Specification = {0}")
public static Collection<TestSpecification<?, ?>> testSpecifications() throws Exception {
ArrayList<TestSpecification<?, ?>> testSpecifications = new ArrayList<>();
for (FlinkVersion flinkVersion : MIGRATION_VERSIONS) {
testSpecifications.add(new TestSpecification<>("transaction-state-serializer", flinkVersion, TransactionStateSerializerSetup.class, TransactionStateSerializerVerifier.class));
testSpecifications.add(new TestSpecification<>("context-state-serializer", flinkVersion, ContextStateSerializerSetup.class, ContextStateSerializerVerifier.class));
}
return testSpecifications;
}
use of org.apache.flink.FlinkVersion in project flink by apache.
the class WindowSerializerUpgradeTest method testSpecifications.
@Parameterized.Parameters(name = "Test Specification = {0}")
public static Collection<TestSpecification<?, ?>> testSpecifications() throws Exception {
ArrayList<TestSpecification<?, ?>> testSpecifications = new ArrayList<>();
for (FlinkVersion flinkVersion : MIGRATION_VERSIONS) {
testSpecifications.add(new TestSpecification<>("time-window-serializer", flinkVersion, TimeWindowSerializerSetup.class, TimeWindowSerializerVerifier.class));
testSpecifications.add(new TestSpecification<>("global-window-serializer", flinkVersion, GlobalWindowSerializerSetup.class, GlobalWindowSerializerVerifier.class));
}
return testSpecifications;
}
use of org.apache.flink.FlinkVersion in project flink by apache.
the class UnionSerializerUpgradeTest method testSpecifications.
@Parameterized.Parameters(name = "Test Specification = {0}")
public static Collection<TestSpecification<?, ?>> testSpecifications() throws Exception {
ArrayList<TestSpecification<?, ?>> testSpecifications = new ArrayList<>();
for (FlinkVersion flinkVersion : MIGRATION_VERSIONS) {
testSpecifications.add(new TestSpecification<>("union-serializer-one", flinkVersion, UnionSerializerOneSetup.class, UnionSerializerOneVerifier.class));
testSpecifications.add(new TestSpecification<>("union-serializer-two", flinkVersion, UnionSerializerTwoSetup.class, UnionSerializerTwoVerifier.class));
}
return testSpecifications;
}
use of org.apache.flink.FlinkVersion in project flink by apache.
the class JsonPlanGraph method convertToExecNodeGraph.
ExecNodeGraph convertToExecNodeGraph() {
Map<Integer, ExecNode<?>> idToExecNodes = new HashMap<>();
for (ExecNode<?> execNode : nodes) {
int id = execNode.getId();
if (idToExecNodes.containsKey(id)) {
throw new TableException(String.format("The id: %s is not unique for ExecNode: %s.\nplease check it.", id, execNode.getDescription()));
}
idToExecNodes.put(id, execNode);
}
Map<Integer, List<ExecEdge>> idToInputEdges = new HashMap<>();
Map<Integer, List<ExecEdge>> idToOutputEdges = new HashMap<>();
for (JsonPlanEdge edge : edges) {
ExecNode<?> source = idToExecNodes.get(edge.getSourceId());
if (source == null) {
throw new TableException(String.format("Source node id: %s is not found in nodes.", edge.getSourceId()));
}
ExecNode<?> target = idToExecNodes.get(edge.getTargetId());
if (target == null) {
throw new TableException(String.format("Target node id: %s is not found in nodes.", edge.getTargetId()));
}
ExecEdge execEdge = ExecEdge.builder().source(source).target(target).shuffle(edge.getShuffle()).exchangeMode(edge.getExchangeMode()).build();
idToInputEdges.computeIfAbsent(target.getId(), n -> new ArrayList<>()).add(execEdge);
idToOutputEdges.computeIfAbsent(source.getId(), n -> new ArrayList<>()).add(execEdge);
}
List<ExecNode<?>> rootNodes = new ArrayList<>();
for (Map.Entry<Integer, ExecNode<?>> entry : idToExecNodes.entrySet()) {
int id = entry.getKey();
ExecNode<?> node = entry.getValue();
// connect input edges
List<ExecEdge> inputEdges = idToInputEdges.getOrDefault(id, new ArrayList<>());
node.setInputEdges(inputEdges);
if (!idToOutputEdges.containsKey(id)) {
// if the node has no output nodes, it's a root node
rootNodes.add(node);
}
}
return new ExecNodeGraph(flinkVersion, rootNodes);
}
Aggregations