Examples of DirectoryDiff


Examples of org.apache.hadoop.hdfs.server.namenode.snapshot.INodeDirectoryWithSnapshot.DirectoryDiff

        .getINode4Write(foo.toString());
    ReadOnlyList<INode> children = fooNode.getChildrenList(null);
    assertEquals(1, children.size());
    List<DirectoryDiff> diffList = fooNode.getDiffs().asList();
    assertEquals(1, diffList.size());
    DirectoryDiff diff = diffList.get(0);
    // this diff is generated while renaming
    assertEquals(snap1, Snapshot.getSnapshotName(diff.snapshot));
    // after undo, the diff should be empty
    assertTrue(diff.getChildrenDiff().getList(ListType.DELETED).isEmpty());
    assertTrue(diff.getChildrenDiff().getList(ListType.CREATED).isEmpty());
   
    // bar was converted to filewithsnapshot while renaming
    INodeFileWithSnapshot barNode = (INodeFileWithSnapshot) fsdir
        .getINode4Write(bar.toString());
    assertSame(barNode, children.get(0));
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.snapshot.INodeDirectoryWithSnapshot.DirectoryDiff

        .getINode4Write(newbar.toString());
    assertSame(fooNode.asDirectory(), barNode.getParent());
    // bar should only have a snapshot diff for s0
    List<DirectoryDiff> barDiffList = barNode.getDiffs().asList();
    assertEquals(1, barDiffList.size());
    DirectoryDiff diff = barDiffList.get(0);
    assertEquals("s0", Snapshot.getSnapshotName(diff.snapshot));
    // and file should be stored in the deleted list of this snapshot diff
    assertEquals("file", diff.getChildrenDiff().getList(ListType.DELETED)
        .get(0).getLocalName());
   
    // check dir2: a WithName instance for foo should be in the deleted list
    // of the snapshot diff for s2
    INodeDirectoryWithSnapshot dir2Node = (INodeDirectoryWithSnapshot) fsdir
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.snapshot.INodeDirectoryWithSnapshot.DirectoryDiff

    INodeDirectoryWithSnapshot barNode = (INodeDirectoryWithSnapshot) fsdir
        .getINode(barInS0.toString());
    assertEquals(0, barNode.getChildrenList(null).size());
    List<DirectoryDiff> diffList = barNode.getDiffs().asList();
    assertEquals(1, diffList.size());
    DirectoryDiff diff = diffList.get(0);
    assertEquals(0, diff.getChildrenDiff().getList(ListType.DELETED).size());
    assertEquals(0, diff.getChildrenDiff().getList(ListType.CREATED).size());
  }
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.