HDFS-12627. Fix typo in DFSAdmin command output. Contributed by Ajay Kumar.
This commit is contained in:
parent
fa5cfc68f3
commit
bb0a742aac
@ -753,7 +753,7 @@ public void allowSnapshot(String[] argv) throws IOException {
|
|||||||
} catch (SnapshotException e) {
|
} catch (SnapshotException e) {
|
||||||
throw new RemoteException(e.getClass().getName(), e.getMessage());
|
throw new RemoteException(e.getClass().getName(), e.getMessage());
|
||||||
}
|
}
|
||||||
System.out.println("Allowing snaphot on " + argv[1] + " succeeded");
|
System.out.println("Allowing snapshot on " + argv[1] + " succeeded");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -770,7 +770,7 @@ public void disallowSnapshot(String[] argv) throws IOException {
|
|||||||
} catch (SnapshotException e) {
|
} catch (SnapshotException e) {
|
||||||
throw new RemoteException(e.getClass().getName(), e.getMessage());
|
throw new RemoteException(e.getClass().getName(), e.getMessage());
|
||||||
}
|
}
|
||||||
System.out.println("Disallowing snaphot on " + argv[1] + " succeeded");
|
System.out.println("Disallowing snapshot on " + argv[1] + " succeeded");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -85,10 +85,12 @@ public void tearDown() throws IOException {
|
|||||||
@Test
|
@Test
|
||||||
public void testAllowSnapshot() throws Exception {
|
public void testAllowSnapshot() throws Exception {
|
||||||
// Idempotent test
|
// Idempotent test
|
||||||
DFSTestUtil.DFSAdminRun("-allowSnapshot /sub1", 0, "Allowing snaphot on /sub1 succeeded", conf);
|
DFSTestUtil.DFSAdminRun("-allowSnapshot /sub1", 0,
|
||||||
// allow normal dir success
|
"Allowing snapshot " + "on /sub1 succeeded", conf);
|
||||||
|
// allow normal dir success
|
||||||
DFSTestUtil.FsShellRun("-mkdir /sub2", conf);
|
DFSTestUtil.FsShellRun("-mkdir /sub2", conf);
|
||||||
DFSTestUtil.DFSAdminRun("-allowSnapshot /sub2", 0, "Allowing snaphot on /sub2 succeeded", conf);
|
DFSTestUtil.DFSAdminRun("-allowSnapshot /sub2", 0,
|
||||||
|
"Allowing snapshot " + "on /sub2 succeeded", conf);
|
||||||
// allow non-exists dir failed
|
// allow non-exists dir failed
|
||||||
DFSTestUtil.DFSAdminRun("-allowSnapshot /sub3", -1, null, conf);
|
DFSTestUtil.DFSAdminRun("-allowSnapshot /sub3", -1, null, conf);
|
||||||
}
|
}
|
||||||
@ -159,9 +161,11 @@ public void testDisallowSnapshot() throws Exception {
|
|||||||
DFSTestUtil.DFSAdminRun("-disallowSnapshot /sub1", -1,
|
DFSTestUtil.DFSAdminRun("-disallowSnapshot /sub1", -1,
|
||||||
"disallowSnapshot: The directory /sub1 has snapshot(s). Please redo the operation after removing all the snapshots.", conf);
|
"disallowSnapshot: The directory /sub1 has snapshot(s). Please redo the operation after removing all the snapshots.", conf);
|
||||||
DFSTestUtil.FsShellRun("-deleteSnapshot /sub1 sn1", conf);
|
DFSTestUtil.FsShellRun("-deleteSnapshot /sub1 sn1", conf);
|
||||||
DFSTestUtil.DFSAdminRun("-disallowSnapshot /sub1", 0, "Disallowing snaphot on /sub1 succeeded", conf);
|
DFSTestUtil.DFSAdminRun("-disallowSnapshot /sub1", 0,
|
||||||
|
"Disallowing snapshot on /sub1 succeeded", conf);
|
||||||
// Idempotent test
|
// Idempotent test
|
||||||
DFSTestUtil.DFSAdminRun("-disallowSnapshot /sub1", 0, "Disallowing snaphot on /sub1 succeeded", conf);
|
DFSTestUtil.DFSAdminRun("-disallowSnapshot /sub1", 0,
|
||||||
|
"Disallowing snapshot on /sub1 succeeded", conf);
|
||||||
// now it can be deleted
|
// now it can be deleted
|
||||||
DFSTestUtil.FsShellRun("-rmr /sub1", conf);
|
DFSTestUtil.FsShellRun("-rmr /sub1", conf);
|
||||||
}
|
}
|
||||||
@ -173,7 +177,7 @@ public void testSnapshotCommandsWithURI()throws Exception {
|
|||||||
config.set("fs.defaultFS", "hdfs://127.0.0.1:1024");
|
config.set("fs.defaultFS", "hdfs://127.0.0.1:1024");
|
||||||
String path = fs.getUri() + "/Fully/QPath";
|
String path = fs.getUri() + "/Fully/QPath";
|
||||||
DFSTestUtil.DFSAdminRun("-allowSnapshot " + path, 0,
|
DFSTestUtil.DFSAdminRun("-allowSnapshot " + path, 0,
|
||||||
"Allowing snaphot on " + path + " succeeded", config);
|
"Allowing snapshot on " + path + " succeeded", config);
|
||||||
DFSTestUtil.FsShellRun("-createSnapshot " + path + " sn1", config);
|
DFSTestUtil.FsShellRun("-createSnapshot " + path + " sn1", config);
|
||||||
// create file1
|
// create file1
|
||||||
DFSTestUtil
|
DFSTestUtil
|
||||||
@ -193,7 +197,7 @@ public void testSnapshotCommandsWithURI()throws Exception {
|
|||||||
DFSTestUtil.FsShellRun("-deleteSnapshot " + path + " sn1", config);
|
DFSTestUtil.FsShellRun("-deleteSnapshot " + path + " sn1", config);
|
||||||
DFSTestUtil.FsShellRun("-deleteSnapshot " + path + " sn3", config);
|
DFSTestUtil.FsShellRun("-deleteSnapshot " + path + " sn3", config);
|
||||||
DFSTestUtil.DFSAdminRun("-disallowSnapshot " + path, 0,
|
DFSTestUtil.DFSAdminRun("-disallowSnapshot " + path, 0,
|
||||||
"Disallowing snaphot on " + path + " succeeded", config);
|
"Disallowing snapshot on " + path + " succeeded", config);
|
||||||
fs.delete(new Path("/Fully/QPath"), true);
|
fs.delete(new Path("/Fully/QPath"), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,7 +209,7 @@ public void testSnapshotDiff()throws Exception {
|
|||||||
fs.mkdirs(snapDirPath);
|
fs.mkdirs(snapDirPath);
|
||||||
|
|
||||||
DFSTestUtil.DFSAdminRun("-allowSnapshot " + snapDirPath, 0,
|
DFSTestUtil.DFSAdminRun("-allowSnapshot " + snapDirPath, 0,
|
||||||
"Allowing snaphot on " + snapDirPath + " succeeded", config);
|
"Allowing snapshot on " + snapDirPath + " succeeded", config);
|
||||||
DFSTestUtil.createFile(fs, new Path(snapDirPath, "file1"),
|
DFSTestUtil.createFile(fs, new Path(snapDirPath, "file1"),
|
||||||
1024, (short) 1, 100);
|
1024, (short) 1, 100);
|
||||||
DFSTestUtil.FsShellRun("-createSnapshot " + snapDirPath + " sn1", config);
|
DFSTestUtil.FsShellRun("-createSnapshot " + snapDirPath + " sn1", config);
|
||||||
@ -242,7 +246,7 @@ public void testSnapshotDiff()throws Exception {
|
|||||||
DFSTestUtil.FsShellRun("-deleteSnapshot " + snapDir + " sn3", config);
|
DFSTestUtil.FsShellRun("-deleteSnapshot " + snapDir + " sn3", config);
|
||||||
DFSTestUtil.FsShellRun("-deleteSnapshot " + snapDir + " sn4", config);
|
DFSTestUtil.FsShellRun("-deleteSnapshot " + snapDir + " sn4", config);
|
||||||
DFSTestUtil.DFSAdminRun("-disallowSnapshot " + snapDir, 0,
|
DFSTestUtil.DFSAdminRun("-disallowSnapshot " + snapDir, 0,
|
||||||
"Disallowing snaphot on " + snapDirPath + " succeeded", config);
|
"Disallowing snapshot on " + snapDirPath + " succeeded", config);
|
||||||
fs.delete(new Path("/Fully/QPath"), true);
|
fs.delete(new Path("/Fully/QPath"), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16863,7 +16863,7 @@
|
|||||||
<comparators>
|
<comparators>
|
||||||
<comparator>
|
<comparator>
|
||||||
<type>RegexpComparator</type>
|
<type>RegexpComparator</type>
|
||||||
<expected-output>Allowing snaphot on /user/USERNAME/dir1 succeeded</expected-output>
|
<expected-output>Allowing snapshot on /user/USERNAME/dir1 succeeded</expected-output>
|
||||||
</comparator>
|
</comparator>
|
||||||
</comparators>
|
</comparators>
|
||||||
</test>
|
</test>
|
||||||
@ -16881,7 +16881,7 @@
|
|||||||
<comparators>
|
<comparators>
|
||||||
<comparator>
|
<comparator>
|
||||||
<type>RegexpComparator</type>
|
<type>RegexpComparator</type>
|
||||||
<expected-output>Disallowing snaphot on /user/USERNAME/dir1 succeeded</expected-output>
|
<expected-output>Disallowing snapshot on /user/USERNAME/dir1 succeeded</expected-output>
|
||||||
</comparator>
|
</comparator>
|
||||||
</comparators>
|
</comparators>
|
||||||
</test>
|
</test>
|
||||||
|
Loading…
Reference in New Issue
Block a user