java.lang.Object
org.apache.drill.exec.physical.impl.scan.v3.lifecycle.ScanEventListener
All Implemented Interfaces:
ScanOperatorEvents

public class ScanEventListener extends Object implements ScanOperatorEvents
Binds the scan lifeycle to the scan operator. Defers creating the scan lifecycle until the operator context is available to allow most fields in the scan lifecycle to be immutable.
  • Constructor Details

  • Method Details

    • bind

      public void bind(OperatorContext context)
      Description copied from interface: ScanOperatorEvents
      Build the scan-level schema from the physical operator select list. The operator context is provided to allow access to the user name, to options, and to other information that might influence schema resolution.

      After this call, the schema manager should be ready to build a reader-specific schema for each reader as it is opened.

      Specified by:
      bind in interface ScanOperatorEvents
      Parameters:
      context - the operator context for the scan operator
    • nextReader

      public RowBatchReader nextReader()
      Description copied from interface: ScanOperatorEvents
      A scanner typically readers multiple data sources (such as files or file blocks.) A batch reader handles each read. This method returns the next reader in whatever sequence that this scan defines.

      The preferred implementation is to create each batch reader in this call to minimize resource usage. Production queries may read thousands of files or blocks, so incremental reader creation can be far more efficient than creating readers at the start of the scan.

      Specified by:
      nextReader in interface ScanOperatorEvents
      Returns:
      a batch reader for one of the scan elements within the scan physical plan for this scan operator
    • close

      public void close()
      Description copied from interface: ScanOperatorEvents
      Called when the scan operator itself is closed. Indicates that no more readers are available.
      Specified by:
      close in interface ScanOperatorEvents