| Modifier and Type | Class and Description |
|---|---|
private static class |
SynchronousFileWatcher.StateWrapper |
| Modifier and Type | Field and Description |
|---|---|
private long |
checkUpdateMillis |
private AtomicReference<SynchronousFileWatcher.StateWrapper> |
lastState |
private UpdateMonitor |
monitor |
private Path |
path |
private Lock |
resourceLock |
| Constructor and Description |
|---|
SynchronousFileWatcher(Path path,
UpdateMonitor monitor) |
SynchronousFileWatcher(Path path,
UpdateMonitor monitor,
long checkMillis) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkAndReset()
Checks if the file has been updated according to the configured
UpdateMonitor and resets the state |
private boolean |
checkForUpdate() |
private final Path path
private final long checkUpdateMillis
private final UpdateMonitor monitor
private final AtomicReference<SynchronousFileWatcher.StateWrapper> lastState
private final Lock resourceLock
public SynchronousFileWatcher(Path path, UpdateMonitor monitor)
public SynchronousFileWatcher(Path path, UpdateMonitor monitor, long checkMillis)
public boolean checkAndReset()
throws IOException
UpdateMonitor and resets the stateIOException - if failure occurs checking for changesprivate boolean checkForUpdate()
throws IOException
IOExceptionCopyright © 2019 Apache NiFi Project. All rights reserved.