Package io.debezium.connector.cassandra
Class AbstractDirectoryWatcher
- java.lang.Object
-
- io.debezium.connector.cassandra.AbstractDirectoryWatcher
-
public abstract class AbstractDirectoryWatcher extends Object
Wrapper class around WatchService to make WatchService re-usable and avoid code repetition
-
-
Field Summary
Fields Modifier and Type Field Description private Pathdirectoryprivate Set<WatchEvent.Kind>kindsprivate static org.slf4j.LoggerLOGGERprivate DurationpollIntervalprivate WatchServicewatchService
-
Constructor Summary
Constructors Constructor Description AbstractDirectoryWatcher(Path directory, Duration pollInterval, Set<WatchEvent.Kind> kinds)AbstractDirectoryWatcher(WatchService watchService, Path directory, Duration pollInterval, Set<WatchEvent.Kind> kinds)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) abstract voidhandleEvent(WatchEvent<?> event, Path path)voidpoll()
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
watchService
private final WatchService watchService
-
pollInterval
private final Duration pollInterval
-
directory
private final Path directory
-
kinds
private final Set<WatchEvent.Kind> kinds
-
-
Constructor Detail
-
AbstractDirectoryWatcher
public AbstractDirectoryWatcher(Path directory, Duration pollInterval, Set<WatchEvent.Kind> kinds) throws IOException
- Throws:
IOException
-
AbstractDirectoryWatcher
AbstractDirectoryWatcher(WatchService watchService, Path directory, Duration pollInterval, Set<WatchEvent.Kind> kinds) throws IOException
- Throws:
IOException
-
-
Method Detail
-
poll
public void poll() throws InterruptedException, IOException- Throws:
InterruptedExceptionIOException
-
handleEvent
abstract void handleEvent(WatchEvent<?> event, Path path) throws IOException
- Throws:
IOException
-
-