public class PathAlterationObserver extends Object
| Constructor and Description |
|---|
PathAlterationObserver(FileStatusEntry rootEntry,
org.apache.hadoop.fs.PathFilter pathFilter)
The comparison between path is always case-sensitive in this general file system context.
|
PathAlterationObserver(org.apache.hadoop.fs.Path directory)
Construct an observer for the specified directory.
|
PathAlterationObserver(org.apache.hadoop.fs.Path directory,
org.apache.hadoop.fs.PathFilter pathFilter)
Construct an observer for the specified directory and file filter.
|
PathAlterationObserver(String directoryName)
Construct an observer for the specified directory.
|
PathAlterationObserver(String directoryName,
org.apache.hadoop.fs.PathFilter pathFilter)
Construct an observer for the specified directory and file filter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(PathAlterationListener listener)
Add a file system listener.
|
void |
checkAndNotify()
Check whether the file and its chlidren have been created, modified or deleted.
|
void |
destroy()
Final processing.
|
Iterable<PathAlterationListener> |
getListeners()
Returns the set of registered file system listeners.
|
void |
initialize()
Initialize the observer.
|
void |
removeListener(PathAlterationListener listener)
Remove a file system listener.
|
public PathAlterationObserver(String directoryName) throws IOException
directoryName - the name of the directory to observeIOExceptionpublic PathAlterationObserver(String directoryName, org.apache.hadoop.fs.PathFilter pathFilter) throws IOException
directoryName - the name of the directory to observepathFilter - The file filter or null if noneIOExceptionpublic PathAlterationObserver(org.apache.hadoop.fs.Path directory)
throws IOException
directory - the directory to observeIOExceptionpublic PathAlterationObserver(org.apache.hadoop.fs.Path directory,
org.apache.hadoop.fs.PathFilter pathFilter)
throws IOException
directory - the directory to observepathFilter - The file filter or null if noneIOExceptionpublic PathAlterationObserver(FileStatusEntry rootEntry, org.apache.hadoop.fs.PathFilter pathFilter) throws IOException
IOExceptionpublic void destroy()
public void addListener(PathAlterationListener listener)
listener - The file system listenerpublic void removeListener(PathAlterationListener listener)
listener - The file system listenerpublic Iterable<PathAlterationListener> getListeners()
public void initialize()
throws IOException
IOException - if an error occurspublic void checkAndNotify()
throws IOException
IOException