Skip to content

HBASE-20717 Implement CCSMap - a better concurrent map with compacted data structure#2138

Closed
Reidddddd wants to merge 2 commits intoapache:ccsmapfrom
Reidddddd:ccsmap
Closed

HBASE-20717 Implement CCSMap - a better concurrent map with compacted data structure#2138
Reidddddd wants to merge 2 commits intoapache:ccsmapfrom
Reidddddd:ccsmap

Conversation

@Reidddddd
Copy link
Contributor

No description provided.

@Reidddddd
Copy link
Contributor Author

First draft:

  1. Split the fat CompactedConcurrentSkipListMap class to several small classes.
  2. Make the package under hbase-server ccsmap instead of hbase-common utils. Personally, I don't feel it very common enough to go in that package.
  3. I have modified some changes, but none is about the core---CompactedConcurrentSkipListMap.

@Reidddddd
Copy link
Contributor Author

In fact, I haven't go through the details yet. I'm thinking let's make v1 draft first, so members can review the details together.

import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I should remove this line...

return theUnsafe.getByte(buf.array(), BYTE_ARRAY_BASE_OFFSET + buf.arrayOffset() + offset);
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add som docs

@Reidddddd
Copy link
Contributor Author

TestCompactedConcurrentSkipList.java passed on local, while TestCompactedTypeHelper failed

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 8m 0s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 3 new or modified test files.
_ ccsmap Compile Tests _
+0 🆗 mvndep 2m 25s Maven dependency ordering for branch
+1 💚 mvninstall 8m 4s ccsmap passed
+1 💚 compile 1m 2s ccsmap passed with JDK v1.8.0_262
+1 💚 compile 1m 12s ccsmap passed with JDK v1.7.0_272
+1 💚 checkstyle 2m 12s ccsmap passed
+1 💚 shadedjars 3m 3s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 59s ccsmap passed with JDK v1.8.0_262
+1 💚 javadoc 1m 2s ccsmap passed with JDK v1.7.0_272
+0 🆗 spotbugs 2m 41s Used deprecated FindBugs config; considering switching to SpotBugs.
+1 💚 findbugs 4m 0s ccsmap passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 17s Maven dependency ordering for patch
+1 💚 mvninstall 1m 53s the patch passed
+1 💚 compile 0m 58s the patch passed with JDK v1.8.0_262
+1 💚 javac 0m 58s the patch passed
+1 💚 compile 1m 10s the patch passed with JDK v1.7.0_272
+1 💚 javac 1m 10s the patch passed
-1 ❌ checkstyle 0m 30s hbase-common: The patch generated 1 new + 27 unchanged - 0 fixed = 28 total (was 27)
-1 ❌ checkstyle 1m 35s hbase-server: The patch generated 154 new + 0 unchanged - 0 fixed = 154 total (was 0)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 shadedjars 2m 49s patch has no errors when building our shaded downstream artifacts.
+1 💚 hadoopcheck 6m 21s Patch does not cause any errors with Hadoop 3.1.2 3.2.1.
-1 ❌ javadoc 0m 33s hbase-server-jdk1.8.0_262 with JDK v1.8.0_262 generated 11 new + 8 unchanged - 0 fixed = 19 total (was 8)
-1 ❌ javadoc 0m 41s hbase-server-jdk1.7.0_272 with JDK v1.7.0_272 generated 40 new + 8 unchanged - 0 fixed = 48 total (was 8)
-1 ❌ findbugs 2m 57s hbase-server generated 9 new + 0 unchanged - 0 fixed = 9 total (was 0)
_ Other Tests _
+1 💚 unit 2m 40s hbase-common in the patch passed.
-1 ❌ unit 33m 54s hbase-server in the patch failed.
+1 💚 asflicense 0m 31s The patch does not generate ASF License warnings.
94m 46s
Reason Tests
FindBugs module:hbase-server
Class org.apache.hadoop.hbase.ccsmap.CompactedConcurrentSkipListMap implements Cloneable but does not define or use clone method At CompactedConcurrentSkipListMap.java:does not define or use clone method At CompactedConcurrentSkipListMap.java:[lines 45-2610]
Class org.apache.hadoop.hbase.ccsmap.CompactedConcurrentSkipListMap defines non-transient non-serializable instance field settings In CompactedConcurrentSkipListMap.java:instance field settings In CompactedConcurrentSkipListMap.java
Class org.apache.hadoop.hbase.ccsmap.CompactedConcurrentSkipListMap defines non-transient non-serializable instance field typeHelper In CompactedConcurrentSkipListMap.java:instance field typeHelper In CompactedConcurrentSkipListMap.java
The field org.apache.hadoop.hbase.ccsmap.CompactedConcurrentSkipListMap.randomSeed is transient but isn't set by deserialization In CompactedConcurrentSkipListMap.java:but isn't set by deserialization In CompactedConcurrentSkipListMap.java
Class org.apache.hadoop.hbase.ccsmap.CompactedConcurrentSkipListMap$SubMap implements Cloneable but does not define or use clone method At CompactedConcurrentSkipListMap.java:does not define or use clone method At CompactedConcurrentSkipListMap.java:[lines 1979-2484]
Class org.apache.hadoop.hbase.ccsmap.CompactedConcurrentSkipListSet implements Cloneable but does not define or use clone method At CompactedConcurrentSkipListSet.java:does not define or use clone method At CompactedConcurrentSkipListSet.java:[lines 37-135]
Unread field:CompactedConcurrentSkipListMap.java:[line 143]
Unread field:CompactedConcurrentSkipListMap.java:[line 151]
org.apache.hadoop.hbase.ccsmap.OnPageKeyValue doesn't override org.apache.hadoop.hbase.KeyValue.equals(Object) At OnPageKeyValue.java:At OnPageKeyValue.java:[line 1]
Failed junit tests hadoop.hbase.ccsmap.TestCompactedTypeHelper
Subsystem Report/Notes
Docker Client=19.03.12 Server=19.03.12 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-2138/1/artifact/out/Dockerfile
GITHUB PR #2138
Optional Tests dupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
uname Linux e5a1002993d1 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality /home/jenkins/jenkins-slave/workspace/Base-PreCommit-GitHub-PR_PR-2138/out/precommit/personality/provided.sh
git revision ccsmap / 527e4a6
Default Java 1.7.0_272
Multi-JDK versions /usr/lib/jvm/zulu-8-amd64:1.8.0_262 /usr/lib/jvm/zulu-7-amd64:1.7.0_272
checkstyle https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-2138/1/artifact/out/diff-checkstyle-hbase-common.txt
checkstyle https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-2138/1/artifact/out/diff-checkstyle-hbase-server.txt
javadoc https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-2138/1/artifact/out/diff-javadoc-javadoc-hbase-server-jdk1.8.0_262.txt
javadoc https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-2138/1/artifact/out/diff-javadoc-javadoc-hbase-server-jdk1.7.0_272.txt
findbugs https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-2138/1/artifact/out/new-findbugs-hbase-server.html
unit https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-2138/1/artifact/out/patch-unit-hbase-server.txt
Test Results https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-2138/1/testReport/
Max. process+thread count 765 (vs. ulimit of 10000)
modules C: hbase-common hbase-server U: .
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-2138/1/console
versions git=1.9.1 maven=3.0.5 findbugs=3.0.1
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

}

@Override
public KVPair<Integer, String> decomposite(byte[] data, int offset, int len) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking up the meaning of decomposite, I don't think it reflects the action here.
Was the author intended to say 'decompose' or deserialize ?

b.doBehavior(mc);
long lat = System.nanoTime() - start;
performance.addOps(b.getName(), lat);
if (mc.viewOps > 20) { // up to 20 view operations
Copy link
Contributor

@tedyu tedyu Jul 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why the reset is called every 20 view operations.

mc.reset();
}
}
System.out.println("There are " + mc.mainMap2.size()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to establish baseline so that we can make some assertion here ?
I am not sure who would periodically examine these output .

public void testRandomBehaviorParallelly() throws InterruptedException {
final int RANGE = 32768;
final int INIT_DATA = 50000;
final int THREAD = 8;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the thread count be related to number of cores for the processor ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow what if the vm or poor machine only have 1 processor? although I already changed to availableProcessors methods..

@Reidddddd
Copy link
Contributor Author

Hi @tedyu (waving), long time no see!

I addressed parts of your reviews, some of them I'm not sure as well. Most of codes can't explain itself, and as we get deep, I believe weird codes may appear more. And I will address them after we have some discussions, like the method decomposite()...

@tedyu
Copy link
Contributor

tedyu commented Jul 27, 2020

It would be good to involve one of the original developers so that we get their buy-in for the changes.

Thanks

@Reidddddd
Copy link
Contributor Author

I found that the patch I based on was roughly contributed from Andrew.
I think I should pick up the those master.vx.patch to get the real sight.

@Reidddddd
Copy link
Contributor Author

Temporarily close this PR.

@Reidddddd Reidddddd closed this Jul 28, 2020
@tedyu
Copy link
Contributor

tedyu commented Jul 28, 2020

Since Alibaba has their own JVM, we should establish benchmark for CCSMap first.
So that we can know the benefit for CCSMap running on stock JVM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants