use of org.apache.flink.table.planner.plan.nodes.exec.ExecEdge.HashShuffle in project flink by apache.
the class ShuffleJsonSerializer method serialize.
@Override
public void serialize(Shuffle shuffle, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
jsonGenerator.writeStartObject();
Shuffle.Type type = shuffle.getType();
jsonGenerator.writeStringField("type", type.name());
switch(type) {
case ANY:
case SINGLETON:
case BROADCAST:
case FORWARD:
// do nothing, type name is enough
break;
case HASH:
HashShuffle hashShuffle = (HashShuffle) shuffle;
jsonGenerator.writeFieldName("keys");
jsonGenerator.writeArray(hashShuffle.getKeys(), // offset
0, hashShuffle.getKeys().length);
break;
default:
throw new TableException("Unsupported shuffle type: " + type);
}
jsonGenerator.writeEndObject();
}
Aggregations