DBZ-234 Support try with resource for engine
This commit is contained in:
parent
be77831e7d
commit
f203af29de
@ -5,6 +5,7 @@
|
||||
*/
|
||||
package io.debezium.engine;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.time.Clock;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@ -39,7 +40,7 @@
|
||||
* @author Randall Hauch
|
||||
*/
|
||||
@Incubating
|
||||
public interface DebeziumEngine<R> extends Runnable {
|
||||
public interface DebeziumEngine<R> extends Runnable, Closeable {
|
||||
|
||||
public static final String OFFSET_FLUSH_INTERVAL_MS_PROP = "offset.flush.interval.ms";
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
*/
|
||||
package io.debezium.embedded;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.Duration;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -948,6 +949,11 @@ public boolean stop() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
stop();
|
||||
}
|
||||
|
||||
/**
|
||||
* Wait for the connector to complete processing. If the processor is not running, this method returns immediately; however,
|
||||
* if the processor is {@link #stop() stopped} and restarted before this method is called, this method will return only
|
||||
@ -988,5 +994,4 @@ protected EmbeddedConfig(Map<String, String> props) {
|
||||
super(CONFIG, props);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user