public Serde<T> getSerde(String name, Config config) { return new SerializableSerde<>(); } }
private String serializeSerde(Serde serde) { return Base64.getEncoder().encodeToString(new SerializableSerde().toBytes(serde)); }
private Map<String, Serde> validateAndGetDeserializedSerdes(Config jobConfig, int numSerdes) { Config serializers = jobConfig.subset("serializers.registry.", true); // make sure that the serializers deserialize correctly SerializableSerde<Serde> serializableSerde = new SerializableSerde<>(); assertEquals(numSerdes, serializers.size()); return serializers.entrySet().stream().collect(Collectors.toMap( e -> e.getKey().replace(SerializerConfig.SERIALIZED_INSTANCE_SUFFIX(), ""), e -> serializableSerde.fromBytes(Base64.getDecoder().decode(e.getValue().getBytes())) )); }
/** * Returns a deserialized {@link OperatorSpecGraph} as a copy from this instance of {@link OperatorSpecGraph} * This is used to create per-task instance of {@link OperatorSpecGraph} when instantiating task instances. * * @return a copy of this {@link OperatorSpecGraph} object via deserialization */ public OperatorSpecGraph clone() { if (opSpecGraphSerde == null) { throw new IllegalStateException("Cannot clone from an already deserialized OperatorSpecGraph."); } return opSpecGraphSerde.fromBytes(serializedOpSpecGraph); }
public OperatorSpecGraph(StreamApplicationDescriptorImpl streamAppDesc) { this.inputOperators = streamAppDesc.getInputOperators(); this.outputStreams = streamAppDesc.getOutputStreams(); this.intermediateBroadcastStreamIds = streamAppDesc.getIntermediateBroadcastStreamIds(); this.allOpSpecs = Collections.unmodifiableSet(this.findAllOperatorSpecs()); this.hasWindowOrJoins = checkWindowOrJoins(); this.serializedOpSpecGraph = opSpecGraphSerde.toBytes(this); }
SerializableSerde<Serde> serializableSerde = new SerializableSerde<>(); Base64.Encoder base64Encoder = Base64.getEncoder(); Map<Serde, String> serdeUUIDs = new HashMap<>(); s -> serde.getClass().getSimpleName() + "-" + UUID.randomUUID().toString()); serdeConfigs.putIfAbsent(String.format(SerializerConfig.SERDE_SERIALIZED_INSTANCE(), serdeName), base64Encoder.encodeToString(serializableSerde.toBytes(serde))); });
/** * Returns a deserialized {@link OperatorSpecGraph} as a copy from this instance of {@link OperatorSpecGraph} * This is used to create per-task instance of {@link OperatorSpecGraph} when instantiating task instances. * * @return a copy of this {@link OperatorSpecGraph} object via deserialization */ public OperatorSpecGraph clone() { if (opSpecGraphSerde == null) { throw new IllegalStateException("Cannot clone from an already deserialized OperatorSpecGraph."); } return opSpecGraphSerde.fromBytes(serializedOpSpecGraph); }
public OperatorSpecGraph(StreamApplicationDescriptorImpl streamAppDesc) { this.inputOperators = streamAppDesc.getInputOperators(); this.outputStreams = streamAppDesc.getOutputStreams(); this.intermediateBroadcastStreamIds = streamAppDesc.getIntermediateBroadcastStreamIds(); this.allOpSpecs = Collections.unmodifiableSet(this.findAllOperatorSpecs()); this.hasWindowOrJoins = checkWindowOrJoins(); this.serializedOpSpecGraph = opSpecGraphSerde.toBytes(this); }
serdes.addAll(tableKeySerdes.values()); serdes.addAll(tableMsgSerdes.values()); SerializableSerde<Serde> serializableSerde = new SerializableSerde<>(); Base64.Encoder base64Encoder = Base64.getEncoder(); Map<Serde, String> serdeUUIDs = new HashMap<>(); s -> serde.getClass().getSimpleName() + "-" + UUID.randomUUID().toString()); configs.putIfAbsent(String.format(SerializerConfig.SERDE_SERIALIZED_INSTANCE(), serdeName), base64Encoder.encodeToString(serializableSerde.toBytes(serde))); });
/** * Returns a deserialized {@link OperatorSpecGraph} as a copy from this instance of {@link OperatorSpecGraph} * This is used to create per-task instance of {@link OperatorSpecGraph} when instantiating task instances. * * @return a copy of this {@link OperatorSpecGraph} object via deserialization */ public OperatorSpecGraph clone() { if (opSpecGraphSerde == null) { throw new IllegalStateException("Cannot clone from an already deserialized OperatorSpecGraph."); } return opSpecGraphSerde.fromBytes(serializedOpSpecGraph); }
public OperatorSpecGraph(StreamApplicationDescriptorImpl streamAppDesc) { this.inputOperators = streamAppDesc.getInputOperators(); this.outputStreams = streamAppDesc.getOutputStreams(); this.intermediateBroadcastStreamIds = streamAppDesc.getIntermediateBroadcastStreamIds(); this.allOpSpecs = Collections.unmodifiableSet(this.findAllOperatorSpecs()); this.hasWindowOrJoins = checkWindowOrJoins(); this.serializedOpSpecGraph = opSpecGraphSerde.toBytes(this); }
public Serde<T> getSerde(String name, Config config) { return new SerializableSerde<>(); } }
serdes.addAll(tableKeySerdes.values()); serdes.addAll(tableMsgSerdes.values()); SerializableSerde<Serde> serializableSerde = new SerializableSerde<>(); Base64.Encoder base64Encoder = Base64.getEncoder(); Map<Serde, String> serdeUUIDs = new HashMap<>(); s -> serde.getClass().getSimpleName() + "-" + UUID.randomUUID().toString()); configs.putIfAbsent(String.format(SerializerConfig.SERDE_SERIALIZED_INSTANCE(), serdeName), base64Encoder.encodeToString(serializableSerde.toBytes(serde))); });
/** * Returns a deserialized {@link OperatorSpecGraph} as a copy from this instance of {@link OperatorSpecGraph} * This is used to create per-task instance of {@link OperatorSpecGraph} when instantiating task instances. * * @return a copy of this {@link OperatorSpecGraph} object via deserialization */ public OperatorSpecGraph clone() { if (opSpecGraphSerde == null) { throw new IllegalStateException("Cannot clone from an already deserialized OperatorSpecGraph."); } return opSpecGraphSerde.fromBytes(serializedOpSpecGraph); }
public OperatorSpecGraph(StreamApplicationDescriptorImpl streamAppDesc) { this.inputOperators = streamAppDesc.getInputOperators(); this.outputStreams = streamAppDesc.getOutputStreams(); this.intermediateBroadcastStreamIds = streamAppDesc.getIntermediateBroadcastStreamIds(); this.allOpSpecs = Collections.unmodifiableSet(this.findAllOperatorSpecs()); this.hasWindowOrJoins = checkWindowOrJoins(); this.serializedOpSpecGraph = opSpecGraphSerde.toBytes(this); }
serdes.addAll(tableKeySerdes.values()); serdes.addAll(tableMsgSerdes.values()); SerializableSerde<Serde> serializableSerde = new SerializableSerde<>(); Base64.Encoder base64Encoder = Base64.getEncoder(); Map<Serde, String> serdeUUIDs = new HashMap<>(); s -> serde.getClass().getSimpleName() + "-" + UUID.randomUUID().toString()); configs.putIfAbsent(String.format(SerializerConfig.SERDE_SERIALIZED_INSTANCE(), serdeName), base64Encoder.encodeToString(serializableSerde.toBytes(serde))); });
/** * Returns a deserialized {@link OperatorSpecGraph} as a copy from this instance of {@link OperatorSpecGraph} * This is used to create per-task instance of {@link OperatorSpecGraph} when instantiating task instances. * * @return a copy of this {@link OperatorSpecGraph} object via deserialization */ public OperatorSpecGraph clone() { if (opSpecGraphSerde == null) { throw new IllegalStateException("Cannot clone from an already deserialized OperatorSpecGraph."); } return opSpecGraphSerde.fromBytes(serializedOpSpecGraph); }
public OperatorSpecGraph(StreamApplicationDescriptorImpl streamAppDesc) { this.inputOperators = streamAppDesc.getInputOperators(); this.outputStreams = streamAppDesc.getOutputStreams(); this.intermediateBroadcastStreamIds = streamAppDesc.getIntermediateBroadcastStreamIds(); this.allOpSpecs = Collections.unmodifiableSet(this.findAllOperatorSpecs()); this.hasWindowOrJoins = checkWindowOrJoins(); this.serializedOpSpecGraph = opSpecGraphSerde.toBytes(this); }
serdes.addAll(tableKeySerdes.values()); serdes.addAll(tableMsgSerdes.values()); SerializableSerde<Serde> serializableSerde = new SerializableSerde<>(); Base64.Encoder base64Encoder = Base64.getEncoder(); Map<Serde, String> serdeUUIDs = new HashMap<>(); s -> serde.getClass().getSimpleName() + "-" + UUID.randomUUID().toString()); configs.putIfAbsent(String.format(SerializerConfig.SERDE_SERIALIZED_INSTANCE(), serdeName), base64Encoder.encodeToString(serializableSerde.toBytes(serde))); });