Skip to content

HBASE-28328 Add an option to count different types of Delete Markers in RowCounter - #6435

Merged
virajjasani merged 16 commits into
apache:masterfrom
shubham-roy:HBASE-28328
Dec 2, 2024
Merged

HBASE-28328 Add an option to count different types of Delete Markers in RowCounter#6435
virajjasani merged 16 commits into
apache:masterfrom
shubham-roy:HBASE-28328

Conversation

@shubham-roy

@shubham-royshubham-roy commented Nov 4, 2024

Copy link
Copy Markdown
Contributor

A flag is introduced, which, when enabled, allows RowCounter to count the various types of Delete Markers - DELETE_COLUMN, DELETE_FAMILY, DELETE_FAMILY_VERSION. It will also calculate the number of rows having a delete marker.

To enable this the scan object was modified -> if flag is set, raw scan is performed without FirstKeyOnlyFilter.

@NihalJain

Copy link
Copy Markdown
Contributor

BTW thanks @shubham-roy for your first PR in Apache HBase, I have added some review comments, please have a look and please let me know if you have any doubts or need any help!

@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.

private boolean countDeleteMarkers;
private List<String> columns = new ArrayList<>();

private Job job;

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.

this doesnot look necessary, we have been validating counters with following logic for existing tests. Please update tests to take a similar approach:

 * Run the RowCounter map reduce job and verify the row count.
* @param args the command line arguments to be used for rowcounter job.
* @param expectedCount the expected row count (result of map reduce job).
* @throws Exception in case of any unexpected error.
*/
private void runCreateSubmittableJobWithArgs(String[] args, int expectedCount) throws Exception {
Job job = RowCounter.createSubmittableJob(TEST_UTIL.getConfiguration(), args);
long start = EnvironmentEdgeManager.currentTime();
job.waitForCompletion(true);
long duration = EnvironmentEdgeManager.currentTime() - start;
LOG.debug("row count duration (ms): " + duration);
assertTrue(job.isSuccessful());
Counter counter = job.getCounters().findCounter(RowCounter.RowCounterMapper.Counters.ROWS);
assertEquals(expectedCount, counter.getValue());
}

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

@NihalJain, the method runCreateSubmittableJobWithArgs internally calls RowCounter.createSubmittableJob(TEST_UTIL.getConfiguration(), args). However, the method createSubmittableJob is marked for deprecation - code link. So ideally, I believe (please correct me if I am wrong), we should not be making a change to that method. To use that method, we have to change the scan behaviour based on the flag.

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.

Hey @shubham-roy I mean we could rewriten a helper in tests similar to above example method runCreateSubmittableJobWithArgs and make assertions. IMO we should try to get rid of deprecated API as another task than mixing implementations and doing same thing in different ways at different places.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

IMO we should try to get rid of deprecated API as another task than mixing implementations and doing same thing in different ways at different places.

@NihalJain , don't you think that the access to the job object via a getter method (which I exposed) could be a good starting point to getting rid of the deprecated method createSubmittableJob. I already used it in a way that could be easily extended to other use cases as well. LMK what do you think.

@NihalJainNihalJainNov 15, 2024

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.

Sure but I would prefer to do that as another cleanup task for separation of concerns

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Sure but I would prefer to do that as another cleanup task for separation of concerns

@NihalJain , I agree and I am also not touching any of the other tests. I just used whatever is needed for my testing in an extensible way. Fixing of remaining tests can be taken up as a separate cleanup task.

@NihalJainNihalJainNov 19, 2024

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.

will leave this upto others as i am still not convinced. +0 from me.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

@virajjasani , can you please have a look at this thread and let us know of your thoughts on the same?

@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.

@virajjasani

Copy link
Copy Markdown
Contributor

@NihalJain A gentle reminder whenever you are ready to take another look!

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

Comment threadhbase-mapreduce/pom.xml Outdated
private boolean countDeleteMarkers;
private List<String> columns = new ArrayList<>();

private Job job;

@NihalJainNihalJainNov 19, 2024

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.

will leave this upto others as i am still not convinced. +0 from me.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@NihalJain

Copy link
Copy Markdown
Contributor

Thanks for addressing the review comments @shubham-roy. LGTM !

Before merge, please ensure to keep jira and github PR title in sync. Also please add release notes in jira to explain the behaviour of the new flag and how to make use of it.

Thanks for this nice feature.

@shubham-roy

Copy link
Copy Markdown
ContributorAuthor

Thank you @NihalJain for all the review!

@shubham-royshubham-roy changed the title HBASE-28328 Added feature to count cells and delete markers in RowCounter.HBASE-28328 Add an option to count different types of Delete Markers in RowCounterNov 20, 2024
@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@virajjasani

Copy link
Copy Markdown
Contributor

I think we are good to merge the PR then?
@shubham-roy could you also create a PR against branch-2?

@shubham-roy

Copy link
Copy Markdown
ContributorAuthor

I think we are good to merge the PR then?
@shubham-roy could you also create a PR against branch-2?

@virajjasani , yes the PR is good to merge.
PR against branch-2: #6496

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 25sDocker 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.
_ master Compile Tests _
+1 💚mvninstall3m 51smaster passed
+1 💚compile0m 41smaster passed
+1 💚checkstyle0m 13smaster passed
+1 💚spotbugs0m 39smaster passed
+1 💚spotless0m 50sbranch has no errors when running spotless:check.
_ Patch Compile Tests _
+1 💚mvninstall3m 16sthe 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 💚xmllint0m 0sNo new issues.
+1 💚spotbugs0m 42sthe patch passed
+1 💚hadoopcheck11m 52sPatch does not cause any errors with Hadoop 3.3.6 3.4.0.
+1 💚spotless0m 46spatch has no errors when running spotless:check.
_ Other Tests _
+1 💚asflicense0m 10sThe patch does not generate ASF License warnings.
31m 34s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6435/10/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#6435
Optional Testsdupname asflicense javac codespell detsecrets xmllint hadoopcheck spotless compile spotbugs checkstyle hbaseanti
unameLinux f8c49ce6d4ba 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 revisionmaster / f4a1b12
Default JavaEclipse Adoptium-17.0.11+9
Max. process+thread count85 (vs. ulimit of 30000)
modulesC: hbase-mapreduce U: hbase-mapreduce
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6435/10/console
versionsgit=2.34.1 maven=3.9.8 spotbugs=4.7.3 xmllint=20913
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 43sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed 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 💚mvninstall2m 58smaster passed
+1 💚compile0m 22smaster passed
+1 💚javadoc0m 16smaster passed
+1 💚shadedjars5m 21sbranch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚mvninstall2m 52sthe patch passed
+1 💚compile0m 22sthe patch passed
+1 💚javac0m 22sthe patch passed
+1 💚javadoc0m 16sthe patch passed
+1 💚shadedjars5m 21spatch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚unit19m 11shbase-mapreduce in the patch passed.
38m 53s
SubsystemReport/Notes
DockerClientAPI=1.47 ServerAPI=1.47 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6435/10/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR#6435
Optional Testsjavac javadoc unit shadedjars compile
unameLinux b4e5c4e278bf 5.4.0-195-generic #215-Ubuntu SMP Fri Aug 2 18:28:05 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / f4a1b12
Default JavaEclipse Adoptium-17.0.11+9
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6435/10/testReport/
Max. process+thread count2416 (vs. ulimit of 30000)
modulesC: hbase-mapreduce U: hbase-mapreduce
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6435/10/console
versionsgit=2.34.1 maven=3.9.8
Powered byApache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@virajjasani
virajjasani merged commit 240bc3f into apache:masterDec 2, 2024
virajjasani pushed a commit that referenced this pull request Dec 2, 2024
…in RowCounter (#6435)
Signed-off-by: Nihal Jain <nihaljain@apache.org>
virajjasani pushed a commit that referenced this pull request Dec 2, 2024
…in RowCounter (#6496) (#6435)
Signed-off-by: Nihal Jain <nihaljain@apache.org>
virajjasani pushed a commit that referenced this pull request Dec 2, 2024
…in RowCounter (#6496) (#6435)
Signed-off-by: Nihal Jain <nihaljain@apache.org>
virajjasani pushed a commit that referenced this pull request Dec 2, 2024
…in RowCounter (#6496) (#6435)
Signed-off-by: Nihal Jain <nihaljain@apache.org>
gvprathyusha6 pushed a commit to gvprathyusha6/hbase that referenced this pull request Dec 19, 2024
…in RowCounter (apache#6435)
Signed-off-by: Nihal Jain <nihaljain@apache.org>
mokai87 pushed a commit to mokai87/hbase that referenced this pull request Aug 7, 2025
…in RowCounter (apache#6496) (apache#6435)
Signed-off-by: Nihal Jain <nihaljain@apache.org>
sanjeet006py pushed a commit to sanjeet006py/hbase that referenced this pull request Sep 26, 2025
…in RowCounter (apache#6496) (apache#6435)
Signed-off-by: Nihal Jain <nihaljain@apache.org>
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.

5 participants

@shubham-roy@NihalJain@Apache-HBase@virajjasani@Himanshu-g81