Examples of createSnapshot()


Examples of org.apache.hadoop.fs.FileSystem.createSnapshot()

      final Path foo = new Path("/foo");
      dfs.mkdirs(foo);
      dfs.allowSnapshot(foo);

      webHdfs.createSnapshot(foo, "s1");
      final Path spath = webHdfs.createSnapshot(foo, null);
      Assert.assertTrue(webHdfs.exists(spath));
      final Path s1path = SnapshotTestHelper.getSnapshotRoot(foo, "s1");
      Assert.assertTrue(webHdfs.exists(s1path));
View Full Code Here

Examples of org.apache.hadoop.fs.FileSystem.createSnapshot()

      final Path foo = new Path("/foo");
      dfs.mkdirs(foo);
      dfs.allowSnapshot(foo);

      webHdfs.createSnapshot(foo, "s1");
      final Path spath = webHdfs.createSnapshot(foo, null);
      Assert.assertTrue(webHdfs.exists(spath));
      final Path s1path = SnapshotTestHelper.getSnapshotRoot(foo, "s1");
      Assert.assertTrue(webHdfs.exists(s1path));

      // delete the two snapshots
View Full Code Here

Examples of org.apache.hadoop.fs.FileSystem.createSnapshot()

      final Path foo = new Path("/foo");
      dfs.mkdirs(foo);
      dfs.allowSnapshot(foo);

      webHdfs.createSnapshot(foo, "s1");
      final Path s1path = SnapshotTestHelper.getSnapshotRoot(foo, "s1");
      Assert.assertTrue(webHdfs.exists(s1path));

      // rename s1 to s2
      webHdfs.renameSnapshot(foo, "s1", "s2");
View Full Code Here

Examples of org.apache.hadoop.hdfs.DFSClient.createSnapshot()

   
    new Thread() {
      @Override
      public void run() {
        try {
          final String snapshotPath = client.createSnapshot(dir, "s1");
          assertEquals(dirSnapshot, snapshotPath);
          LOG.info("Created snapshot " + snapshotPath);
          synchronized (TestRetryCacheWithHA.this) {
            results.put("createSnapshot", snapshotPath);
            TestRetryCacheWithHA.this.notifyAll();
View Full Code Here

Examples of org.apache.hadoop.hdfs.DistributedFileSystem.createSnapshot()

      SnapshotManager sm = cluster.getNamesystem().getSnapshotManager();
      DistributedFileSystem dfs = (DistributedFileSystem) cluster.getFileSystem();
      dfs.mkdirs(path);
      dfs.allowSnapshot(path);
      dfs.createSnapshot(path);

      MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
      ObjectName mxbeanName = new ObjectName(
          "Hadoop:service=NameNode,name=SnapshotInfo");
View Full Code Here

Examples of org.apache.hadoop.hdfs.DistributedFileSystem.createSnapshot()

      final String fileName = "/srcdat";
      DistributedFileSystem hdfs = cluster.getFileSystem();
      Path file1 = new Path(fileName);
      DFSTestUtil.createFile(hdfs, file1, 1024, (short) 1, 1000L);
      hdfs.allowSnapshot(new Path("/"));
      hdfs.createSnapshot(new Path("/"), "mySnapShot");
      runFsck = runFsck(conf, 0, true, "/", "-includeSnapshots", "-files");
      assertTrue(runFsck.contains("/.snapshot/mySnapShot/srcdat"));
      runFsck = runFsck(conf, 0, true, "/", "-files");
      assertFalse(runFsck.contains("mySnapShot"));
    } finally {
View Full Code Here

Examples of org.apache.hadoop.hdfs.DistributedFileSystem.createSnapshot()

    // OP_DISALLOW_SNAPSHOT 30
    dfs.disallowSnapshot(pathDirectoryMkdir);
    // OP_CREATE_SNAPSHOT 26
    String ssName = "snapshot1";
    dfs.allowSnapshot(pathDirectoryMkdir);
    dfs.createSnapshot(pathDirectoryMkdir, ssName);
    // OP_RENAME_SNAPSHOT 28
    String ssNewName = "snapshot2";
    dfs.renameSnapshot(pathDirectoryMkdir, ssName, ssNewName);
    // OP_DELETE_SNAPSHOT 27
    dfs.deleteSnapshot(pathDirectoryMkdir, ssNewName);
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.SnapshotNode.createSnapshot()

   
    // Move foo to waiting room.
    assertTrue(wr.moveToWaitingRoom(foo));
   
    // Create snapshot
    ssNode.createSnapshot("first", false); // contains nothing

    // Create bar (V1)
    stream = fs.create(bar);
    stream.write(0);
    stream.close();
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.NamenodeProtocols.createSnapshot()

    case REMOVEXATTR: {
      np.removeXAttr(fullpath, XAttrHelper.buildXAttr(xattrName.getXAttrName()));
      return Response.ok().type(MediaType.APPLICATION_OCTET_STREAM).build();
    }
    case CREATESNAPSHOT: {
      String snapshotPath = np.createSnapshot(fullpath, snapshotName.getValue());
      final String js = JsonUtil.toJsonString(
          org.apache.hadoop.fs.Path.class.getSimpleName(), snapshotPath);
      return Response.ok(js).type(MediaType.APPLICATION_JSON).build();
    }
    case RENAMESNAPSHOT: {
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.SnapshotProtocol.createSnapshot()

    out.close();
    out = dfs.create(woot); // under construction
    out.writeByte(0);
    out.sync();

    ssProtocol.createSnapshot("test", true);
    out.close();

    LocatedBlocks[] blocksArr = ssProtocol.getLocatedBlocks("test", "/bar/foo");
    assertTrue(blocksArr.length == 1); // 1 file
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.