kevinrr888 commented on code in PR #4816:
URL: https://github.com/apache/accumulo/pull/4816#discussion_r1729471719


##########
test/src/main/java/org/apache/accumulo/test/IteratorEnvIT.java:
##########
@@ -222,6 +243,49 @@ private void testScan(String tableName,
     }
   }
 
+  private void testRFileScan(Class<? extends 
SortedKeyValueIterator<Key,Value>> iteratorClass)
+      throws Exception {
+    LocalFileSystem fs = FileSystem.getLocal(new Configuration());
+    String rFilePath = createRFile(fs);
+    IteratorSetting is = new IteratorSetting(1, iteratorClass);
+
+    try (Scanner scanner = 
RFile.newScanner().from(rFilePath).withFileSystem(fs)
+        .withTableProperties(getTableConfig().getProperties()).build()) {
+      scanner.addScanIterator(is);
+      var unused = scanner.iterator();
+    }
+  }
+
+  public void testOfflineScan(String tableName,
+      Class<? extends SortedKeyValueIterator<Key,Value>> iteratorClass) throws 
Exception {
+    writeData(tableName);
+    TableId tableId = getServerContext().getTableId(tableName);
+    getServerContext().tableOperations().offline(tableName, true);
+    IteratorSetting is = new IteratorSetting(1, iteratorClass);
+    is.addOption("expected.table.id",
+        getServerContext().tableOperations().tableIdMap().get(tableName));
+
+    try (OfflineScanner scanner =
+        new OfflineScanner(getServerContext(), tableId, new Authorizations())) 
{
+      scanner.addScanIterator(is);
+      var unused = scanner.iterator();
+    }
+  }
+
+  public void testClientSideScan(String tableName,
+      Class<? extends SortedKeyValueIterator<Key,Value>> iteratorClass) throws 
Exception {
+    writeData(tableName);
+    IteratorSetting is = new IteratorSetting(1, iteratorClass);
+    is.addOption("expected.table.id",
+        getServerContext().tableOperations().tableIdMap().get(tableName));
+
+    try (Scanner scanner = client.createScanner(tableName);
+        var clientIterScanner = new ClientSideIteratorScanner(scanner)) {
+      clientIterScanner.addScanIterator(is);
+      var unused = clientIterScanner.iterator();

Review Comment:
   Yeah, good point. This seems to go in line with the current changes since 
I'm already changing the test quite a bit; seems fine to do in this PR. I 
refactored the test to ensure the expected checks (from `testEnv()`) are done 
for each test



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