{"action":"created","comment":{"url":"https://api.github.com/repos/apache/incubator-reef/pulls/comments/41340293","id":41340293,"diff_hunk":"@@ -0,0 +1,157 @@\n+﻿/**\n+ * Licensed to the Apache Software Foundation (ASF) under one\n+ * or more contributor license agreements.  See the NOTICE file\n+ * distributed with this work for additional information\n+ * regarding copyright ownership.  The ASF licenses this file\n+ * to you under the Apache License, Version 2.0 (the\n+ * \"License\"); you may not use this file except in compliance\n+ * with the License.  You may obtain a copy of the License at\n+ *\n+ *   http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing,\n+ * software distributed under the License is distributed on an\n+ * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+ * KIND, either express or implied.  See the License for the\n+ * specific language governing permissions and limitations\n+ * under the License.\n+ */\n+\n+using System;\n+using System.IO;\n+using Org.Apache.REEF.IO.FileSystem;\n+using Org.Apache.REEF.IO.FileSystem.Hadoop;\n+using Org.Apache.REEF.Tang.Implementations.Tang;\n+\n+namespace Org.Apache.REEF.IO.TestClient\n+{\n+    class HadoopFileSystemTest\n+    {\n+        public IFileSystem _fileSystem;\n+\n+        internal HadoopFileSystemTest()\n+        {\n+            _fileSystem = \n+                TangFactory.GetTang()\n+                .NewInjector(HadoopFileSystemConfiguration.ConfigurationModule.Build())\n+                .GetInstance<IFileSystem>();\n+        }\n+\n+        private Uri GetTempUri()\n+        {\n+            return\n+                new Uri(_fileSystem.UriPrefix + \"vol1/test/TestHadoopFileSystem-\" +\n+                        DateTime.Now.ToString(\"yyyyMMddHHmmssfff\"));\n+        }\n+\n+        internal void TestCopyFromLocalAndBack()\n+        {\n+            var localFile = MakeLocalBanaryFile();\n+            Console.WriteLine(\"localFile: \" + localFile);\n+\n+            var localFileDownloaded = localFile + \".2\";\n+            Console.WriteLine(\"localFileDownloaded: \" + localFileDownloaded);\n+\n+            var remoteUri = GetTempUri();\n+            Console.WriteLine(\"remoteUri: \" + remoteUri);\n+\n+            _fileSystem.CopyFromLocal(localFile, remoteUri);\n+            Console.WriteLine(\"File CopyFromLocal!\");\n+\n+            _fileSystem.CopyToLocal(remoteUri, localFileDownloaded);\n+            Console.WriteLine(\"File CopyToLocal!\");\n+\n+            if (!File.Exists(localFileDownloaded))\n+            {\n+                Console.WriteLine(\"File does not exist!\");\n+            }\n+            else\n+            {\n+                Console.WriteLine(\"File copied! - \" + localFile);\n+            }\n+\n+            ReadFileTest(localFileDownloaded);\n+\n+            Console.WriteLine(\"End of TestCopyFromLocalAndBack2!\");\n+\n+            _fileSystem.Delete(remoteUri);\n+            File.Delete(localFile);\n+            File.Delete(localFileDownloaded);\n+        }\n+\n+        internal void TestCopyFromRemote()\n+        {\n+            //var remoteUri = new Uri(_fileSystem.GetUriPrefix() + \"vol1/public/libraries/Scope/Data/Ads/1Month/stat.txt\");\n+            //var remoteUri = new Uri(_fileSystem.UriPrefix + \"vol1/public/libraries/Scope/Data/Ads/1Month/test20150925145717050.txt\");\n+            var remoteUri = new Uri(_fileSystem.UriPrefix + \"vol1/test/TestHadoopFilePartition-20151002160654404\");\n+            \n+            Console.WriteLine(\"remoteUri: \" + remoteUri);","path":"lang/cs/Org.Apache.REEF.IO.TestClient/HadoopFileSystemTest.cs","position":88,"original_position":88,"commit_id":"51850212767a5d04f4397afb19a0457b8dbfe501","original_commit_id":"51850212767a5d04f4397afb19a0457b8dbfe501","user":{"login":"jwang98052","id":5666504,"avatar_url":"https://avatars.githubusercontent.com/u/5666504?v=3","gravatar_id":"","url":"https://api.github.com/users/jwang98052","html_url":"https://github.com/jwang98052","followers_url":"https://api.github.com/users/jwang98052/followers","following_url":"https://api.github.com/users/jwang98052/following{/other_user}","gists_url":"https://api.github.com/users/jwang98052/gists{/gist_id}","starred_url":"https://api.github.com/users/jwang98052/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwang98052/subscriptions","organizations_url":"https://api.github.com/users/jwang98052/orgs","repos_url":"https://api.github.com/users/jwang98052/repos","events_url":"https://api.github.com/users/jwang98052/events{/privacy}","received_events_url":"https://api.github.com/users/jwang98052/received_events","type":"User","site_admin":false},"body":"Done","created_at":"2015-10-07T00:33:59Z","updated_at":"2015-10-07T00:33:59Z","html_url":"https://github.com/apache/incubator-reef/pull/536#discussion_r41340293","pull_request_url":"https://api.github.com/repos/apache/incubator-reef/pulls/536","_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-reef/pulls/comments/41340293"},"html":{"href":"https://github.com/apache/incubator-reef/pull/536#discussion_r41340293"},"pull_request":{"href":"https://api.github.com/repos/apache/incubator-reef/pulls/536"}}},"pull_request":{"url":"https://api.github.com/repos/apache/incubator-reef/pulls/536","id":46667826,"html_url":"https://github.com/apache/incubator-reef/pull/536","diff_url":"https://github.com/apache/incubator-reef/pull/536.diff","patch_url":"https://github.com/apache/incubator-reef/pull/536.patch","issue_url":"https://api.github.com/repos/apache/incubator-reef/issues/536","number":536,"state":"open","locked":false,"title":"[REEF-538] Implement IPartitionedDataSet on IFileSystem","user":{"login":"jwang98052","id":5666504,"avatar_url":"https://avatars.githubusercontent.com/u/5666504?v=3","gravatar_id":"","url":"https://api.github.com/users/jwang98052","html_url":"https://github.com/jwang98052","followers_url":"https://api.github.com/users/jwang98052/followers","following_url":"https://api.github.com/users/jwang98052/following{/other_user}","gists_url":"https://api.github.com/users/jwang98052/gists{/gist_id}","starred_url":"https://api.github.com/users/jwang98052/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwang98052/subscriptions","organizations_url":"https://api.github.com/users/jwang98052/orgs","repos_url":"https://api.github.com/users/jwang98052/repos","events_url":"https://api.github.com/users/jwang98052/events{/privacy}","received_events_url":"https://api.github.com/users/jwang98052/received_events","type":"User","site_admin":false},"body":"Add implementation of IPartitionedDataSet  and IPartition for FileSystem\r\nAdded FIleSerailiser interface and pass it along to the Ipartition\r\nAdded unit test cases\r\nJIRA: [REEF-538](https://issues.apache.org/jira/browse/REEF-538)\r\n\r\nThis closes #","created_at":"2015-10-02T18:40:16Z","updated_at":"2015-10-07T00:33:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cae9aac51ea7d4e06d0174a9ce0adf8bee556b83","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/incubator-reef/pulls/536/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-reef/pulls/536/comments","review_comment_url":"https://api.github.com/repos/apache/incubator-reef/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/incubator-reef/issues/536/comments","statuses_url":"https://api.github.com/repos/apache/incubator-reef/statuses/51850212767a5d04f4397afb19a0457b8dbfe501","head":{"label":"jwang98052:REEF-538","ref":"REEF-538","sha":"51850212767a5d04f4397afb19a0457b8dbfe501","user":{"login":"jwang98052","id":5666504,"avatar_url":"https://avatars.githubusercontent.com/u/5666504?v=3","gravatar_id":"","url":"https://api.github.com/users/jwang98052","html_url":"https://github.com/jwang98052","followers_url":"https://api.github.com/users/jwang98052/followers","following_url":"https://api.github.com/users/jwang98052/following{/other_user}","gists_url":"https://api.github.com/users/jwang98052/gists{/gist_id}","starred_url":"https://api.github.com/users/jwang98052/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwang98052/subscriptions","organizations_url":"https://api.github.com/users/jwang98052/orgs","repos_url":"https://api.github.com/users/jwang98052/repos","events_url":"https://api.github.com/users/jwang98052/events{/privacy}","received_events_url":"https://api.github.com/users/jwang98052/received_events","type":"User","site_admin":false},"repo":{"id":25940156,"name":"incubator-reef","full_name":"jwang98052/incubator-reef","owner":{"login":"jwang98052","id":5666504,"avatar_url":"https://avatars.githubusercontent.com/u/5666504?v=3","gravatar_id":"","url":"https://api.github.com/users/jwang98052","html_url":"https://github.com/jwang98052","followers_url":"https://api.github.com/users/jwang98052/followers","following_url":"https://api.github.com/users/jwang98052/following{/other_user}","gists_url":"https://api.github.com/users/jwang98052/gists{/gist_id}","starred_url":"https://api.github.com/users/jwang98052/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwang98052/subscriptions","organizations_url":"https://api.github.com/users/jwang98052/orgs","repos_url":"https://api.github.com/users/jwang98052/repos","events_url":"https://api.github.com/users/jwang98052/events{/privacy}","received_events_url":"https://api.github.com/users/jwang98052/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jwang98052/incubator-reef","description":"Mirror of Apache REEF (Incubating)","fork":true,"url":"https://api.github.com/repos/jwang98052/incubator-reef","forks_url":"https://api.github.com/repos/jwang98052/incubator-reef/forks","keys_url":"https://api.github.com/repos/jwang98052/incubator-reef/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jwang98052/incubator-reef/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jwang98052/incubator-reef/teams","hooks_url":"https://api.github.com/repos/jwang98052/incubator-reef/hooks","issue_events_url":"https://api.github.com/repos/jwang98052/incubator-reef/issues/events{/number}","events_url":"https://api.github.com/repos/jwang98052/incubator-reef/events","assignees_url":"https://api.github.com/repos/jwang98052/incubator-reef/assignees{/user}","branches_url":"https://api.github.com/repos/jwang98052/incubator-reef/branches{/branch}","tags_url":"https://api.github.com/repos/jwang98052/incubator-reef/tags","blobs_url":"https://api.github.com/repos/jwang98052/incubator-reef/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jwang98052/incubator-reef/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jwang98052/incubator-reef/git/refs{/sha}","trees_url":"https://api.github.com/repos/jwang98052/incubator-reef/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jwang98052/incubator-reef/statuses/{sha}","languages_url":"https://api.github.com/repos/jwang98052/incubator-reef/languages","stargazers_url":"https://api.github.com/repos/jwang98052/incubator-reef/stargazers","contributors_url":"https://api.github.com/repos/jwang98052/incubator-reef/contributors","subscribers_url":"https://api.github.com/repos/jwang98052/incubator-reef/subscribers","subscription_url":"https://api.github.com/repos/jwang98052/incubator-reef/subscription","commits_url":"https://api.github.com/repos/jwang98052/incubator-reef/commits{/sha}","git_commits_url":"https://api.github.com/repos/jwang98052/incubator-reef/git/commits{/sha}","comments_url":"https://api.github.com/repos/jwang98052/incubator-reef/comments{/number}","issue_comment_url":"https://api.github.com/repos/jwang98052/incubator-reef/issues/comments{/number}","contents_url":"https://api.github.com/repos/jwang98052/incubator-reef/contents/{+path}","compare_url":"https://api.github.com/repos/jwang98052/incubator-reef/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jwang98052/incubator-reef/merges","archive_url":"https://api.github.com/repos/jwang98052/incubator-reef/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jwang98052/incubator-reef/downloads","issues_url":"https://api.github.com/repos/jwang98052/incubator-reef/issues{/number}","pulls_url":"https://api.github.com/repos/jwang98052/incubator-reef/pulls{/number}","milestones_url":"https://api.github.com/repos/jwang98052/incubator-reef/milestones{/number}","notifications_url":"https://api.github.com/repos/jwang98052/incubator-reef/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jwang98052/incubator-reef/labels{/name}","releases_url":"https://api.github.com/repos/jwang98052/incubator-reef/releases{/id}","created_at":"2014-10-29T20:32:40Z","updated_at":"2015-03-30T17:00:09Z","pushed_at":"2015-10-06T02:42:48Z","git_url":"git://github.com/jwang98052/incubator-reef.git","ssh_url":"git@github.com:jwang98052/incubator-reef.git","clone_url":"https://github.com/jwang98052/incubator-reef.git","svn_url":"https://github.com/jwang98052/incubator-reef","homepage":null,"size":33889,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"apache:master","ref":"master","sha":"fe9f50878e6f3592a375548a593c00fa1164ce71","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":25623941,"name":"incubator-reef","full_name":"apache/incubator-reef","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/incubator-reef","description":"Mirror of Apache REEF (Incubating)","fork":false,"url":"https://api.github.com/repos/apache/incubator-reef","forks_url":"https://api.github.com/repos/apache/incubator-reef/forks","keys_url":"https://api.github.com/repos/apache/incubator-reef/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-reef/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-reef/teams","hooks_url":"https://api.github.com/repos/apache/incubator-reef/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-reef/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-reef/events","assignees_url":"https://api.github.com/repos/apache/incubator-reef/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-reef/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-reef/tags","blobs_url":"https://api.github.com/repos/apache/incubator-reef/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-reef/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-reef/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-reef/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-reef/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-reef/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-reef/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-reef/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-reef/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-reef/subscription","commits_url":"https://api.github.com/repos/apache/incubator-reef/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-reef/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-reef/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-reef/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/incubator-reef/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-reef/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-reef/merges","archive_url":"https://api.github.com/repos/apache/incubator-reef/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-reef/downloads","issues_url":"https://api.github.com/repos/apache/incubator-reef/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-reef/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-reef/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-reef/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-reef/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-reef/releases{/id}","created_at":"2014-10-23T07:00:10Z","updated_at":"2015-09-14T06:39:15Z","pushed_at":"2015-10-06T23:41:14Z","git_url":"git://github.com/apache/incubator-reef.git","ssh_url":"git@github.com:apache/incubator-reef.git","clone_url":"https://github.com/apache/incubator-reef.git","svn_url":"https://github.com/apache/incubator-reef","homepage":null,"size":45019,"stargazers_count":26,"watchers_count":26,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":36,"mirror_url":"git://git.apache.org/incubator-reef.git","open_issues_count":8,"forks":36,"open_issues":8,"watchers":26,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-reef/pulls/536"},"html":{"href":"https://github.com/apache/incubator-reef/pull/536"},"issue":{"href":"https://api.github.com/repos/apache/incubator-reef/issues/536"},"comments":{"href":"https://api.github.com/repos/apache/incubator-reef/issues/536/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-reef/pulls/536/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/incubator-reef/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/incubator-reef/pulls/536/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-reef/statuses/51850212767a5d04f4397afb19a0457b8dbfe501"}}}}