Class PrintListener

All Implemented Interfaces:
com.fishlib.base.log.LogOutputAppendable, NotificationQueue.Dependency, LivenessManager, LivenessNode, LivenessReferent, ListenerBase, ShiftAwareListener, Serializable

@ScriptApi public class PrintListener extends InstrumentedShiftAwareListener
A simple listener that prints out each update received from a table.

This can be used to debug the performance of a query by attaching to various tables in an effort to understand the update pattern. Optionally, you can also print out the head of the table.

Output is directed to stdout, thus this should not be enabled in production queries.

After you are finished, call the stop() method to remove this listener from the source table.

See Also:
  • Constructor Details

    • PrintListener

      @ScriptApi public PrintListener(String description, DynamicTable table)
      Create a PrintListener attached to the given table. Note that this automatically listens to the source table.
      Parameters:
      description - the description (for use in each print statement)
      table - the table to attach to
    • PrintListener

      @ScriptApi public PrintListener(String description, DynamicTable table, int rowCount)
      Create a PrintListener attached to the given table. Note that this automatically listens to the source table.
      Parameters:
      description - the description (for use in each print statement)
      table - the table to attach to
      rowCount - how many rows to print out on each update
  • Method Details