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


##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AdvancedScanResultConsumer.java:
##########
@@ -51,6 +51,18 @@ interface ScanResumer {
      * effect.
      */
     void resume();
+
+    /**
+     * This method is used when {@link ScanController#suspend} had ever been 
called to get a
+     * {@link ScanResumer}, but now you stop the scan and do not need more 
scan results, so you
+     * invoke this method to tell lower layer that scan is stopped by user and 
should release
+     * resources and not initiate new scans any more.
+     * <p>
+     * You are free to call it multiple time but only the first call will take 
effect.
+     */
+    default void terminate() {

Review Comment:
   This class is called ScanResumer, so I do not think we should add a 
terminate method to it, it will increase the complexity for our users to 
implement scanner. If there are enough results, the users could just call 
ScanController.terminate, instead of suspending the scanner and then terminate 
it later...
   
   Instead, I think we could introduce a IA.Private interface, or just expose 
the implementation class as package private, and in the close method of 
AsyncTableResultScanner, we check if the ScanConsumer is this class, if so we 
cast it to the implementation class and call the terminate method there, 
without exposing a terminate method in ScanResumer.
   
   WDYT?



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