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


##########
hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestRowCounter.java:
##########
@@ -524,6 +526,106 @@ public void testInvalidTable() throws Exception {
     }
   }
 
+  /**
+   * Step 1: Add 6 rows(row1, row2, row3, row4, row5 and row6) to a table. 
Each row contains 1
+   * column family and 4 columns. Step 2: Delete a column for row1. Step 3: 
Delete a column family
+   * for row2 and row4. Step 4: Delete all versions of a specific column for 
row3, row5 and row6.
+   * <p>
+   * Case 1: Run row counter without countDeleteMarkers flag Step a: Validate 
counter values.
+   * <p>
+   * Case 2: Run row counter with countDeleteMarkers flag Step a: Validate 
counter values.
+   */
+  @Test
+  public void testRowCounterWithCountDeleteMarkersOption() throws Exception {
+    // Test Setup
+
+    final TableName tableName =
+      TableName.valueOf(TABLE_NAME + "_" + "withCountDeleteMarkersOption");
+    final byte[][] rowKeys = { Bytes.toBytes("row1"), Bytes.toBytes("row2"), 
Bytes.toBytes("row3"),
+      Bytes.toBytes("row4"), Bytes.toBytes("row5"), Bytes.toBytes("row6") };
+    final byte[] columnFamily = Bytes.toBytes("cf");
+    final byte[][] columns =
+      { Bytes.toBytes("A"), Bytes.toBytes("B"), Bytes.toBytes("C"), 
Bytes.toBytes("D") };
+    final byte[] value = Bytes.toBytes("a");
+
+    try (Table table = TEST_UTIL.createTable(tableName, columnFamily)) {
+      // Step 1: Insert rows with columns
+      for (byte[] rowKey : rowKeys) {
+        Put put = new Put(rowKey);
+        for (byte[] col : columns) {
+          put.addColumn(columnFamily, col, value);
+        }
+        table.put(put);
+      }
+      TEST_UTIL.getAdmin().flush(tableName);
+
+      // Steps 2, 3, and 4: Delete columns, families, and all versions of 
columns

Review Comment:
   >Also generate few additional rows (including delete markers) - and do the 
row counter on range of keys - which do not include these rows.
   
   This I feel is not necessary as this will basically check the working of the 
scan object. Scan object logic was not modified by the code. The code modifies 
only mapper logic of the RowCounter.



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