Skip to content

HBASE-29013 Make PerformanceEvaluation support larger data sets (branch-2) - #6559

Merged
Apache9 merged 5 commits into
apache:branch-2from
junegunn:HBASE-29013-branch-2
Dec 29, 2024
Merged

HBASE-29013 Make PerformanceEvaluation support larger data sets (branch-2)#6559
Apache9 merged 5 commits into
apache:branch-2from
junegunn:HBASE-29013-branch-2

Conversation

@junegunn

Copy link
Copy Markdown
Member

Cherry-picked 6ebd48e and replaced Random#nextLong(bound) which is not available on JDK 8 with ThreadLocalRandom#nextLong(bound) (e140ae7).

Not being able to provide a seed doesn't matter in this context, so this should be good enough.

Use 8-byte long integers in the code to prevent integer overflows.
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Reviewed-by: Peng Lu <lupeng_nwpu@qq.com>
@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache9Apache9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's change to use ThreadLocalRandom.

And also please open an addendum PR against master branch too, so we can align the code with branch-2.

private final int everyN;
private final long everyN;

protected final Random rand = new Random(nextRandomSeed());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So we can remove this now?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Yes, we can. I didn't remove it in the first place because I wanted to minimize the code change, but now that we agree on using ThreadLocalRandom, let me clean this up.

@junegunnjunegunnDec 26, 2024

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

On the second thought, we can keep this member and just set it to ThreadLocalRandom.current() to minimize the required code change. TestBase instances are created on the fly by each thread in the pool (TestClient-%s), so I think it's safe to do it this way. What do you think?

diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
index ffe33a9e8b..7bbccbd48d 100644
--- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java+++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java@@ -1141,17 +1141,9 @@ public class PerformanceEvaluation extends Configured implements Tool {
* A test. Subclass to particularize what happens per row.
*/
static abstract class TestBase {
- // Below is make it so when Tests are all running in the one- // jvm, that they each have a differently seeded Random.- private static final Random randomSeed = new Random(EnvironmentEdgeManager.currentTime());-- private static long nextRandomSeed() {- return randomSeed.nextLong();- }-
private final long everyN;
- protected final Random rand = new Random(nextRandomSeed());+ protected final Random rand = ThreadLocalRandom.current();
protected final Configuration conf;
protected final TestOptions opts;

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

to minimize the required code change

generateData is used in other places, but without a custom seed value.

privatebyte[][] generateRandomStartKeys(intnumKeys) {
Randomrandom = newRandom();
byte[][] ret = newbyte[numKeys][];
// first region start key is always empty
ret[0] = HConstants.EMPTY_BYTE_ARRAY;
for (inti = 1; i < numKeys; i++) {
ret[i] =
PerformanceEvaluation.generateData(random, PerformanceEvaluation.DEFAULT_VALUE_LENGTH);
}
returnret;
}

privatebyte[][] generateRandomStartKeys(intnumKeys) {
Randomrandom = ThreadLocalRandom.current();
byte[][] ret = newbyte[numKeys][];
// first region start key is always empty
ret[0] = HConstants.EMPTY_BYTE_ARRAY;
for (inti = 1; i < numKeys; i++) {
ret[i] =
PerformanceEvaluation.generateData(random, PerformanceEvaluation.DEFAULT_VALUE_LENGTH);
}
returnret;
}

So it's actually trivial to remove the Random parameter altogether.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

So I have pushed two commits.

  • 756ca4e is a minimal change that only replaces the value of rand to ThreadLocalRandom.current()
  • 09099f7 then completely removes Random parameters from the methods.

Please let me know which version you prefer.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 45sDocker mode activated.
-0 ⚠️yetus0m 5sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ branch-2 Compile Tests _
+1 💚mvninstall2m 39sbranch-2 passed
+1 💚compile0m 17sbranch-2 passed
+1 💚javadoc0m 14sbranch-2 passed
+1 💚shadedjars5m 15sbranch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚mvninstall3m 23sthe patch passed
+1 💚compile0m 20sthe patch passed
+1 💚javac0m 20sthe patch passed
+1 💚javadoc0m 14sthe patch passed
+1 💚shadedjars5m 18spatch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚unit12m 15shbase-mapreduce in the patch passed.
32m 2s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6559/3/artifact/yetus-jdk8-hadoop2-check/output/Dockerfile
GITHUB PR#6559
Optional Testsjavac javadoc unit compile shadedjars
unameLinux 51f2498671f9 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionbranch-2 / 09099f7
Default JavaTemurin-1.8.0_412-b08
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6559/3/testReport/
Max. process+thread count2002 (vs. ulimit of 30000)
modulesC: hbase-mapreduce U: hbase-mapreduce
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6559/3/console
versionsgit=2.34.1 maven=3.9.8
Powered byApache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 56sDocker mode activated.
-0 ⚠️yetus0m 6sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ branch-2 Compile Tests _
+1 💚mvninstall2m 46sbranch-2 passed
+1 💚compile0m 20sbranch-2 passed
+1 💚javadoc0m 16sbranch-2 passed
+1 💚shadedjars5m 41sbranch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚mvninstall2m 40sthe patch passed
+1 💚compile0m 22sthe patch passed
+1 💚javac0m 22sthe patch passed
+1 💚javadoc0m 15sthe patch passed
+1 💚shadedjars5m 4spatch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚unit12m 41shbase-mapreduce in the patch passed.
32m 24s
SubsystemReport/Notes
DockerClientAPI=1.47 ServerAPI=1.47 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6559/3/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#6559
Optional Testsjavac javadoc unit compile shadedjars
unameLinux 42de612a53ca 5.4.0-200-generic #220-Ubuntu SMP Fri Sep 27 13:19:16 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionbranch-2 / 09099f7
Default JavaEclipse Adoptium-11.0.23+9
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6559/3/testReport/
Max. process+thread count2241 (vs. ulimit of 30000)
modulesC: hbase-mapreduce U: hbase-mapreduce
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6559/3/console
versionsgit=2.34.1 maven=3.9.8
Powered byApache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec1m 12sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+0 🆗codespell0m 0scodespell was not available.
+0 🆗detsecrets0m 0sdetect-secrets was not available.
+1 💚@author0m 0sThe patch does not contain any @author tags.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
_ branch-2 Compile Tests _
+1 💚mvninstall4m 14sbranch-2 passed
+1 💚compile0m 43sbranch-2 passed
+1 💚checkstyle0m 16sbranch-2 passed
+1 💚spotbugs0m 40sbranch-2 passed
+1 💚spotless0m 53sbranch has no errors when running spotless:check.
_ Patch Compile Tests _
+1 💚mvninstall3m 18sthe patch passed
+1 💚compile0m 37sthe patch passed
+1 💚javac0m 37sthe patch passed
+1 💚blanks0m 0sThe patch has no blanks issues.
+1 💚checkstyle0m 12sthe patch passed
+1 💚spotbugs0m 52sthe patch passed
+1 💚hadoopcheck20m 2sPatch does not cause any errors with Hadoop 2.10.2 or 3.3.6 3.4.0.
+1 💚spotless1m 1spatch has no errors when running spotless:check.
_ Other Tests _
+1 💚asflicense0m 11sThe patch does not generate ASF License warnings.
36m 16s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6559/3/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#6559
Optional Testsdupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless
unameLinux 2f63ff6e3294 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionbranch-2 / 09099f7
Default JavaEclipse Adoptium-11.0.23+9
Max. process+thread count79 (vs. ulimit of 30000)
modulesC: hbase-mapreduce U: hbase-mapreduce
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6559/3/console
versionsgit=2.34.1 maven=3.9.8 spotbugs=4.7.3
Powered byApache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec1m 15sDocker mode activated.
-0 ⚠️yetus0m 5sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ branch-2 Compile Tests _
+1 💚mvninstall4m 5sbranch-2 passed
+1 💚compile0m 24sbranch-2 passed
+1 💚javadoc0m 19sbranch-2 passed
+1 💚shadedjars7m 5sbranch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚mvninstall3m 31sthe patch passed
+1 💚compile0m 24sthe patch passed
+1 💚javac0m 24sthe patch passed
+1 💚javadoc0m 15sthe patch passed
+1 💚shadedjars6m 24spatch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚unit17m 14shbase-mapreduce in the patch passed.
42m 20s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6559/3/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR#6559
Optional Testsjavac javadoc unit compile shadedjars
unameLinux 950fbea7ccc1 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionbranch-2 / 09099f7
Default JavaEclipse Adoptium-17.0.11+9
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6559/3/testReport/
Max. process+thread count2069 (vs. ulimit of 30000)
modulesC: hbase-mapreduce U: hbase-mapreduce
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6559/3/console
versionsgit=2.34.1 maven=3.9.8
Powered byApache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache9
Apache9 merged commit 5638a38 into apache:branch-2Dec 29, 2024
Apache9 pushed a commit that referenced this pull request Dec 29, 2024
…ch-2) (#6559)
Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit 5638a38)
Apache9 pushed a commit that referenced this pull request Dec 29, 2024
…ch-2) (#6559)
Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit 5638a38)
mokai87 pushed a commit to mokai87/hbase that referenced this pull request Aug 7, 2025
…ch-2) (apache#6559)
Signed-off-by: Duo Zhang <zhangduo@apache.org>
sanjeet006py pushed a commit to sanjeet006py/hbase that referenced this pull request Sep 26, 2025
…ch-2) (apache#6559)
Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit 5638a38)
sanjeet006py pushed a commit to sanjeet006py/hbase that referenced this pull request Sep 26, 2025
…ts (branch-2) (apache#6559)"
This reverts commit 1eca2a33af3d41dabf46e2e4bb22d5bf8599c55f.
Sign up for freeto 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

@junegunn@Apache-HBase@Apache9