Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
Classes | |
interface | FileChangeListener |
Public Member Functions | |
FileWatchService (File file, FileChangeListener listener) | |
void | setCheckIntervalMs (long checkIntervalMs) |
synchronized void | start () |
synchronized void | stop () |
Static Package Attributes | |
static final Logger | LOG = LoggerFactory.getLogger(FileWatchService.class) |
static final long | DEFAULT_CHECK_INTERVAL_MS = 10 * 1000 |
Private Member Functions | |
void | checkFile () |
Private Attributes | |
long | checkIntervalMs_ = DEFAULT_CHECK_INTERVAL_MS |
ScheduledFuture<?> | fileCheckFuture_ |
final AtomicBoolean | running_ |
final FileChangeListener | changeListener_ |
final File | file_ |
boolean | alreadyWarned_ |
long | prevChange_ |
Service to watch a file for changes. A thread periodically checks the file modification time and uses the provided FileChangeListener to notify a consumer.
Definition at line 36 of file FileWatchService.java.
|
inline |
Definition at line 65 of file FileWatchService.java.
References com.cloudera.impala.util.FileWatchService.alreadyWarned_, com.cloudera.impala.util.FileWatchService.changeListener_, com.cloudera.impala.util.FileWatchService.file_, com.cloudera.impala.util.FileWatchService.prevChange_, and com.cloudera.impala.util.FileWatchService.running_.
|
inlineprivate |
Checks if the file has changed since the last observed change and if so, notifies the listener.
Definition at line 89 of file FileWatchService.java.
References com.cloudera.impala.util.FileWatchService.alreadyWarned_, com.cloudera.impala.util.FileWatchService.file_, and com.cloudera.impala.util.FileWatchService.prevChange_.
Referenced by com.cloudera.impala.util.FileWatchService.start().
|
inline |
Set the time (in milliseconds) to wait between checking the file for changes. Only used in tests.
Definition at line 81 of file FileWatchService.java.
References com.cloudera.impala.util.FileWatchService.checkIntervalMs_.
|
inline |
Starts the thread to check for file changes. Continues checking for file changes every 'checkIntervalMs_' milliseconds until stop() is called.
Definition at line 109 of file FileWatchService.java.
References com.cloudera.impala.util.FileWatchService.checkFile(), com.cloudera.impala.util.FileWatchService.checkIntervalMs_, com.cloudera.impala.util.FileWatchService.file_, and com.cloudera.impala.util.FileWatchService.fileCheckFuture_.
|
inline |
Stops the file watching thread.
Definition at line 132 of file FileWatchService.java.
|
private |
Definition at line 51 of file FileWatchService.java.
Referenced by com.cloudera.impala.util.FileWatchService.checkFile(), and com.cloudera.impala.util.FileWatchService.FileWatchService().
|
private |
Definition at line 49 of file FileWatchService.java.
Referenced by com.cloudera.impala.util.FileWatchService.FileWatchService().
|
private |
Definition at line 43 of file FileWatchService.java.
Referenced by com.cloudera.impala.util.FileWatchService.setCheckIntervalMs(), and com.cloudera.impala.util.FileWatchService.start().
|
staticpackage |
Definition at line 40 of file FileWatchService.java.
|
private |
Definition at line 50 of file FileWatchService.java.
Referenced by com.cloudera.impala.util.FileWatchService.checkFile(), com.cloudera.impala.util.FileWatchService.FileWatchService(), and com.cloudera.impala.util.FileWatchService.start().
|
private |
Definition at line 46 of file FileWatchService.java.
Referenced by com.cloudera.impala.util.FileWatchService.start().
|
staticpackage |
Definition at line 37 of file FileWatchService.java.
|
private |
Definition at line 52 of file FileWatchService.java.
Referenced by com.cloudera.impala.util.FileWatchService.checkFile(), and com.cloudera.impala.util.FileWatchService.FileWatchService().
|
private |
Definition at line 48 of file FileWatchService.java.
Referenced by com.cloudera.impala.util.FileWatchService.FileWatchService().