{"action":"created","comment":{"url":"https://api.github.com/repos/linkedin/gobblin/pulls/comments/71616891","id":71616891,"diff_hunk":"@@ -0,0 +1,168 @@\n+package gobblin.util.filesystem;\n+\n+import com.google.common.base.Optional;\n+import java.io.IOException;\n+\n+import org.apache.hadoop.conf.Configuration;\n+import org.apache.hadoop.fs.FileStatus;\n+import org.apache.hadoop.fs.FileSystem;\n+import org.apache.hadoop.fs.Path;\n+\n+\n+public class FileStatusEntry extends FileStatus {\n+\n+  static final FileStatusEntry[] EMPTY_ENTRIES = new FileStatusEntry[0];\n+\n+  private final FileStatusEntry parent;\n+  private FileStatusEntry[] children;\n+\n+  private boolean exists;\n+\n+  public Optional<FileStatus> _fileStatus;\n+\n+  public FileStatusEntry(final Path path)\n+      throws IOException {\n+    this(null, path);\n+  }\n+\n+  public FileStatusEntry(final FileStatusEntry parent, final Path path)\n+      throws IOException {\n+    if (path == null) {\n+      throw new IllegalArgumentException(\"Path is missing\");\n+    }\n+    this.parent = parent;\n+    this._fileStatus = Optional.of(path.getFileSystem(new Configuration()).getFileStatus(path));\n+  }\n+\n+  public boolean refresh(final Path path)\n+      throws IOException {\n+\n+    // cache original values\n+    final boolean origExists = exists;\n+    if (_fileStatus.isPresent()) {\n+      FileStatus oldStatus = _fileStatus.get();\n+      Configuration conf = new Configuration();\n+\n+      try (FileSystem fileSystem = path.getFileSystem(conf)) {\n+\n+        // refresh the values\n+        exists = fileSystem.exists(path);\n+        this._fileStatus = Optional.of(fileSystem.getFileStatus(path));","path":"gobblin-utility/src/main/java/gobblin/util/filesystem/FileStatusEntry.java","position":50,"original_position":50,"commit_id":"5ec3f11d98c35d2bd86d086a75835f4c6bcff856","original_commit_id":"5ec3f11d98c35d2bd86d086a75835f4c6bcff856","user":{"login":"ibuenros","id":1364112,"avatar_url":"https://avatars.githubusercontent.com/u/1364112?v=3","gravatar_id":"","url":"https://api.github.com/users/ibuenros","html_url":"https://github.com/ibuenros","followers_url":"https://api.github.com/users/ibuenros/followers","following_url":"https://api.github.com/users/ibuenros/following{/other_user}","gists_url":"https://api.github.com/users/ibuenros/gists{/gist_id}","starred_url":"https://api.github.com/users/ibuenros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibuenros/subscriptions","organizations_url":"https://api.github.com/users/ibuenros/orgs","repos_url":"https://api.github.com/users/ibuenros/repos","events_url":"https://api.github.com/users/ibuenros/events{/privacy}","received_events_url":"https://api.github.com/users/ibuenros/received_events","type":"User","site_admin":false},"body":"Use `Optional.fromNullable` instead","created_at":"2016-07-20T22:17:15Z","updated_at":"2016-07-20T22:17:15Z","html_url":"https://github.com/linkedin/gobblin/pull/1066#discussion_r71616891","pull_request_url":"https://api.github.com/repos/linkedin/gobblin/pulls/1066","_links":{"self":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/comments/71616891"},"html":{"href":"https://github.com/linkedin/gobblin/pull/1066#discussion_r71616891"},"pull_request":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/1066"}}},"pull_request":{"url":"https://api.github.com/repos/linkedin/gobblin/pulls/1066","id":74994470,"html_url":"https://github.com/linkedin/gobblin/pull/1066","diff_url":"https://github.com/linkedin/gobblin/pull/1066.diff","patch_url":"https://github.com/linkedin/gobblin/pull/1066.patch","issue_url":"https://api.github.com/repos/linkedin/gobblin/issues/1066","number":1066,"state":"open","locked":false,"title":"Config file monitor for general file system","user":{"login":"autumnust","id":5044213,"avatar_url":"https://avatars.githubusercontent.com/u/5044213?v=3","gravatar_id":"","url":"https://api.github.com/users/autumnust","html_url":"https://github.com/autumnust","followers_url":"https://api.github.com/users/autumnust/followers","following_url":"https://api.github.com/users/autumnust/following{/other_user}","gists_url":"https://api.github.com/users/autumnust/gists{/gist_id}","starred_url":"https://api.github.com/users/autumnust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/autumnust/subscriptions","organizations_url":"https://api.github.com/users/autumnust/orgs","repos_url":"https://api.github.com/users/autumnust/repos","events_url":"https://api.github.com/users/autumnust/events{/privacy}","received_events_url":"https://api.github.com/users/autumnust/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-23T17:28:19Z","updated_at":"2016-07-20T22:17:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"072dc1a9bb2fe906f10ed4aeee6197e9314613df","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/linkedin/gobblin/pulls/1066/commits","review_comments_url":"https://api.github.com/repos/linkedin/gobblin/pulls/1066/comments","review_comment_url":"https://api.github.com/repos/linkedin/gobblin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/linkedin/gobblin/issues/1066/comments","statuses_url":"https://api.github.com/repos/linkedin/gobblin/statuses/5ec3f11d98c35d2bd86d086a75835f4c6bcff856","head":{"label":"autumnust:monitor-dev","ref":"monitor-dev","sha":"5ec3f11d98c35d2bd86d086a75835f4c6bcff856","user":{"login":"autumnust","id":5044213,"avatar_url":"https://avatars.githubusercontent.com/u/5044213?v=3","gravatar_id":"","url":"https://api.github.com/users/autumnust","html_url":"https://github.com/autumnust","followers_url":"https://api.github.com/users/autumnust/followers","following_url":"https://api.github.com/users/autumnust/following{/other_user}","gists_url":"https://api.github.com/users/autumnust/gists{/gist_id}","starred_url":"https://api.github.com/users/autumnust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/autumnust/subscriptions","organizations_url":"https://api.github.com/users/autumnust/orgs","repos_url":"https://api.github.com/users/autumnust/repos","events_url":"https://api.github.com/users/autumnust/events{/privacy}","received_events_url":"https://api.github.com/users/autumnust/received_events","type":"User","site_admin":false},"repo":{"id":60211282,"name":"gobblin","full_name":"autumnust/gobblin","owner":{"login":"autumnust","id":5044213,"avatar_url":"https://avatars.githubusercontent.com/u/5044213?v=3","gravatar_id":"","url":"https://api.github.com/users/autumnust","html_url":"https://github.com/autumnust","followers_url":"https://api.github.com/users/autumnust/followers","following_url":"https://api.github.com/users/autumnust/following{/other_user}","gists_url":"https://api.github.com/users/autumnust/gists{/gist_id}","starred_url":"https://api.github.com/users/autumnust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/autumnust/subscriptions","organizations_url":"https://api.github.com/users/autumnust/orgs","repos_url":"https://api.github.com/users/autumnust/repos","events_url":"https://api.github.com/users/autumnust/events{/privacy}","received_events_url":"https://api.github.com/users/autumnust/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/autumnust/gobblin","description":"Universal data ingestion framework for Hadoop.","fork":true,"url":"https://api.github.com/repos/autumnust/gobblin","forks_url":"https://api.github.com/repos/autumnust/gobblin/forks","keys_url":"https://api.github.com/repos/autumnust/gobblin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/autumnust/gobblin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/autumnust/gobblin/teams","hooks_url":"https://api.github.com/repos/autumnust/gobblin/hooks","issue_events_url":"https://api.github.com/repos/autumnust/gobblin/issues/events{/number}","events_url":"https://api.github.com/repos/autumnust/gobblin/events","assignees_url":"https://api.github.com/repos/autumnust/gobblin/assignees{/user}","branches_url":"https://api.github.com/repos/autumnust/gobblin/branches{/branch}","tags_url":"https://api.github.com/repos/autumnust/gobblin/tags","blobs_url":"https://api.github.com/repos/autumnust/gobblin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/autumnust/gobblin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/autumnust/gobblin/git/refs{/sha}","trees_url":"https://api.github.com/repos/autumnust/gobblin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/autumnust/gobblin/statuses/{sha}","languages_url":"https://api.github.com/repos/autumnust/gobblin/languages","stargazers_url":"https://api.github.com/repos/autumnust/gobblin/stargazers","contributors_url":"https://api.github.com/repos/autumnust/gobblin/contributors","subscribers_url":"https://api.github.com/repos/autumnust/gobblin/subscribers","subscription_url":"https://api.github.com/repos/autumnust/gobblin/subscription","commits_url":"https://api.github.com/repos/autumnust/gobblin/commits{/sha}","git_commits_url":"https://api.github.com/repos/autumnust/gobblin/git/commits{/sha}","comments_url":"https://api.github.com/repos/autumnust/gobblin/comments{/number}","issue_comment_url":"https://api.github.com/repos/autumnust/gobblin/issues/comments{/number}","contents_url":"https://api.github.com/repos/autumnust/gobblin/contents/{+path}","compare_url":"https://api.github.com/repos/autumnust/gobblin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/autumnust/gobblin/merges","archive_url":"https://api.github.com/repos/autumnust/gobblin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/autumnust/gobblin/downloads","issues_url":"https://api.github.com/repos/autumnust/gobblin/issues{/number}","pulls_url":"https://api.github.com/repos/autumnust/gobblin/pulls{/number}","milestones_url":"https://api.github.com/repos/autumnust/gobblin/milestones{/number}","notifications_url":"https://api.github.com/repos/autumnust/gobblin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/autumnust/gobblin/labels{/name}","releases_url":"https://api.github.com/repos/autumnust/gobblin/releases{/id}","deployments_url":"https://api.github.com/repos/autumnust/gobblin/deployments","created_at":"2016-06-01T21:14:50Z","updated_at":"2016-06-01T21:14:55Z","pushed_at":"2016-07-20T07:53:21Z","git_url":"git://github.com/autumnust/gobblin.git","ssh_url":"git@github.com:autumnust/gobblin.git","clone_url":"https://github.com/autumnust/gobblin.git","svn_url":"https://github.com/autumnust/gobblin","homepage":"https://github.com/linkedin/gobblin/wiki","size":93469,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"linkedin:master","ref":"master","sha":"3b6a8b1e42115ad787787e89b4aed55891fa2ee8","user":{"login":"linkedin","id":357098,"avatar_url":"https://avatars.githubusercontent.com/u/357098?v=3","gravatar_id":"","url":"https://api.github.com/users/linkedin","html_url":"https://github.com/linkedin","followers_url":"https://api.github.com/users/linkedin/followers","following_url":"https://api.github.com/users/linkedin/following{/other_user}","gists_url":"https://api.github.com/users/linkedin/gists{/gist_id}","starred_url":"https://api.github.com/users/linkedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linkedin/subscriptions","organizations_url":"https://api.github.com/users/linkedin/orgs","repos_url":"https://api.github.com/users/linkedin/repos","events_url":"https://api.github.com/users/linkedin/events{/privacy}","received_events_url":"https://api.github.com/users/linkedin/received_events","type":"Organization","site_admin":false},"repo":{"id":27392543,"name":"gobblin","full_name":"linkedin/gobblin","owner":{"login":"linkedin","id":357098,"avatar_url":"https://avatars.githubusercontent.com/u/357098?v=3","gravatar_id":"","url":"https://api.github.com/users/linkedin","html_url":"https://github.com/linkedin","followers_url":"https://api.github.com/users/linkedin/followers","following_url":"https://api.github.com/users/linkedin/following{/other_user}","gists_url":"https://api.github.com/users/linkedin/gists{/gist_id}","starred_url":"https://api.github.com/users/linkedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linkedin/subscriptions","organizations_url":"https://api.github.com/users/linkedin/orgs","repos_url":"https://api.github.com/users/linkedin/repos","events_url":"https://api.github.com/users/linkedin/events{/privacy}","received_events_url":"https://api.github.com/users/linkedin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/linkedin/gobblin","description":"Universal data ingestion framework for Hadoop.","fork":false,"url":"https://api.github.com/repos/linkedin/gobblin","forks_url":"https://api.github.com/repos/linkedin/gobblin/forks","keys_url":"https://api.github.com/repos/linkedin/gobblin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/linkedin/gobblin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/linkedin/gobblin/teams","hooks_url":"https://api.github.com/repos/linkedin/gobblin/hooks","issue_events_url":"https://api.github.com/repos/linkedin/gobblin/issues/events{/number}","events_url":"https://api.github.com/repos/linkedin/gobblin/events","assignees_url":"https://api.github.com/repos/linkedin/gobblin/assignees{/user}","branches_url":"https://api.github.com/repos/linkedin/gobblin/branches{/branch}","tags_url":"https://api.github.com/repos/linkedin/gobblin/tags","blobs_url":"https://api.github.com/repos/linkedin/gobblin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/linkedin/gobblin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/linkedin/gobblin/git/refs{/sha}","trees_url":"https://api.github.com/repos/linkedin/gobblin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/linkedin/gobblin/statuses/{sha}","languages_url":"https://api.github.com/repos/linkedin/gobblin/languages","stargazers_url":"https://api.github.com/repos/linkedin/gobblin/stargazers","contributors_url":"https://api.github.com/repos/linkedin/gobblin/contributors","subscribers_url":"https://api.github.com/repos/linkedin/gobblin/subscribers","subscription_url":"https://api.github.com/repos/linkedin/gobblin/subscription","commits_url":"https://api.github.com/repos/linkedin/gobblin/commits{/sha}","git_commits_url":"https://api.github.com/repos/linkedin/gobblin/git/commits{/sha}","comments_url":"https://api.github.com/repos/linkedin/gobblin/comments{/number}","issue_comment_url":"https://api.github.com/repos/linkedin/gobblin/issues/comments{/number}","contents_url":"https://api.github.com/repos/linkedin/gobblin/contents/{+path}","compare_url":"https://api.github.com/repos/linkedin/gobblin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/linkedin/gobblin/merges","archive_url":"https://api.github.com/repos/linkedin/gobblin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/linkedin/gobblin/downloads","issues_url":"https://api.github.com/repos/linkedin/gobblin/issues{/number}","pulls_url":"https://api.github.com/repos/linkedin/gobblin/pulls{/number}","milestones_url":"https://api.github.com/repos/linkedin/gobblin/milestones{/number}","notifications_url":"https://api.github.com/repos/linkedin/gobblin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/linkedin/gobblin/labels{/name}","releases_url":"https://api.github.com/repos/linkedin/gobblin/releases{/id}","deployments_url":"https://api.github.com/repos/linkedin/gobblin/deployments","created_at":"2014-12-01T18:10:50Z","updated_at":"2016-07-20T15:11:21Z","pushed_at":"2016-07-20T22:06:23Z","git_url":"git://github.com/linkedin/gobblin.git","ssh_url":"git@github.com:linkedin/gobblin.git","clone_url":"https://github.com/linkedin/gobblin.git","svn_url":"https://github.com/linkedin/gobblin","homepage":"https://github.com/linkedin/gobblin/wiki","size":175676,"stargazers_count":642,"watchers_count":642,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":261,"mirror_url":null,"open_issues_count":106,"forks":261,"open_issues":106,"watchers":642,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/1066"},"html":{"href":"https://github.com/linkedin/gobblin/pull/1066"},"issue":{"href":"https://api.github.com/repos/linkedin/gobblin/issues/1066"},"comments":{"href":"https://api.github.com/repos/linkedin/gobblin/issues/1066/comments"},"review_comments":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/1066/comments"},"review_comment":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/1066/commits"},"statuses":{"href":"https://api.github.com/repos/linkedin/gobblin/statuses/5ec3f11d98c35d2bd86d086a75835f4c6bcff856"}}}}
{"actor":{"display_login":"ibuenros"}}