|
@@ -142,8 +142,7 @@ public class TestSnapshotPathINodes {
|
|
|
@Test (timeout=15000)
|
|
|
public void testNonSnapshotPathINodes() throws Exception {
|
|
|
// Get the inodes by resolving the path of a normal file
|
|
|
- String[] names = INode.getPathNames(file1.toString());
|
|
|
- byte[][] components = INode.getPathComponents(names);
|
|
|
+ byte[][] components = INode.getPathComponents(file1.toString());
|
|
|
INodesInPath nodesInPath = INodesInPath.resolve(fsdir.rootDir, components);
|
|
|
INode[] inodes = nodesInPath.getINodes();
|
|
|
// The number of inodes should be equal to components.length
|
|
@@ -192,8 +191,7 @@ public class TestSnapshotPathINodes {
|
|
|
// The path when accessing the snapshot file of file1 is
|
|
|
// /TestSnapshot/sub1/.snapshot/s1/file1
|
|
|
String snapshotPath = sub1.toString() + "/.snapshot/s1/file1";
|
|
|
- String[] names = INode.getPathNames(snapshotPath);
|
|
|
- byte[][] components = INode.getPathComponents(names);
|
|
|
+ byte[][] components = INode.getPathComponents(snapshotPath);
|
|
|
INodesInPath nodesInPath = INodesInPath.resolve(fsdir.rootDir, components);
|
|
|
INode[] inodes = nodesInPath.getINodes();
|
|
|
// Length of inodes should be (components.length - 1), since we will ignore
|
|
@@ -228,8 +226,7 @@ public class TestSnapshotPathINodes {
|
|
|
|
|
|
// Resolve the path "/TestSnapshot/sub1/.snapshot"
|
|
|
String dotSnapshotPath = sub1.toString() + "/.snapshot";
|
|
|
- names = INode.getPathNames(dotSnapshotPath);
|
|
|
- components = INode.getPathComponents(names);
|
|
|
+ components = INode.getPathComponents(dotSnapshotPath);
|
|
|
nodesInPath = INodesInPath.resolve(fsdir.rootDir, components);
|
|
|
inodes = nodesInPath.getINodes();
|
|
|
// The number of INodes returned should be components.length - 1 since we
|
|
@@ -277,8 +274,7 @@ public class TestSnapshotPathINodes {
|
|
|
// Resolve the path for the snapshot file
|
|
|
// /TestSnapshot/sub1/.snapshot/s2/file1
|
|
|
String snapshotPath = sub1.toString() + "/.snapshot/s2/file1";
|
|
|
- String[] names = INode.getPathNames(snapshotPath);
|
|
|
- byte[][] components = INode.getPathComponents(names);
|
|
|
+ byte[][] components = INode.getPathComponents(snapshotPath);
|
|
|
INodesInPath nodesInPath = INodesInPath.resolve(fsdir.rootDir, components);
|
|
|
INode[] inodes = nodesInPath.getINodes();
|
|
|
// Length of inodes should be (components.length - 1), since we will ignore
|
|
@@ -295,8 +291,7 @@ public class TestSnapshotPathINodes {
|
|
|
}
|
|
|
|
|
|
// Check the INodes for path /TestSnapshot/sub1/file1
|
|
|
- String[] names = INode.getPathNames(file1.toString());
|
|
|
- byte[][] components = INode.getPathComponents(names);
|
|
|
+ byte[][] components = INode.getPathComponents(file1.toString());
|
|
|
INodesInPath nodesInPath = INodesInPath.resolve(fsdir.rootDir, components);
|
|
|
INode[] inodes = nodesInPath.getINodes();
|
|
|
// The length of inodes should be equal to components.length
|
|
@@ -337,8 +332,7 @@ public class TestSnapshotPathINodes {
|
|
|
{
|
|
|
// Check the inodes for /TestSnapshot/sub1/.snapshot/s4/file3
|
|
|
String snapshotPath = sub1.toString() + "/.snapshot/s4/file3";
|
|
|
- String[] names = INode.getPathNames(snapshotPath);
|
|
|
- byte[][] components = INode.getPathComponents(names);
|
|
|
+ byte[][] components = INode.getPathComponents(snapshotPath);
|
|
|
INodesInPath nodesInPath = INodesInPath.resolve(fsdir.rootDir, components);
|
|
|
INode[] inodes = nodesInPath.getINodes();
|
|
|
// Length of inodes should be (components.length - 1), since we will ignore
|
|
@@ -357,8 +351,7 @@ public class TestSnapshotPathINodes {
|
|
|
}
|
|
|
|
|
|
// Check the inodes for /TestSnapshot/sub1/file3
|
|
|
- String[] names = INode.getPathNames(file3.toString());
|
|
|
- byte[][] components = INode.getPathComponents(names);
|
|
|
+ byte[][] components = INode.getPathComponents(file3.toString());
|
|
|
INodesInPath nodesInPath = INodesInPath.resolve(fsdir.rootDir, components);
|
|
|
INode[] inodes = nodesInPath.getINodes();
|
|
|
// The number of inodes should be equal to components.length
|
|
@@ -385,8 +378,7 @@ public class TestSnapshotPathINodes {
|
|
|
@Test (timeout=15000)
|
|
|
public void testSnapshotPathINodesAfterModification() throws Exception {
|
|
|
// First check the INode for /TestSnapshot/sub1/file1
|
|
|
- String[] names = INode.getPathNames(file1.toString());
|
|
|
- byte[][] components = INode.getPathComponents(names);
|
|
|
+ byte[][] components = INode.getPathComponents(file1.toString());
|
|
|
INodesInPath nodesInPath = INodesInPath.resolve(fsdir.rootDir, components);
|
|
|
INode[] inodes = nodesInPath.getINodes();
|
|
|
// The number of inodes should be equal to components.length
|
|
@@ -408,8 +400,7 @@ public class TestSnapshotPathINodes {
|
|
|
|
|
|
// Check the INodes for snapshot of file1
|
|
|
String snapshotPath = sub1.toString() + "/.snapshot/s3/file1";
|
|
|
- names = INode.getPathNames(snapshotPath);
|
|
|
- components = INode.getPathComponents(names);
|
|
|
+ components = INode.getPathComponents(snapshotPath);
|
|
|
INodesInPath ssNodesInPath = INodesInPath.resolve(fsdir.rootDir, components);
|
|
|
INode[] ssInodes = ssNodesInPath.getINodes();
|
|
|
// Length of ssInodes should be (components.length - 1), since we will
|
|
@@ -427,8 +418,7 @@ public class TestSnapshotPathINodes {
|
|
|
snapshotFileNode.getModificationTime(ssNodesInPath.getPathSnapshotId()));
|
|
|
|
|
|
// Check the INode for /TestSnapshot/sub1/file1 again
|
|
|
- names = INode.getPathNames(file1.toString());
|
|
|
- components = INode.getPathComponents(names);
|
|
|
+ components = INode.getPathComponents(file1.toString());
|
|
|
INodesInPath newNodesInPath = INodesInPath.resolve(fsdir.rootDir, components);
|
|
|
assertSnapshot(newNodesInPath, false, s3, -1);
|
|
|
INode[] newInodes = newNodesInPath.getINodes();
|