Created 03-27-2017 06:14 AM
Hi Guys, I am writing a hdfs hook works with the apache atlas, but the atlas hdfs_path type requires the name of the hdfs file, I am currently working with the inotify api but cannot find a way to capture the name of the created file, do you guys have any idea about this?
Created 03-27-2017 01:36 PM
Not sure if I got your question right,
the CreateEvent will contain the HDFS path. The name of the file is part of the HDFS path (comes after the last '/'). I hope this answers your question.
see the inotify patch here, https://issues.apache.org/jira/secure/attachment/12665452/HDFS-6634.9.patch#file-8
/**
* Sent when a new file is created (including overwrite).
*/
public static class CreateEvent extends Event {
public static enum INodeType {
FILE, DIRECTORY, SYMLINK;
}
private INodeType iNodeType;
private String path;
private long ctime;
private int replication;
private String ownerName;
private String groupName;
private FsPermission perms;
private String symlinkTarget;
Created 03-27-2017 01:36 PM
Not sure if I got your question right,
the CreateEvent will contain the HDFS path. The name of the file is part of the HDFS path (comes after the last '/'). I hope this answers your question.
see the inotify patch here, https://issues.apache.org/jira/secure/attachment/12665452/HDFS-6634.9.patch#file-8
/**
* Sent when a new file is created (including overwrite).
*/
public static class CreateEvent extends Event {
public static enum INodeType {
FILE, DIRECTORY, SYMLINK;
}
private INodeType iNodeType;
private String path;
private long ctime;
private int replication;
private String ownerName;
private String groupName;
private FsPermission perms;
private String symlinkTarget;
Created 03-29-2017 02:39 AM
Thanks for your reply, I just realize this is a stupid question lol