@lucasvenez
I personally have never used the "org.apache.hadoop.hdfs.inotify.Event" API, However it looks like it can fulfil your requirement. As per the doc it can notify a client when a file is created/appended/closed/renamed ...etc
/**
* Events sent by the inotify system. Note that no events are necessarily sent
* when a file is opened for read (although a MetadataUpdateEvent will be sent
* if the atime is updated).
*/
@InterfaceAudience.Public
@InterfaceStability.Unstable
public abstract class Event {
public static enum EventType {
CREATE, CLOSE, APPEND, RENAME, METADATA, UNLINK
}
https://github.com/apache/hadoop/blob/release-2.7.3-RC1/hadoop-hdfs-project/hadoop-hdfs/src/main/jav...
.
Example:
https://gist.github.com/sadikovi/5f71e022e062150ecb9077a0442d16a2
.