shubham-roy commented on code in PR #7882:
URL: https://github.com/apache/hbase/pull/7882#discussion_r3194117328


##########
hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterHintForRejectedRow.java:
##########
@@ -0,0 +1,361 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.filter;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
+import org.apache.hadoop.hbase.Cell;
+import org.apache.hadoop.hbase.HBaseClassTestRule;
+import org.apache.hadoop.hbase.HBaseTestingUtil;
+import org.apache.hadoop.hbase.PrivateCellUtil;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder;
+import org.apache.hadoop.hbase.client.Durability;
+import org.apache.hadoop.hbase.client.Put;
+import org.apache.hadoop.hbase.client.RegionInfo;
+import org.apache.hadoop.hbase.client.RegionInfoBuilder;
+import org.apache.hadoop.hbase.client.Scan;
+import org.apache.hadoop.hbase.client.TableDescriptor;
+import org.apache.hadoop.hbase.client.TableDescriptorBuilder;
+import org.apache.hadoop.hbase.regionserver.HRegion;
+import org.apache.hadoop.hbase.regionserver.RegionScanner;
+import org.apache.hadoop.hbase.testclassification.FilterTests;
+import org.apache.hadoop.hbase.testclassification.MediumTests;
+import org.apache.hadoop.hbase.util.Bytes;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
+
+/**
+ * Integration tests for HBASE-29974 Path 1: {@link 
Filter#getHintForRejectedRow(Cell)} allows the
+ * scan pipeline to seek directly past rejected rows instead of iterating 
through every cell in each
+ * rejected row one-by-one via {@code nextRow()}.
+ * <p>
+ * Each test verifies two properties simultaneously:
+ * <ol>
+ * <li><b>Correctness</b> — the scan returns exactly the rows that are not 
rejected by
+ * {@link Filter#filterRowKey(Cell)}, regardless of whether the hint path or 
the legacy
+ * cell-iteration path is used.</li>
+ * <li><b>Efficiency</b> — when a filter provides a hint that jumps over all N 
rejected rows in one
+ * seek, {@code getHintForRejectedRow} is called exactly once (not N times), 
proving that the
+ * scanner did not fall back to cell-by-cell iteration for the skipped 
rows.</li>
+ * </ol>
+ */
+@Category({ FilterTests.class, MediumTests.class })
+public class TestFilterHintForRejectedRow {

Review Comment:
   `getHintForRejectedRow()` is also equally applicable for the phoenix cdc 
based backup solution that we are developing. We identify row keys that were 
mutated for the backup time range via CDC and then get information for the same 
row keys. While skipping row keys that were not mutated 
`getHintForRejectedRow()` comes into play.



-- 
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]

Reply via email to