Class FlinkOffsetBackingStore
- java.lang.Object
-
- org.apache.flink.cdc.debezium.internal.FlinkOffsetBackingStore
-
- All Implemented Interfaces:
org.apache.kafka.connect.storage.OffsetBackingStore
public class FlinkOffsetBackingStore extends Object implements org.apache.kafka.connect.storage.OffsetBackingStore
A implementation ofOffsetBackingStorebacked on Flink's state mechanism.The
OFFSET_STATE_VALUEin theWorkerConfigis the raw position and offset data in JSON format. It is set into the config when recovery from failover byDebeziumSourceFunctionbefore startup theDebeziumEngine. If it is not a restoration, theOFFSET_STATE_VALUEis empty.DebeziumEnginerelies on theOffsetBackingStorefor failover recovery.- See Also:
DebeziumSourceFunction
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<ByteBuffer,ByteBuffer>dataprotected ExecutorServiceexecutorstatic intFLUSH_TIMEOUT_SECONDSstatic StringOFFSET_STATE_VALUE
-
Constructor Summary
Constructors Constructor Description FlinkOffsetBackingStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigure(org.apache.kafka.connect.runtime.WorkerConfig config)Future<Map<ByteBuffer,ByteBuffer>>get(Collection<ByteBuffer> keys)Future<Void>set(Map<ByteBuffer,ByteBuffer> values, org.apache.kafka.connect.util.Callback<Void> callback)voidstart()voidstop()
-
-
-
Field Detail
-
OFFSET_STATE_VALUE
public static final String OFFSET_STATE_VALUE
- See Also:
- Constant Field Values
-
FLUSH_TIMEOUT_SECONDS
public static final int FLUSH_TIMEOUT_SECONDS
- See Also:
- Constant Field Values
-
data
protected Map<ByteBuffer,ByteBuffer> data
-
executor
protected ExecutorService executor
-
-
Method Detail
-
configure
public void configure(org.apache.kafka.connect.runtime.WorkerConfig config)
- Specified by:
configurein interfaceorg.apache.kafka.connect.storage.OffsetBackingStore
-
start
public void start()
- Specified by:
startin interfaceorg.apache.kafka.connect.storage.OffsetBackingStore
-
stop
public void stop()
- Specified by:
stopin interfaceorg.apache.kafka.connect.storage.OffsetBackingStore
-
get
public Future<Map<ByteBuffer,ByteBuffer>> get(Collection<ByteBuffer> keys)
- Specified by:
getin interfaceorg.apache.kafka.connect.storage.OffsetBackingStore
-
set
public Future<Void> set(Map<ByteBuffer,ByteBuffer> values, org.apache.kafka.connect.util.Callback<Void> callback)
- Specified by:
setin interfaceorg.apache.kafka.connect.storage.OffsetBackingStore
-
-