Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1045#discussion_r162246482
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/work/batch/BaseRawBatchBuffer.java
 ---
    @@ -172,7 +172,7 @@ public RawFragmentBatch getNext() throws IOException {
         } catch (final InterruptedException e) {
     
           // We expect that the interrupt means the fragment is canceled or 
failed, so we should kill this buffer
    -      if (!context.shouldContinue()) {
    +      if (!context.getExecutorState().shouldContinue()) {
    --- End diff --
    
    Let's think about this from a testing perspective. The context context can 
be implemented in a way that allows testing. That is what the use of an 
interface allows. Tests implement the context one way, real code another way, 
but the interface is the same.
    
    Here, we expose the executor state. Is this also defined as an interface?
    
    If not, we are letting implementation leak out, and we won't be able to 
create a test-only version. It was better to leave these methods on the context 
itself so that their implementation is hidden and thus we can create test 
versions.


---

Reply via email to