[
https://issues.apache.org/jira/browse/HDFS-13171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16382768#comment-16382768
]
Tsz Wo Nicholas Sze edited comment on HDFS-13171 at 3/1/18 10:44 PM:
---------------------------------------------------------------------
- testRemove2() incorrectly calls the static testRemove (no "2"). After fixing
it, testRemove2 fails
{code}
java.lang.AssertionError: i = 0
computed = [c1]
expected = []
at
org.apache.hadoop.hdfs.server.namenode.snapshot.TestDirectoryDiffList.verifyChildrenList(TestDirectoryDiffList.java:87)
at
org.apache.hadoop.hdfs.server.namenode.snapshot.TestDirectoryDiffList.testRemove2(TestDirectoryDiffList.java:246)
at
org.apache.hadoop.hdfs.server.namenode.snapshot.TestDirectoryDiffList.testRemove2(TestDirectoryDiffList.java:234)
...
Caused by: java.lang.AssertionError: expected:<0> but was:<1>
at org.junit.Assert.fail(Assert.java:88)
...
at
org.apache.hadoop.hdfs.server.namenode.snapshot.TestDirectoryDiffList.assertList(TestDirectoryDiffList.java:72)
at
org.apache.hadoop.hdfs.server.namenode.snapshot.TestDirectoryDiffList.verifyChildrenList(TestDirectoryDiffList.java:85)
... 26 more
{code}
- Let's rename
-* testRemove -> testRemoveFromTail
-* testRemove2 -> testReomveFromHead
- Let's add a trim method to trim the head.
{code}
//SkipListNode
void trim() {
for (int level = level(); level > 0 && getSkipNode(level) == null;
level--) {
skipDiffList.remove(level);
}
}
{code}
was (Author: szetszwo):
- As mentioned previously, the remove code never updates head. There is some
bugs.
-* BTW, testRemove2() incorrectly calls the static testRemove (no "2"). After
fixing it, testRemove2 fails
{code}
ava.lang.AssertionError: i = 0
computed = [c1]
expected = []
at
org.apache.hadoop.hdfs.server.namenode.snapshot.TestDirectoryDiffList.verifyChildrenList(TestDirectoryDiffList.java:87)
at
org.apache.hadoop.hdfs.server.namenode.snapshot.TestDirectoryDiffList.testRemove2(TestDirectoryDiffList.java:246)
at
org.apache.hadoop.hdfs.server.namenode.snapshot.TestDirectoryDiffList.testRemove2(TestDirectoryDiffList.java:234)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at
com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.lang.AssertionError: expected:<0> but was:<1>
at org.junit.Assert.fail(Assert.java:88)
at org.junit.Assert.failNotEquals(Assert.java:743)
at org.junit.Assert.assertEquals(Assert.java:118)
at org.junit.Assert.assertEquals(Assert.java:555)
at org.junit.Assert.assertEquals(Assert.java:542)
at
org.apache.hadoop.hdfs.server.namenode.snapshot.TestDirectoryDiffList.assertList(TestDirectoryDiffList.java:72)
at
org.apache.hadoop.hdfs.server.namenode.snapshot.TestDirectoryDiffList.verifyChildrenList(TestDirectoryDiffList.java:85)
... 26 more
{code}
- Let's rename
-* testRemove -> testRemoveFromTail
-* testRemove2 -> testReomveFromHead
> Handle Deletion of nodes in SnasphotSkipList
> --------------------------------------------
>
> Key: HDFS-13171
> URL: https://issues.apache.org/jira/browse/HDFS-13171
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: snapshots
> Reporter: Shashikant Banerjee
> Assignee: Shashikant Banerjee
> Priority: Major
> Attachments: HDFS-13171.000.patch, HDFS-13171.001.patch
>
>
> This Jira will handle deletion of skipListNodes from DirectoryDiffList . If a
> node has multiple levels, the list needs to be balanced .If the node is uni
> level, no balancing of the list is required.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]