co.decodable.sdk.pipeline.internal.DecodableStreamSinkImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of decodable-pipeline-sdk Show documentation
Show all versions of decodable-pipeline-sdk Show documentation
A software development kit for implementing Apache Flink jobs and running them on Decodable
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright Decodable, Inc.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package co.decodable.sdk.pipeline.internal;
import co.decodable.sdk.pipeline.DecodableStreamSink;
import co.decodable.sdk.pipeline.DecodableWriter;
import java.io.IOException;
import java.util.Collection;
import org.apache.flink.api.connector.sink2.Committer;
import org.apache.flink.api.connector.sink2.StatefulSink;
import org.apache.flink.api.connector.sink2.TwoPhaseCommittingSink;
import org.apache.flink.connector.kafka.sink.KafkaSink;
import org.apache.flink.core.io.SimpleVersionedSerializer;
@SuppressWarnings({"rawtypes", "unchecked"})
public class DecodableStreamSinkImpl implements DecodableStreamSink {
private static final long serialVersionUID = 3654512984006560177L;
// Can't use KafkaSink, as it exposes non-public types in its signatures
private final StatefulSink delegate;
public DecodableStreamSinkImpl(KafkaSink delegate) {
this.delegate = delegate;
}
@Override
public DecodableWriter createWriter(InitContext context) throws IOException {
return new DelegatingStatefulSinkWriter(delegate.createWriter(context));
}
@Override
public StatefulSinkWriter restoreWriter(
InitContext context, Collection
© 2015 - 2025 Weber Informatics LLC | Privacy Policy