Re: [PR] HBASE-29365 Improve option parser of PerformanceEvaluation [hbase]

2025-06-03 Thread via GitHub


Apache9 merged PR #7052:
URL: https://github.com/apache/hbase/pull/7052


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29365 Improve option parser of PerformanceEvaluation [hbase]

2025-06-01 Thread via GitHub


junegunn commented on PR #7052:
URL: https://github.com/apache/hbase/pull/7052#issuecomment-2928699251

   Also to branch-2.6: #7057


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29365 Improve option parser of PerformanceEvaluation [hbase]

2025-06-01 Thread via GitHub


junegunn commented on PR #7052:
URL: https://github.com/apache/hbase/pull/7052#issuecomment-2928549554

   Thanks for the review! Just opened a pull request to branch-2: 
https://github.com/apache/hbase/pull/7056


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29365 Improve option parser of PerformanceEvaluation [hbase]

2025-06-01 Thread via GitHub


Apache9 commented on PR #7052:
URL: https://github.com/apache/hbase/pull/7052#issuecomment-2928503035

   Please raise PR for branch-2.x?
   
   Thanks.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29365 Improve option parser of PerformanceEvaluation [hbase]

2025-06-01 Thread via GitHub


Apache-HBase commented on PR #7052:
URL: https://github.com/apache/hbase/pull/7052#issuecomment-2928376372

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |::|--:|:|::|:---:|
   | +0 :ok: |  reexec  |   0m 26s |  |  Docker mode activated.  |
    _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  |  No case conflicting files 
found.  |
   | +0 :ok: |  codespell  |   0m  0s |  |  codespell was not available.  |
   | +0 :ok: |  detsecrets  |   0m  0s |  |  detect-secrets was not available.  
|
   | +1 :green_heart: |  @author  |   0m  0s |  |  The patch does not contain 
any @author tags.  |
   | +1 :green_heart: |  hbaseanti  |   0m  0s |  |  Patch does not have any 
anti-patterns.  |
    _ master Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   3m  8s |  |  master passed  |
   | +1 :green_heart: |  compile  |   0m 25s |  |  master passed  |
   | +1 :green_heart: |  checkstyle  |   0m  8s |  |  master passed  |
   | +1 :green_heart: |  spotbugs  |   0m 26s |  |  master passed  |
   | +1 :green_heart: |  spotless  |   0m 45s |  |  branch has no errors when 
running spotless:check.  |
    _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   3m  6s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 26s |  |  the patch passed  |
   | -0 :warning: |  javac  |   0m 26s | 
[/results-compile-javac-hbase-diagnostics.txt](https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7052/4/artifact/yetus-general-check/output/results-compile-javac-hbase-diagnostics.txt)
 |  hbase-diagnostics generated 2 new + 56 unchanged - 0 fixed = 58 total (was 
56)  |
   | +1 :green_heart: |  blanks  |   0m  0s |  |  The patch has no blanks 
issues.  |
   | +1 :green_heart: |  checkstyle  |   0m  9s |  |  hbase-diagnostics: The 
patch generated 0 new + 29 unchanged - 2 fixed = 29 total (was 31)  |
   | +1 :green_heart: |  spotbugs  |   0m 33s |  |  the patch passed  |
   | +1 :green_heart: |  hadoopcheck  |  12m  3s |  |  Patch does not cause any 
errors with Hadoop 3.3.6 3.4.0.  |
   | +1 :green_heart: |  spotless  |   0m 47s |  |  patch has no errors when 
running spotless:check.  |
    _ Other Tests _ |
   | +1 :green_heart: |  asflicense  |   0m  8s |  |  The patch does not 
generate ASF License warnings.  |
   |  |   |  30m 21s |  |  |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7052/4/artifact/yetus-general-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hbase/pull/7052 |
   | Optional Tests | dupname asflicense javac spotbugs checkstyle codespell 
detsecrets compile hadoopcheck hbaseanti spotless |
   | uname | Linux 8b6ecdd6894e 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 tool | maven |
   | Personality | dev-support/hbase-personality.sh |
   | git revision | master / 858e01ebcb9ee7a263c503eeed85e23fde281b49 |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   | Max. process+thread count | 83 (vs. ulimit of 3) |
   | modules | C: hbase-diagnostics U: hbase-diagnostics |
   | Console output | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7052/4/console 
|
   | versions | git=2.34.1 maven=3.9.8 spotbugs=4.7.3 |
   | Powered by | Apache Yetus 0.15.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29365 Improve option parser of PerformanceEvaluation [hbase]

2025-06-01 Thread via GitHub


Apache-HBase commented on PR #7052:
URL: https://github.com/apache/hbase/pull/7052#issuecomment-2928369914

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |::|--:|:|::|:---:|
   | +0 :ok: |  reexec  |   0m 30s |  |  Docker mode activated.  |
   | -0 :warning: |  yetus  |   0m  2s |  |  Unprocessed flag(s): 
--brief-report-file --spotbugs-strict-precheck --author-ignore-list 
--blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck  |
    _ Prechecks _ |
    _ master Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   3m 13s |  |  master passed  |
   | +1 :green_heart: |  compile  |   0m 18s |  |  master passed  |
   | +1 :green_heart: |  javadoc  |   0m 13s |  |  master passed  |
   | +1 :green_heart: |  shadedjars  |   6m  4s |  |  branch has no errors when 
building our shaded downstream artifacts.  |
    _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   3m 10s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 18s |  |  the patch passed  |
   | +1 :green_heart: |  javac  |   0m 18s |  |  the patch passed  |
   | +1 :green_heart: |  javadoc  |   0m 12s |  |  the patch passed  |
   | +1 :green_heart: |  shadedjars  |   6m  2s |  |  patch has no errors when 
building our shaded downstream artifacts.  |
    _ Other Tests _ |
   | +1 :green_heart: |  unit  |   4m  6s |  |  hbase-diagnostics in the patch 
passed.  |
   |  |   |  25m 10s |  |  |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7052/4/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hbase/pull/7052 |
   | Optional Tests | javac javadoc unit compile shadedjars |
   | uname | Linux cf3bf0d6f8a9 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 tool | maven |
   | Personality | dev-support/hbase-personality.sh |
   | git revision | master / 858e01ebcb9ee7a263c503eeed85e23fde281b49 |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   |  Test Results | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7052/4/testReport/
 |
   | Max. process+thread count | 2181 (vs. ulimit of 3) |
   | modules | C: hbase-diagnostics U: hbase-diagnostics |
   | Console output | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7052/4/console 
|
   | versions | git=2.34.1 maven=3.9.8 |
   | Powered by | Apache Yetus 0.15.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29365 Improve option parser of PerformanceEvaluation [hbase]

2025-06-01 Thread via GitHub


Apache-HBase commented on PR #7052:
URL: https://github.com/apache/hbase/pull/7052#issuecomment-2928288169

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |::|--:|:|::|:---:|
   | +0 :ok: |  reexec  |   0m 27s |  |  Docker mode activated.  |
    _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  |  No case conflicting files 
found.  |
   | +0 :ok: |  codespell  |   0m  0s |  |  codespell was not available.  |
   | +0 :ok: |  detsecrets  |   0m  0s |  |  detect-secrets was not available.  
|
   | +1 :green_heart: |  @author  |   0m  0s |  |  The patch does not contain 
any @author tags.  |
   | +1 :green_heart: |  hbaseanti  |   0m  0s |  |  Patch does not have any 
anti-patterns.  |
    _ master Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   3m  7s |  |  master passed  |
   | +1 :green_heart: |  compile  |   0m 27s |  |  master passed  |
   | +1 :green_heart: |  checkstyle  |   0m  8s |  |  master passed  |
   | +1 :green_heart: |  spotbugs  |   0m 26s |  |  master passed  |
   | +1 :green_heart: |  spotless  |   0m 45s |  |  branch has no errors when 
running spotless:check.  |
    _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   3m  9s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 26s |  |  the patch passed  |
   | -0 :warning: |  javac  |   0m 26s | 
[/results-compile-javac-hbase-diagnostics.txt](https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7052/3/artifact/yetus-general-check/output/results-compile-javac-hbase-diagnostics.txt)
 |  hbase-diagnostics generated 2 new + 56 unchanged - 0 fixed = 58 total (was 
56)  |
   | +1 :green_heart: |  blanks  |   0m  0s |  |  The patch has no blanks 
issues.  |
   | +1 :green_heart: |  checkstyle  |   0m  9s |  |  hbase-diagnostics: The 
patch generated 0 new + 29 unchanged - 2 fixed = 29 total (was 31)  |
   | +1 :green_heart: |  spotbugs  |   0m 32s |  |  the patch passed  |
   | +1 :green_heart: |  hadoopcheck  |  12m 12s |  |  Patch does not cause any 
errors with Hadoop 3.3.6 3.4.0.  |
   | +1 :green_heart: |  spotless  |   0m 49s |  |  patch has no errors when 
running spotless:check.  |
    _ Other Tests _ |
   | +1 :green_heart: |  asflicense  |   0m  9s |  |  The patch does not 
generate ASF License warnings.  |
   |  |   |  30m 34s |  |  |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7052/3/artifact/yetus-general-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hbase/pull/7052 |
   | Optional Tests | dupname asflicense javac spotbugs checkstyle codespell 
detsecrets compile hadoopcheck hbaseanti spotless |
   | uname | Linux 54c97f08a400 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 tool | maven |
   | Personality | dev-support/hbase-personality.sh |
   | git revision | master / 28b27690569732fe72a68d01bf05a5f5b4c7c834 |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   | Max. process+thread count | 84 (vs. ulimit of 3) |
   | modules | C: hbase-diagnostics U: hbase-diagnostics |
   | Console output | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7052/3/console 
|
   | versions | git=2.34.1 maven=3.9.8 spotbugs=4.7.3 |
   | Powered by | Apache Yetus 0.15.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29365 Improve option parser of PerformanceEvaluation [hbase]

2025-06-01 Thread via GitHub


Apache-HBase commented on PR #7052:
URL: https://github.com/apache/hbase/pull/7052#issuecomment-2928269585

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |::|--:|:|::|:---:|
   | +0 :ok: |  reexec  |   0m 29s |  |  Docker mode activated.  |
   | -0 :warning: |  yetus  |   0m  3s |  |  Unprocessed flag(s): 
--brief-report-file --spotbugs-strict-precheck --author-ignore-list 
--blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck  |
    _ Prechecks _ |
    _ master Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   3m 26s |  |  master passed  |
   | +1 :green_heart: |  compile  |   0m 19s |  |  master passed  |
   | +1 :green_heart: |  javadoc  |   0m 14s |  |  master passed  |
   | +1 :green_heart: |  shadedjars  |   6m  5s |  |  branch has no errors when 
building our shaded downstream artifacts.  |
    _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   3m 11s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 18s |  |  the patch passed  |
   | +1 :green_heart: |  javac  |   0m 18s |  |  the patch passed  |
   | +1 :green_heart: |  javadoc  |   0m 12s |  |  the patch passed  |
   | +1 :green_heart: |  shadedjars  |   6m  0s |  |  patch has no errors when 
building our shaded downstream artifacts.  |
    _ Other Tests _ |
   | +1 :green_heart: |  unit  |   4m  3s |  |  hbase-diagnostics in the patch 
passed.  |
   |  |   |  25m 19s |  |  |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7052/3/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hbase/pull/7052 |
   | Optional Tests | javac javadoc unit compile shadedjars |
   | uname | Linux 2a3674202d51 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 tool | maven |
   | Personality | dev-support/hbase-personality.sh |
   | git revision | master / 28b27690569732fe72a68d01bf05a5f5b4c7c834 |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   |  Test Results | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7052/3/testReport/
 |
   | Max. process+thread count | 2232 (vs. ulimit of 3) |
   | modules | C: hbase-diagnostics U: hbase-diagnostics |
   | Console output | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7052/3/console 
|
   | versions | git=2.34.1 maven=3.9.8 |
   | Powered by | Apache Yetus 0.15.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29365 Improve option parser of PerformanceEvaluation [hbase]

2025-06-01 Thread via GitHub


junegunn commented on code in PR #7052:
URL: https://github.com/apache/hbase/pull/7052#discussion_r2119775483


##
hbase-diagnostics/src/main/java/org/apache/hadoop/hbase/PerformanceEvaluation.java:
##
@@ -2853,310 +2919,61 @@ static TestOptions parseOpts(Queue args) {
 break;
   }
 
-  final String nmr = "--nomapred";
-  if (cmd.startsWith(nmr)) {
-opts.nomapred = true;
-continue;
-  }
-
-  final String rows = "--rows=";
-  if (cmd.startsWith(rows)) {
-opts.perClientRunRows = Long.parseLong(cmd.substring(rows.length()));
-continue;
-  }
-
-  final String cycles = "--cycles=";
-  if (cmd.startsWith(cycles)) {
-opts.cycles = Integer.parseInt(cmd.substring(cycles.length()));
-continue;
-  }
-
-  final String sampleRate = "--sampleRate=";
-  if (cmd.startsWith(sampleRate)) {
-opts.sampleRate = Float.parseFloat(cmd.substring(sampleRate.length()));
-continue;
-  }
-
-  final String table = "--table=";
-  if (cmd.startsWith(table)) {
-opts.tableName = cmd.substring(table.length());
-continue;
-  }
-
-  final String startRow = "--startRow=";
-  if (cmd.startsWith(startRow)) {
-opts.startRow = Long.parseLong(cmd.substring(startRow.length()));
-continue;
-  }
-
-  final String compress = "--compress=";
-  if (cmd.startsWith(compress)) {
-opts.compression = 
Compression.Algorithm.valueOf(cmd.substring(compress.length()));
-continue;
-  }
-
-  final String encryption = "--encryption=";
-  if (cmd.startsWith(encryption)) {
-opts.encryption = cmd.substring(encryption.length());
-continue;
-  }
-
-  final String traceRate = "--traceRate=";
-  if (cmd.startsWith(traceRate)) {
-opts.traceRate = Double.parseDouble(cmd.substring(traceRate.length()));
-continue;
-  }
-
-  final String blockEncoding = "--blockEncoding=";
-  if (cmd.startsWith(blockEncoding)) {
-opts.blockEncoding = 
DataBlockEncoding.valueOf(cmd.substring(blockEncoding.length()));
-continue;
-  }
-
-  final String flushCommits = "--flushCommits=";
-  if (cmd.startsWith(flushCommits)) {
-opts.flushCommits = 
Boolean.parseBoolean(cmd.substring(flushCommits.length()));
-continue;
-  }
-
-  final String writeToWAL = "--writeToWAL=";
-  if (cmd.startsWith(writeToWAL)) {
-opts.writeToWAL = 
Boolean.parseBoolean(cmd.substring(writeToWAL.length()));
-continue;
-  }
-
-  final String presplit = "--presplit=";
-  if (cmd.startsWith(presplit)) {
-opts.presplitRegions = 
Integer.parseInt(cmd.substring(presplit.length()));
-continue;
-  }
-
-  final String inMemory = "--inmemory=";
-  if (cmd.startsWith(inMemory)) {
-opts.inMemoryCF = 
Boolean.parseBoolean(cmd.substring(inMemory.length()));
-continue;
-  }
-
-  final String autoFlush = "--autoFlush=";
-  if (cmd.startsWith(autoFlush)) {
-opts.autoFlush = 
Boolean.parseBoolean(cmd.substring(autoFlush.length()));
-continue;
-  }
-
-  final String onceCon = "--oneCon=";
-  if (cmd.startsWith(onceCon)) {
-opts.oneCon = Boolean.parseBoolean(cmd.substring(onceCon.length()));
-continue;
-  }
-
-  final String connCount = "--connCount=";
-  if (cmd.startsWith(connCount)) {
-opts.connCount = Integer.parseInt(cmd.substring(connCount.length()));
-continue;
-  }
-
-  final String latencyThreshold = "--latencyThreshold=";
-  if (cmd.startsWith(latencyThreshold)) {
-opts.latencyThreshold = 
Integer.parseInt(cmd.substring(latencyThreshold.length()));
-continue;
-  }
-
-  final String latency = "--latency";
-  if (cmd.startsWith(latency)) {
-opts.reportLatency = true;
-continue;
-  }
-
-  final String multiGet = "--multiGet=";
-  if (cmd.startsWith(multiGet)) {
-opts.multiGet = Integer.parseInt(cmd.substring(multiGet.length()));
-continue;
-  }
-
-  final String multiPut = "--multiPut=";
-  if (cmd.startsWith(multiPut)) {
-opts.multiPut = Integer.parseInt(cmd.substring(multiPut.length()));
-continue;
-  }
-
-  final String useTags = "--usetags=";
-  if (cmd.startsWith(useTags)) {
-opts.useTags = Boolean.parseBoolean(cmd.substring(useTags.length()));
-continue;
-  }
-
-  final String noOfTags = "--numoftags=";
-  if (cmd.startsWith(noOfTags)) {
-opts.noOfTags = Integer.parseInt(cmd.substring(noOfTags.length()));
-continue;
-  }
-
-  final String replicas = "--replicas=";
-  if (cmd.startsWith(replicas)) {
-opts.replicas = Integer.parseInt(cmd.substring(replicas.length()));
-continue;
-  }
-
-  final String filterOutAll = "--filterAll";
-  if 

Re: [PR] HBASE-29365 Improve option parser of PerformanceEvaluation [hbase]

2025-06-01 Thread via GitHub


junegunn commented on code in PR #7052:
URL: https://github.com/apache/hbase/pull/7052#discussion_r2119786558


##
hbase-diagnostics/src/main/java/org/apache/hadoop/hbase/PerformanceEvaluation.java:
##
@@ -2843,7 +2845,71 @@ protected static void printUsage(final String shortName, 
final String message) {
* arguments.
*/
   static TestOptions parseOpts(Queue args) {
-TestOptions opts = new TestOptions();
+final TestOptions opts = new TestOptions();
+
+final Map> flagHandlers = new HashMap<>();
+flagHandlers.put("nomapred", v -> opts.nomapred = v);
+flagHandlers.put("flushCommits", v -> opts.flushCommits = v);
+flagHandlers.put("writeToWAL", v -> opts.writeToWAL = v);
+flagHandlers.put("inmemory", v -> opts.inMemoryCF = v);
+flagHandlers.put("autoFlush", v -> opts.autoFlush = v);
+flagHandlers.put("oneCon", v -> opts.oneCon = v);
+flagHandlers.put("latency", v -> opts.reportLatency = v);
+flagHandlers.put("usetags", v -> opts.useTags = v);
+flagHandlers.put("filterAll", v -> opts.filterAll = v);
+flagHandlers.put("valueRandom", v -> opts.valueRandom = v);
+flagHandlers.put("valueZipf", v -> opts.valueZipf = v);
+flagHandlers.put("addColumns", v -> opts.addColumns = v);
+flagHandlers.put("asyncPrefetch", v -> opts.asyncPrefetch = v);
+flagHandlers.put("cacheBlocks", v -> opts.cacheBlocks = v);
+
+final Map> handlers = new HashMap<>();
+handlers.put("rows", v -> opts.perClientRunRows = Long.parseLong(v));
+handlers.put("cycles", v -> opts.cycles = Integer.parseInt(v));
+handlers.put("sampleRate", v -> opts.sampleRate = Float.parseFloat(v));
+handlers.put("table", v -> opts.tableName = v);
+handlers.put("startRow", v -> opts.startRow = Long.parseLong(v));
+handlers.put("compress", v -> opts.compression = 
Compression.Algorithm.valueOf(v));
+handlers.put("encryption", v -> opts.encryption = v);
+handlers.put("traceRate", v -> opts.traceRate = Double.parseDouble(v));
+handlers.put("blockEncoding", v -> opts.blockEncoding = 
DataBlockEncoding.valueOf(v));
+handlers.put("presplit", v -> opts.presplitRegions = Integer.parseInt(v));
+handlers.put("connCount", v -> opts.connCount = Integer.parseInt(v));
+handlers.put("latencyThreshold", v -> opts.latencyThreshold = 
Integer.parseInt(v));
+handlers.put("multiGet", v -> opts.multiGet = Integer.parseInt(v));
+handlers.put("multiPut", v -> opts.multiPut = Integer.parseInt(v));
+handlers.put("numoftags", v -> opts.noOfTags = Integer.parseInt(v));
+handlers.put("replicas", v -> opts.replicas = Integer.parseInt(v));
+handlers.put("size", v -> {
+  opts.size = Float.parseFloat(v);
+  if (opts.size <= 1.0f) {
+throw new IllegalStateException("Size must be > 1; i.e. 1GB");
+  }
+});
+handlers.put("splitPolicy", v -> opts.splitPolicy = v);
+handlers.put("randomSleep", v -> opts.randomSleep = Integer.parseInt(v));
+handlers.put("measureAfter", v -> opts.measureAfter = Integer.parseInt(v));
+handlers.put("bloomFilter", v -> opts.bloomType = BloomType.valueOf(v));
+handlers.put("blockSize", v -> opts.blockSize = Integer.parseInt(v));
+handlers.put("valueSize", v -> opts.valueSize = Integer.parseInt(v));
+handlers.put("period", v -> opts.period = Integer.parseInt(v));
+handlers.put("inmemoryCompaction",
+  v -> opts.inMemoryCompaction = MemoryCompactionPolicy.valueOf(v));
+handlers.put("columns", v -> opts.columns = Integer.parseInt(v));
+handlers.put("families", v -> opts.families = Integer.parseInt(v));
+handlers.put("caching", v -> opts.caching = Integer.parseInt(v));
+handlers.put("scanReadType", v -> opts.scanReadType = 
Scan.ReadType.valueOf(v.toUpperCase()));
+handlers.put("bufferSize", v -> opts.bufferSize = Long.parseLong(v));
+handlers.put("commandPropertiesFile", fileName -> {
+  final Properties properties = new Properties();
+  try {
+
properties.load(PerformanceEvaluation.class.getClassLoader().getResourceAsStream(fileName));

Review Comment:
   This may be a little out of scope for this pull request, but I went ahead 
and followed the suggestion as it improves the error message. 858e01ebcb
   
   ```
   $ bin/hbase pe --commandPropertiesFile=log4j3.properties
   java.lang.IllegalArgumentException: Invalid option: 
--commandPropertiesFile=log4j3.properties
   at 
org.apache.hadoop.hbase.PerformanceEvaluation.parseOpts(PerformanceEvaluation.java:2952)
   at 
org.apache.hadoop.hbase.PerformanceEvaluation.run(PerformanceEvaluation.java:3042)
   at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:82)
   at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:97)
   at 
org.apache.hadoop.hbase.PerformanceEvaluation.main(PerformanceEvaluation.java:3098)
   Caused by: java.lang.IllegalArgumentException: Resource file not found: 
log4j3.properties
   at 
org.apa

Re: [PR] HBASE-29365 Improve option parser of PerformanceEvaluation [hbase]

2025-06-01 Thread via GitHub


junegunn commented on code in PR #7052:
URL: https://github.com/apache/hbase/pull/7052#discussion_r2119786558


##
hbase-diagnostics/src/main/java/org/apache/hadoop/hbase/PerformanceEvaluation.java:
##
@@ -2843,7 +2845,71 @@ protected static void printUsage(final String shortName, 
final String message) {
* arguments.
*/
   static TestOptions parseOpts(Queue args) {
-TestOptions opts = new TestOptions();
+final TestOptions opts = new TestOptions();
+
+final Map> flagHandlers = new HashMap<>();
+flagHandlers.put("nomapred", v -> opts.nomapred = v);
+flagHandlers.put("flushCommits", v -> opts.flushCommits = v);
+flagHandlers.put("writeToWAL", v -> opts.writeToWAL = v);
+flagHandlers.put("inmemory", v -> opts.inMemoryCF = v);
+flagHandlers.put("autoFlush", v -> opts.autoFlush = v);
+flagHandlers.put("oneCon", v -> opts.oneCon = v);
+flagHandlers.put("latency", v -> opts.reportLatency = v);
+flagHandlers.put("usetags", v -> opts.useTags = v);
+flagHandlers.put("filterAll", v -> opts.filterAll = v);
+flagHandlers.put("valueRandom", v -> opts.valueRandom = v);
+flagHandlers.put("valueZipf", v -> opts.valueZipf = v);
+flagHandlers.put("addColumns", v -> opts.addColumns = v);
+flagHandlers.put("asyncPrefetch", v -> opts.asyncPrefetch = v);
+flagHandlers.put("cacheBlocks", v -> opts.cacheBlocks = v);
+
+final Map> handlers = new HashMap<>();
+handlers.put("rows", v -> opts.perClientRunRows = Long.parseLong(v));
+handlers.put("cycles", v -> opts.cycles = Integer.parseInt(v));
+handlers.put("sampleRate", v -> opts.sampleRate = Float.parseFloat(v));
+handlers.put("table", v -> opts.tableName = v);
+handlers.put("startRow", v -> opts.startRow = Long.parseLong(v));
+handlers.put("compress", v -> opts.compression = 
Compression.Algorithm.valueOf(v));
+handlers.put("encryption", v -> opts.encryption = v);
+handlers.put("traceRate", v -> opts.traceRate = Double.parseDouble(v));
+handlers.put("blockEncoding", v -> opts.blockEncoding = 
DataBlockEncoding.valueOf(v));
+handlers.put("presplit", v -> opts.presplitRegions = Integer.parseInt(v));
+handlers.put("connCount", v -> opts.connCount = Integer.parseInt(v));
+handlers.put("latencyThreshold", v -> opts.latencyThreshold = 
Integer.parseInt(v));
+handlers.put("multiGet", v -> opts.multiGet = Integer.parseInt(v));
+handlers.put("multiPut", v -> opts.multiPut = Integer.parseInt(v));
+handlers.put("numoftags", v -> opts.noOfTags = Integer.parseInt(v));
+handlers.put("replicas", v -> opts.replicas = Integer.parseInt(v));
+handlers.put("size", v -> {
+  opts.size = Float.parseFloat(v);
+  if (opts.size <= 1.0f) {
+throw new IllegalStateException("Size must be > 1; i.e. 1GB");
+  }
+});
+handlers.put("splitPolicy", v -> opts.splitPolicy = v);
+handlers.put("randomSleep", v -> opts.randomSleep = Integer.parseInt(v));
+handlers.put("measureAfter", v -> opts.measureAfter = Integer.parseInt(v));
+handlers.put("bloomFilter", v -> opts.bloomType = BloomType.valueOf(v));
+handlers.put("blockSize", v -> opts.blockSize = Integer.parseInt(v));
+handlers.put("valueSize", v -> opts.valueSize = Integer.parseInt(v));
+handlers.put("period", v -> opts.period = Integer.parseInt(v));
+handlers.put("inmemoryCompaction",
+  v -> opts.inMemoryCompaction = MemoryCompactionPolicy.valueOf(v));
+handlers.put("columns", v -> opts.columns = Integer.parseInt(v));
+handlers.put("families", v -> opts.families = Integer.parseInt(v));
+handlers.put("caching", v -> opts.caching = Integer.parseInt(v));
+handlers.put("scanReadType", v -> opts.scanReadType = 
Scan.ReadType.valueOf(v.toUpperCase()));
+handlers.put("bufferSize", v -> opts.bufferSize = Long.parseLong(v));
+handlers.put("commandPropertiesFile", fileName -> {
+  final Properties properties = new Properties();
+  try {
+
properties.load(PerformanceEvaluation.class.getClassLoader().getResourceAsStream(fileName));

Review Comment:
   This may be a little out of scope of this pull request, but I went ahead and 
followed the suggestion as it helps improving the error message. 858e01ebcb
   
   ```
   $ bin/hbase pe --commandPropertiesFile=log4j3.properties
   java.lang.IllegalArgumentException: Invalid option: 
--commandPropertiesFile=log4j3.properties
   at 
org.apache.hadoop.hbase.PerformanceEvaluation.parseOpts(PerformanceEvaluation.java:2952)
   at 
org.apache.hadoop.hbase.PerformanceEvaluation.run(PerformanceEvaluation.java:3042)
   at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:82)
   at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:97)
   at 
org.apache.hadoop.hbase.PerformanceEvaluation.main(PerformanceEvaluation.java:3098)
   Caused by: java.lang.IllegalArgumentException: Resource file not found: 
log4j3.properties
   at 
o

Re: [PR] HBASE-29365 Improve option parser of PerformanceEvaluation [hbase]

2025-06-01 Thread via GitHub


Apache-HBase commented on PR #7052:
URL: https://github.com/apache/hbase/pull/7052#issuecomment-2928181831

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |::|--:|:|::|:---:|
   | +0 :ok: |  reexec  |   0m 37s |  |  Docker mode activated.  |
    _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  |  No case conflicting files 
found.  |
   | +0 :ok: |  codespell  |   0m  0s |  |  codespell was not available.  |
   | +0 :ok: |  detsecrets  |   0m  0s |  |  detect-secrets was not available.  
|
   | +1 :green_heart: |  @author  |   0m  0s |  |  The patch does not contain 
any @author tags.  |
   | +1 :green_heart: |  hbaseanti  |   0m  0s |  |  Patch does not have any 
anti-patterns.  |
    _ master Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   3m 38s |  |  master passed  |
   | +1 :green_heart: |  compile  |   0m 28s |  |  master passed  |
   | +1 :green_heart: |  checkstyle  |   0m 10s |  |  master passed  |
   | +1 :green_heart: |  spotbugs  |   0m 31s |  |  master passed  |
   | +1 :green_heart: |  spotless  |   0m 52s |  |  branch has no errors when 
running spotless:check.  |
    _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   3m 10s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 26s |  |  the patch passed  |
   | -0 :warning: |  javac  |   0m 26s | 
[/results-compile-javac-hbase-diagnostics.txt](https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7052/2/artifact/yetus-general-check/output/results-compile-javac-hbase-diagnostics.txt)
 |  hbase-diagnostics generated 2 new + 56 unchanged - 0 fixed = 58 total (was 
56)  |
   | +1 :green_heart: |  blanks  |   0m  0s |  |  The patch has no blanks 
issues.  |
   | +1 :green_heart: |  checkstyle  |   0m  8s |  |  hbase-diagnostics: The 
patch generated 0 new + 29 unchanged - 2 fixed = 29 total (was 31)  |
   | +1 :green_heart: |  spotbugs  |   0m 34s |  |  the patch passed  |
   | +1 :green_heart: |  hadoopcheck  |  12m 23s |  |  Patch does not cause any 
errors with Hadoop 3.3.6 3.4.0.  |
   | +1 :green_heart: |  spotless  |   0m 45s |  |  patch has no errors when 
running spotless:check.  |
    _ Other Tests _ |
   | +1 :green_heart: |  asflicense  |   0m 10s |  |  The patch does not 
generate ASF License warnings.  |
   |  |   |  31m 55s |  |  |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7052/2/artifact/yetus-general-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hbase/pull/7052 |
   | Optional Tests | dupname asflicense javac spotbugs checkstyle codespell 
detsecrets compile hadoopcheck hbaseanti spotless |
   | uname | Linux 6542b45d50fb 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 tool | maven |
   | Personality | dev-support/hbase-personality.sh |
   | git revision | master / 32a73ec96c5d1c99b153694c3dcb1202b0952804 |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   | Max. process+thread count | 82 (vs. ulimit of 3) |
   | modules | C: hbase-diagnostics U: hbase-diagnostics |
   | Console output | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7052/2/console 
|
   | versions | git=2.34.1 maven=3.9.8 spotbugs=4.7.3 |
   | Powered by | Apache Yetus 0.15.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29365 Improve option parser of PerformanceEvaluation [hbase]

2025-06-01 Thread via GitHub


Apache-HBase commented on PR #7052:
URL: https://github.com/apache/hbase/pull/7052#issuecomment-2928175856

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |::|--:|:|::|:---:|
   | +0 :ok: |  reexec  |   0m 28s |  |  Docker mode activated.  |
   | -0 :warning: |  yetus  |   0m  2s |  |  Unprocessed flag(s): 
--brief-report-file --spotbugs-strict-precheck --author-ignore-list 
--blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck  |
    _ Prechecks _ |
    _ master Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   3m 26s |  |  master passed  |
   | +1 :green_heart: |  compile  |   0m 19s |  |  master passed  |
   | +1 :green_heart: |  javadoc  |   0m 14s |  |  master passed  |
   | +1 :green_heart: |  shadedjars  |   6m  4s |  |  branch has no errors when 
building our shaded downstream artifacts.  |
    _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   3m  9s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 20s |  |  the patch passed  |
   | +1 :green_heart: |  javac  |   0m 20s |  |  the patch passed  |
   | +1 :green_heart: |  javadoc  |   0m 15s |  |  the patch passed  |
   | +1 :green_heart: |  shadedjars  |   6m  4s |  |  patch has no errors when 
building our shaded downstream artifacts.  |
    _ Other Tests _ |
   | +1 :green_heart: |  unit  |   4m 46s |  |  hbase-diagnostics in the patch 
passed.  |
   |  |   |  26m  7s |  |  |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7052/2/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hbase/pull/7052 |
   | Optional Tests | javac javadoc unit compile shadedjars |
   | uname | Linux fe0a1d7a95a1 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 tool | maven |
   | Personality | dev-support/hbase-personality.sh |
   | git revision | master / 32a73ec96c5d1c99b153694c3dcb1202b0952804 |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   |  Test Results | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7052/2/testReport/
 |
   | Max. process+thread count | 2452 (vs. ulimit of 3) |
   | modules | C: hbase-diagnostics U: hbase-diagnostics |
   | Console output | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7052/2/console 
|
   | versions | git=2.34.1 maven=3.9.8 |
   | Powered by | Apache Yetus 0.15.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29365 Improve option parser of PerformanceEvaluation [hbase]

2025-06-01 Thread via GitHub


Copilot commented on code in PR #7052:
URL: https://github.com/apache/hbase/pull/7052#discussion_r2119755889


##
hbase-diagnostics/src/main/java/org/apache/hadoop/hbase/PerformanceEvaluation.java:
##
@@ -2843,7 +2845,71 @@ protected static void printUsage(final String shortName, 
final String message) {
* arguments.
*/
   static TestOptions parseOpts(Queue args) {
-TestOptions opts = new TestOptions();
+final TestOptions opts = new TestOptions();
+
+final Map> flagHandlers = new HashMap<>();
+flagHandlers.put("nomapred", v -> opts.nomapred = v);
+flagHandlers.put("flushCommits", v -> opts.flushCommits = v);
+flagHandlers.put("writeToWAL", v -> opts.writeToWAL = v);
+flagHandlers.put("inmemory", v -> opts.inMemoryCF = v);
+flagHandlers.put("autoFlush", v -> opts.autoFlush = v);
+flagHandlers.put("oneCon", v -> opts.oneCon = v);
+flagHandlers.put("latency", v -> opts.reportLatency = v);
+flagHandlers.put("usetags", v -> opts.useTags = v);
+flagHandlers.put("filterAll", v -> opts.filterAll = v);
+flagHandlers.put("valueRandom", v -> opts.valueRandom = v);
+flagHandlers.put("valueZipf", v -> opts.valueZipf = v);
+flagHandlers.put("addColumns", v -> opts.addColumns = v);
+flagHandlers.put("asyncPrefetch", v -> opts.asyncPrefetch = v);
+flagHandlers.put("cacheBlocks", v -> opts.cacheBlocks = v);
+
+final Map> handlers = new HashMap<>();
+handlers.put("rows", v -> opts.perClientRunRows = Long.parseLong(v));
+handlers.put("cycles", v -> opts.cycles = Integer.parseInt(v));
+handlers.put("sampleRate", v -> opts.sampleRate = Float.parseFloat(v));
+handlers.put("table", v -> opts.tableName = v);
+handlers.put("startRow", v -> opts.startRow = Long.parseLong(v));
+handlers.put("compress", v -> opts.compression = 
Compression.Algorithm.valueOf(v));
+handlers.put("encryption", v -> opts.encryption = v);
+handlers.put("traceRate", v -> opts.traceRate = Double.parseDouble(v));
+handlers.put("blockEncoding", v -> opts.blockEncoding = 
DataBlockEncoding.valueOf(v));
+handlers.put("presplit", v -> opts.presplitRegions = Integer.parseInt(v));
+handlers.put("connCount", v -> opts.connCount = Integer.parseInt(v));
+handlers.put("latencyThreshold", v -> opts.latencyThreshold = 
Integer.parseInt(v));
+handlers.put("multiGet", v -> opts.multiGet = Integer.parseInt(v));
+handlers.put("multiPut", v -> opts.multiPut = Integer.parseInt(v));
+handlers.put("numoftags", v -> opts.noOfTags = Integer.parseInt(v));
+handlers.put("replicas", v -> opts.replicas = Integer.parseInt(v));
+handlers.put("size", v -> {
+  opts.size = Float.parseFloat(v);
+  if (opts.size <= 1.0f) {
+throw new IllegalStateException("Size must be > 1; i.e. 1GB");
+  }
+});
+handlers.put("splitPolicy", v -> opts.splitPolicy = v);
+handlers.put("randomSleep", v -> opts.randomSleep = Integer.parseInt(v));
+handlers.put("measureAfter", v -> opts.measureAfter = Integer.parseInt(v));
+handlers.put("bloomFilter", v -> opts.bloomType = BloomType.valueOf(v));
+handlers.put("blockSize", v -> opts.blockSize = Integer.parseInt(v));
+handlers.put("valueSize", v -> opts.valueSize = Integer.parseInt(v));
+handlers.put("period", v -> opts.period = Integer.parseInt(v));
+handlers.put("inmemoryCompaction",
+  v -> opts.inMemoryCompaction = MemoryCompactionPolicy.valueOf(v));
+handlers.put("columns", v -> opts.columns = Integer.parseInt(v));
+handlers.put("families", v -> opts.families = Integer.parseInt(v));
+handlers.put("caching", v -> opts.caching = Integer.parseInt(v));
+handlers.put("scanReadType", v -> opts.scanReadType = 
Scan.ReadType.valueOf(v.toUpperCase()));
+handlers.put("bufferSize", v -> opts.bufferSize = Long.parseLong(v));
+handlers.put("commandPropertiesFile", fileName -> {
+  final Properties properties = new Properties();
+  try {
+
properties.load(PerformanceEvaluation.class.getClassLoader().getResourceAsStream(fileName));

Review Comment:
   Consider adding a null-check after getResourceAsStream(fileName) before 
calling properties.load to avoid a potential NullPointerException.
   ```suggestion
   var resourceStream = 
PerformanceEvaluation.class.getClassLoader().getResourceAsStream(fileName);
   if (resourceStream == null) {
 throw new IllegalStateException("Resource file not found: " + 
fileName);
   }
   properties.load(resourceStream);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29365 Improve option parser of PerformanceEvaluation [hbase]

2025-06-01 Thread via GitHub


junegunn commented on code in PR #7052:
URL: https://github.com/apache/hbase/pull/7052#discussion_r2119731908


##
hbase-diagnostics/src/test/java/org/apache/hadoop/hbase/TestPerformanceEvaluation.java:
##
@@ -403,4 +404,30 @@ boolean testRow(long i, long startTime) throws 
IOException, InterruptedException
   return false;
 }
   }
+
+  @Test
+  public void testParseBooleanFlags() {
+final Queue opts = new LinkedList<>();
+opts.offer("--valueRandom");
+opts.offer("--autoFlush"); // default: false
+opts.offer("--inmemory=true"); // default: false
+opts.offer("--writeToWAL=false"); // default: true
+opts.offer(PerformanceEvaluation.RANDOM_READ);
+opts.offer("1");
+
+final PerformanceEvaluation.TestOptions options = 
PerformanceEvaluation.parseOpts(opts);
+assertTrue(options.valueRandom);
+assertTrue(options.flushCommits);

Review Comment:
   Good bot :)
   Addressed in 32a73ec96c5d1c99b153694c3dcb1202b0952804



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29365 Improve option parser of PerformanceEvaluation [hbase]

2025-06-01 Thread via GitHub


Apache9 commented on code in PR #7052:
URL: https://github.com/apache/hbase/pull/7052#discussion_r2119200143


##
hbase-diagnostics/src/main/java/org/apache/hadoop/hbase/PerformanceEvaluation.java:
##
@@ -2853,310 +2919,61 @@ static TestOptions parseOpts(Queue args) {
 break;
   }
 
-  final String nmr = "--nomapred";
-  if (cmd.startsWith(nmr)) {
-opts.nomapred = true;
-continue;
-  }
-
-  final String rows = "--rows=";
-  if (cmd.startsWith(rows)) {
-opts.perClientRunRows = Long.parseLong(cmd.substring(rows.length()));
-continue;
-  }
-
-  final String cycles = "--cycles=";
-  if (cmd.startsWith(cycles)) {
-opts.cycles = Integer.parseInt(cmd.substring(cycles.length()));
-continue;
-  }
-
-  final String sampleRate = "--sampleRate=";
-  if (cmd.startsWith(sampleRate)) {
-opts.sampleRate = Float.parseFloat(cmd.substring(sampleRate.length()));
-continue;
-  }
-
-  final String table = "--table=";
-  if (cmd.startsWith(table)) {
-opts.tableName = cmd.substring(table.length());
-continue;
-  }
-
-  final String startRow = "--startRow=";
-  if (cmd.startsWith(startRow)) {
-opts.startRow = Long.parseLong(cmd.substring(startRow.length()));
-continue;
-  }
-
-  final String compress = "--compress=";
-  if (cmd.startsWith(compress)) {
-opts.compression = 
Compression.Algorithm.valueOf(cmd.substring(compress.length()));
-continue;
-  }
-
-  final String encryption = "--encryption=";
-  if (cmd.startsWith(encryption)) {
-opts.encryption = cmd.substring(encryption.length());
-continue;
-  }
-
-  final String traceRate = "--traceRate=";
-  if (cmd.startsWith(traceRate)) {
-opts.traceRate = Double.parseDouble(cmd.substring(traceRate.length()));
-continue;
-  }
-
-  final String blockEncoding = "--blockEncoding=";
-  if (cmd.startsWith(blockEncoding)) {
-opts.blockEncoding = 
DataBlockEncoding.valueOf(cmd.substring(blockEncoding.length()));
-continue;
-  }
-
-  final String flushCommits = "--flushCommits=";
-  if (cmd.startsWith(flushCommits)) {
-opts.flushCommits = 
Boolean.parseBoolean(cmd.substring(flushCommits.length()));
-continue;
-  }
-
-  final String writeToWAL = "--writeToWAL=";
-  if (cmd.startsWith(writeToWAL)) {
-opts.writeToWAL = 
Boolean.parseBoolean(cmd.substring(writeToWAL.length()));
-continue;
-  }
-
-  final String presplit = "--presplit=";
-  if (cmd.startsWith(presplit)) {
-opts.presplitRegions = 
Integer.parseInt(cmd.substring(presplit.length()));
-continue;
-  }
-
-  final String inMemory = "--inmemory=";
-  if (cmd.startsWith(inMemory)) {
-opts.inMemoryCF = 
Boolean.parseBoolean(cmd.substring(inMemory.length()));
-continue;
-  }
-
-  final String autoFlush = "--autoFlush=";
-  if (cmd.startsWith(autoFlush)) {
-opts.autoFlush = 
Boolean.parseBoolean(cmd.substring(autoFlush.length()));
-continue;
-  }
-
-  final String onceCon = "--oneCon=";
-  if (cmd.startsWith(onceCon)) {
-opts.oneCon = Boolean.parseBoolean(cmd.substring(onceCon.length()));
-continue;
-  }
-
-  final String connCount = "--connCount=";
-  if (cmd.startsWith(connCount)) {
-opts.connCount = Integer.parseInt(cmd.substring(connCount.length()));
-continue;
-  }
-
-  final String latencyThreshold = "--latencyThreshold=";
-  if (cmd.startsWith(latencyThreshold)) {
-opts.latencyThreshold = 
Integer.parseInt(cmd.substring(latencyThreshold.length()));
-continue;
-  }
-
-  final String latency = "--latency";
-  if (cmd.startsWith(latency)) {
-opts.reportLatency = true;
-continue;
-  }
-
-  final String multiGet = "--multiGet=";
-  if (cmd.startsWith(multiGet)) {
-opts.multiGet = Integer.parseInt(cmd.substring(multiGet.length()));
-continue;
-  }
-
-  final String multiPut = "--multiPut=";
-  if (cmd.startsWith(multiPut)) {
-opts.multiPut = Integer.parseInt(cmd.substring(multiPut.length()));
-continue;
-  }
-
-  final String useTags = "--usetags=";
-  if (cmd.startsWith(useTags)) {
-opts.useTags = Boolean.parseBoolean(cmd.substring(useTags.length()));
-continue;
-  }
-
-  final String noOfTags = "--numoftags=";
-  if (cmd.startsWith(noOfTags)) {
-opts.noOfTags = Integer.parseInt(cmd.substring(noOfTags.length()));
-continue;
-  }
-
-  final String replicas = "--replicas=";
-  if (cmd.startsWith(replicas)) {
-opts.replicas = Integer.parseInt(cmd.substring(replicas.length()));
-continue;
-  }
-
-  final String filterOutAll = "--filterAll";
-  if (

Re: [PR] HBASE-29365 Improve option parser of PerformanceEvaluation [hbase]

2025-06-01 Thread via GitHub


Copilot commented on code in PR #7052:
URL: https://github.com/apache/hbase/pull/7052#discussion_r2119199212


##
hbase-diagnostics/src/test/java/org/apache/hadoop/hbase/TestPerformanceEvaluation.java:
##
@@ -403,4 +404,30 @@ boolean testRow(long i, long startTime) throws 
IOException, InterruptedException
   return false;
 }
   }
+
+  @Test
+  public void testParseBooleanFlags() {
+final Queue opts = new LinkedList<>();
+opts.offer("--valueRandom");
+opts.offer("--autoFlush"); // default: false
+opts.offer("--inmemory=true"); // default: false
+opts.offer("--writeToWAL=false"); // default: true
+opts.offer(PerformanceEvaluation.RANDOM_READ);
+opts.offer("1");
+
+final PerformanceEvaluation.TestOptions options = 
PerformanceEvaluation.parseOpts(opts);
+assertTrue(options.valueRandom);
+assertTrue(options.flushCommits);

Review Comment:
   The test provides '--autoFlush' as an option but asserts that 'flushCommits' 
is true. This appears inconsistent—either the test should assert 'autoFlush' or 
the option mapping should be updated.
   ```suggestion
   assertTrue(options.flushCommits); // verify flushCommits is true when 
--autoFlush=true
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29365 Improve option parser of PerformanceEvaluation [hbase]

2025-05-30 Thread via GitHub


Apache-HBase commented on PR #7052:
URL: https://github.com/apache/hbase/pull/7052#issuecomment-2924036209

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |::|--:|:|::|:---:|
   | +0 :ok: |  reexec  |   0m 32s |  |  Docker mode activated.  |
    _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  |  No case conflicting files 
found.  |
   | +0 :ok: |  codespell  |   0m  0s |  |  codespell was not available.  |
   | +0 :ok: |  detsecrets  |   0m  0s |  |  detect-secrets was not available.  
|
   | +1 :green_heart: |  @author  |   0m  0s |  |  The patch does not contain 
any @author tags.  |
   | +1 :green_heart: |  hbaseanti  |   0m  0s |  |  Patch does not have any 
anti-patterns.  |
    _ master Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   3m 21s |  |  master passed  |
   | +1 :green_heart: |  compile  |   0m 27s |  |  master passed  |
   | +1 :green_heart: |  checkstyle  |   0m 10s |  |  master passed  |
   | +1 :green_heart: |  spotbugs  |   0m 30s |  |  master passed  |
   | +1 :green_heart: |  spotless  |   0m 50s |  |  branch has no errors when 
running spotless:check.  |
    _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   3m  7s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 26s |  |  the patch passed  |
   | -0 :warning: |  javac  |   0m 26s | 
[/results-compile-javac-hbase-diagnostics.txt](https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7052/1/artifact/yetus-general-check/output/results-compile-javac-hbase-diagnostics.txt)
 |  hbase-diagnostics generated 2 new + 56 unchanged - 0 fixed = 58 total (was 
56)  |
   | +1 :green_heart: |  blanks  |   0m  0s |  |  The patch has no blanks 
issues.  |
   | +1 :green_heart: |  checkstyle  |   0m  8s |  |  hbase-diagnostics: The 
patch generated 0 new + 29 unchanged - 2 fixed = 29 total (was 31)  |
   | +1 :green_heart: |  spotbugs  |   0m 33s |  |  the patch passed  |
   | +1 :green_heart: |  hadoopcheck  |  12m 25s |  |  Patch does not cause any 
errors with Hadoop 3.3.6 3.4.0.  |
   | +1 :green_heart: |  spotless  |   0m 46s |  |  patch has no errors when 
running spotless:check.  |
    _ Other Tests _ |
   | +1 :green_heart: |  asflicense  |   0m  9s |  |  The patch does not 
generate ASF License warnings.  |
   |  |   |  31m 13s |  |  |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7052/1/artifact/yetus-general-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hbase/pull/7052 |
   | Optional Tests | dupname asflicense javac spotbugs checkstyle codespell 
detsecrets compile hadoopcheck hbaseanti spotless |
   | uname | Linux d521c6eefeec 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 tool | maven |
   | Personality | dev-support/hbase-personality.sh |
   | git revision | master / f619a267f8bad4aea2ccfc777d109e8bde11fbb2 |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   | Max. process+thread count | 83 (vs. ulimit of 3) |
   | modules | C: hbase-diagnostics U: hbase-diagnostics |
   | Console output | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7052/1/console 
|
   | versions | git=2.34.1 maven=3.9.8 spotbugs=4.7.3 |
   | Powered by | Apache Yetus 0.15.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29365 Improve option parser of PerformanceEvaluation [hbase]

2025-05-30 Thread via GitHub


Apache-HBase commented on PR #7052:
URL: https://github.com/apache/hbase/pull/7052#issuecomment-2924032093

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |::|--:|:|::|:---:|
   | +0 :ok: |  reexec  |   0m 35s |  |  Docker mode activated.  |
   | -0 :warning: |  yetus  |   0m  3s |  |  Unprocessed flag(s): 
--brief-report-file --spotbugs-strict-precheck --author-ignore-list 
--blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck  |
    _ Prechecks _ |
    _ master Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   3m 50s |  |  master passed  |
   | +1 :green_heart: |  compile  |   0m 27s |  |  master passed  |
   | +1 :green_heart: |  javadoc  |   0m 18s |  |  master passed  |
   | +1 :green_heart: |  shadedjars  |   6m 45s |  |  branch has no errors when 
building our shaded downstream artifacts.  |
    _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   3m 57s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 23s |  |  the patch passed  |
   | +1 :green_heart: |  javac  |   0m 23s |  |  the patch passed  |
   | +1 :green_heart: |  javadoc  |   0m 14s |  |  the patch passed  |
   | +1 :green_heart: |  shadedjars  |   6m 52s |  |  patch has no errors when 
building our shaded downstream artifacts.  |
    _ Other Tests _ |
   | +1 :green_heart: |  unit  |   5m 13s |  |  hbase-diagnostics in the patch 
passed.  |
   |  |   |  29m 41s |  |  |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7052/1/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hbase/pull/7052 |
   | Optional Tests | javac javadoc unit compile shadedjars |
   | uname | Linux aa44e373d759 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 tool | maven |
   | Personality | dev-support/hbase-personality.sh |
   | git revision | master / f619a267f8bad4aea2ccfc777d109e8bde11fbb2 |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   |  Test Results | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7052/1/testReport/
 |
   | Max. process+thread count | 2521 (vs. ulimit of 3) |
   | modules | C: hbase-diagnostics U: hbase-diagnostics |
   | Console output | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7052/1/console 
|
   | versions | git=2.34.1 maven=3.9.8 |
   | Powered by | Apache Yetus 0.15.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29365 Improve option parser of PerformanceEvaluation [hbase]

2025-05-30 Thread via GitHub


junegunn commented on code in PR #7052:
URL: https://github.com/apache/hbase/pull/7052#discussion_r2117009848


##
hbase-diagnostics/src/main/java/org/apache/hadoop/hbase/PerformanceEvaluation.java:
##
@@ -2853,310 +2919,61 @@ static TestOptions parseOpts(Queue args) {
 break;
   }
 
-  final String nmr = "--nomapred";
-  if (cmd.startsWith(nmr)) {
-opts.nomapred = true;
-continue;
-  }
-
-  final String rows = "--rows=";
-  if (cmd.startsWith(rows)) {
-opts.perClientRunRows = Long.parseLong(cmd.substring(rows.length()));
-continue;
-  }
-
-  final String cycles = "--cycles=";
-  if (cmd.startsWith(cycles)) {
-opts.cycles = Integer.parseInt(cmd.substring(cycles.length()));
-continue;
-  }
-
-  final String sampleRate = "--sampleRate=";
-  if (cmd.startsWith(sampleRate)) {
-opts.sampleRate = Float.parseFloat(cmd.substring(sampleRate.length()));
-continue;
-  }
-
-  final String table = "--table=";
-  if (cmd.startsWith(table)) {
-opts.tableName = cmd.substring(table.length());
-continue;
-  }
-
-  final String startRow = "--startRow=";
-  if (cmd.startsWith(startRow)) {
-opts.startRow = Long.parseLong(cmd.substring(startRow.length()));
-continue;
-  }
-
-  final String compress = "--compress=";
-  if (cmd.startsWith(compress)) {
-opts.compression = 
Compression.Algorithm.valueOf(cmd.substring(compress.length()));
-continue;
-  }
-
-  final String encryption = "--encryption=";
-  if (cmd.startsWith(encryption)) {
-opts.encryption = cmd.substring(encryption.length());
-continue;
-  }
-
-  final String traceRate = "--traceRate=";
-  if (cmd.startsWith(traceRate)) {
-opts.traceRate = Double.parseDouble(cmd.substring(traceRate.length()));
-continue;
-  }
-
-  final String blockEncoding = "--blockEncoding=";
-  if (cmd.startsWith(blockEncoding)) {
-opts.blockEncoding = 
DataBlockEncoding.valueOf(cmd.substring(blockEncoding.length()));
-continue;
-  }
-
-  final String flushCommits = "--flushCommits=";
-  if (cmd.startsWith(flushCommits)) {
-opts.flushCommits = 
Boolean.parseBoolean(cmd.substring(flushCommits.length()));
-continue;
-  }
-
-  final String writeToWAL = "--writeToWAL=";
-  if (cmd.startsWith(writeToWAL)) {
-opts.writeToWAL = 
Boolean.parseBoolean(cmd.substring(writeToWAL.length()));
-continue;
-  }
-
-  final String presplit = "--presplit=";
-  if (cmd.startsWith(presplit)) {
-opts.presplitRegions = 
Integer.parseInt(cmd.substring(presplit.length()));
-continue;
-  }
-
-  final String inMemory = "--inmemory=";
-  if (cmd.startsWith(inMemory)) {
-opts.inMemoryCF = 
Boolean.parseBoolean(cmd.substring(inMemory.length()));
-continue;
-  }
-
-  final String autoFlush = "--autoFlush=";
-  if (cmd.startsWith(autoFlush)) {
-opts.autoFlush = 
Boolean.parseBoolean(cmd.substring(autoFlush.length()));
-continue;
-  }
-
-  final String onceCon = "--oneCon=";
-  if (cmd.startsWith(onceCon)) {
-opts.oneCon = Boolean.parseBoolean(cmd.substring(onceCon.length()));
-continue;
-  }
-
-  final String connCount = "--connCount=";
-  if (cmd.startsWith(connCount)) {
-opts.connCount = Integer.parseInt(cmd.substring(connCount.length()));
-continue;
-  }
-
-  final String latencyThreshold = "--latencyThreshold=";
-  if (cmd.startsWith(latencyThreshold)) {
-opts.latencyThreshold = 
Integer.parseInt(cmd.substring(latencyThreshold.length()));
-continue;
-  }
-
-  final String latency = "--latency";
-  if (cmd.startsWith(latency)) {
-opts.reportLatency = true;
-continue;
-  }
-
-  final String multiGet = "--multiGet=";
-  if (cmd.startsWith(multiGet)) {
-opts.multiGet = Integer.parseInt(cmd.substring(multiGet.length()));
-continue;
-  }
-
-  final String multiPut = "--multiPut=";
-  if (cmd.startsWith(multiPut)) {
-opts.multiPut = Integer.parseInt(cmd.substring(multiPut.length()));
-continue;
-  }
-
-  final String useTags = "--usetags=";
-  if (cmd.startsWith(useTags)) {
-opts.useTags = Boolean.parseBoolean(cmd.substring(useTags.length()));
-continue;
-  }
-
-  final String noOfTags = "--numoftags=";
-  if (cmd.startsWith(noOfTags)) {
-opts.noOfTags = Integer.parseInt(cmd.substring(noOfTags.length()));
-continue;
-  }
-
-  final String replicas = "--replicas=";
-  if (cmd.startsWith(replicas)) {
-opts.replicas = Integer.parseInt(cmd.substring(replicas.length()));
-continue;
-  }
-
-  final String filterOutAll = "--filterAll";
-  if