You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Wellington Chevreuil (JIRA)" <ji...@apache.org> on 2017/08/01 14:28:00 UTC

[jira] [Comment Edited] (HDFS-12117) HttpFS does not seem to support SNAPSHOT related methods for WebHDFS REST Interface

    [ https://issues.apache.org/jira/browse/HDFS-12117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16107902#comment-16107902 ] 

Wellington Chevreuil edited comment on HDFS-12117 at 8/1/17 2:27 PM:
---------------------------------------------------------------------

Thanks for the suggestions [~jojochuang]! Attaching a new patch with the Client side tests added as suggested.

While implementing these, I noticed that *LocalFileSystem* currently has no support for snapshot related methods. I'm not sure if that's intended to be that way, but I guess it does not make much sense add this feature for *LocalFileSystem*, as it's mostly a testing/dev file system option.

*TestHttpFSFileSystemLocalFileSystem* would fail when trying to run snapshot related methods defined on *BaseTestHttpFSWith*, so for now, these tests would only really run if *FileSystem* implementation is different from *LocalFileSystem*.

For example, rename snapshot test:

{noformat}
  private void testRenameSnapshot() throws Exception {
    if (!this.isLocalFS()) {
      Path snapshottablePath = new Path("/tmp/tmp-snap-test");
      createSnapshotTestsPreconditions(snapshottablePath);
      //Now get the FileSystem instance that's being tested
      FileSystem fs = this.getHttpFSFileSystem();
      fs.createSnapshot(snapshottablePath, "snap-to-rename");
      fs.renameSnapshot(snapshottablePath, "snap-to-rename",
          "snap-new-name");
      Path snapshotsDir = new Path("/tmp/tmp-snap-test/.snapshot");
      FileStatus[] snapshotItems = fs.listStatus(snapshotsDir);
      assertTrue("Should have exactly one snapshot.",
          snapshotItems.length == 1);
      String resultingSnapName = snapshotItems[0].getPath().getName();
      assertTrue("Snapshot name is not same as passed name.",
          "snap-new-name".equals(resultingSnapName));
      cleanSnapshotTests(snapshottablePath, resultingSnapName);
    }
  }
{noformat}


was (Author: wchevreuil):
Thanks for the suggestions [~jojochuang]! Attaching a new patch with the Client side tests added as suggested.

While implementing these, I noticed that *LocalFileSystem* currently has no support for snapshot related methods. I'm not sure if that's intended to be that way, or should we add support for this as well? 

*TestHttpFSFileSystemLocalFileSystem* would fail when trying to run snapshot related methods defined on *BaseTestHttpFSWith*, so for now, these tests would only really run if *FileSystem* implementation is different from *LocalFileSystem*.

For example, rename snapshot test:

{noformat}
  private void testRenameSnapshot() throws Exception {
    if (!this.isLocalFS()) {
      Path snapshottablePath = new Path("/tmp/tmp-snap-test");
      createSnapshotTestsPreconditions(snapshottablePath);
      //Now get the FileSystem instance that's being tested
      FileSystem fs = this.getHttpFSFileSystem();
      fs.createSnapshot(snapshottablePath, "snap-to-rename");
      fs.renameSnapshot(snapshottablePath, "snap-to-rename",
          "snap-new-name");
      Path snapshotsDir = new Path("/tmp/tmp-snap-test/.snapshot");
      FileStatus[] snapshotItems = fs.listStatus(snapshotsDir);
      assertTrue("Should have exactly one snapshot.",
          snapshotItems.length == 1);
      String resultingSnapName = snapshotItems[0].getPath().getName();
      assertTrue("Snapshot name is not same as passed name.",
          "snap-new-name".equals(resultingSnapName));
      cleanSnapshotTests(snapshottablePath, resultingSnapName);
    }
  }
{noformat}

> HttpFS does not seem to support SNAPSHOT related methods for WebHDFS REST Interface
> -----------------------------------------------------------------------------------
>
>                 Key: HDFS-12117
>                 URL: https://issues.apache.org/jira/browse/HDFS-12117
>             Project: Hadoop HDFS
>          Issue Type: New Feature
>          Components: httpfs
>    Affects Versions: 3.0.0-alpha3
>            Reporter: Wellington Chevreuil
>            Assignee: Wellington Chevreuil
>         Attachments: HDFS-12117.003.patch, HDFS-12117.004.patch, HDFS-12117.005.patch, HDFS-12117.006.patch, HDFS-12117.patch.01, HDFS-12117.patch.02
>
>
> Currently, HttpFS is lacking implementation for SNAPSHOT related methods from WebHDFS REST interface as defined by WebHDFS documentation [WebHDFS documentation|https://archive.cloudera.com/cdh5/cdh/5/hadoop/hadoop-project-dist/hadoop-hdfs/WebHDFS.html#Snapshot_Operations]
> I would like to work on this implementation, following the existing design approach already implemented by other WebHDFS methods on current HttpFS project, so I'll be proposing an initial patch soon for reviews.
>  



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org