Class ProgressListener.StreamListener

java.lang.Object
dev.roanh.cpqindex.ProgressListener.StreamListener
All Implemented Interfaces:
ProgressListener
Enclosing interface:
ProgressListener

public static class ProgressListener.StreamListener extends Object implements ProgressListener
Progress listener that logs to a print stream all events except for intermediate updates, which are printed to standard out.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface dev.roanh.cpqindex.ProgressListener

    ProgressListener.StreamListener
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final PrintStream
    The stream to log to.

    Fields inherited from interface dev.roanh.cpqindex.ProgressListener

    LOG, NONE
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Constructs a new progress listener that log to the given stream.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Called when blocks are done being computed for a new index layer.
    void
    Called when blocks are being computed for a new index layer.
    void
    coresBlocksDone(int done, int total)
    Intermediate core computation progress update.
    void
    coresEnd(int k)
    Called when cores for a new layer are done being computed.
    void
    coresStart(int k)
    Called when cores for a new layer start being computed.
    void
    intermediateProgress(long total, int blockDone, int totalBlocks)
    Logs and intermediate progress update.
    void
    Called when mapping cores to blocks is done.
    void
    Called when mapping cores to blocks starts.
    void
    partitionCombinationEnd(int k1, int k2)
    Called when partitions are constructed from two previous blocks from a different layer (end).
    void
    partitionCombinationStart(int k1, int k2)
    Called when partitions are constructed from two previous blocks from a different layer (start).
    void
    partitionEnd(int k)
    Called when graph partitioning for a new layer ends.
    void
    Called when graph partitioning for a new layer starts.
    protected void
    Writes a new message to the stream for this listener.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • out

      private final PrintStream out
      The stream to log to.
  • Constructor Details

    • StreamListener

      private StreamListener(PrintStream out)
      Constructs a new progress listener that log to the given stream.
      Parameters:
      out - The stream to log to.
  • Method Details

    • write

      protected void write(String msg)
      Writes a new message to the stream for this listener.
      Parameters:
      msg - The message to write.
    • partitionStart

      public void partitionStart(int k)
      Description copied from interface: ProgressListener
      Called when graph partitioning for a new layer starts.
      Specified by:
      partitionStart in interface ProgressListener
      Parameters:
      k - The diameter for the layer being partitioned.
    • partitionEnd

      public void partitionEnd(int k)
      Description copied from interface: ProgressListener
      Called when graph partitioning for a new layer ends.
      Specified by:
      partitionEnd in interface ProgressListener
      Parameters:
      k - The diameter for the layer that was partitioned.
    • partitionCombinationStart

      public void partitionCombinationStart(int k1, int k2)
      Description copied from interface: ProgressListener
      Called when partitions are constructed from two previous blocks from a different layer (start).
      Specified by:
      partitionCombinationStart in interface ProgressListener
      Parameters:
      k1 - The diameter of the first block.
      k2 - The diameter of the second block.
    • partitionCombinationEnd

      public void partitionCombinationEnd(int k1, int k2)
      Description copied from interface: ProgressListener
      Called when partitions are constructed from two previous blocks from a different layer (end).
      Specified by:
      partitionCombinationEnd in interface ProgressListener
      Parameters:
      k1 - The diameter of the first block.
      k2 - The diameter of the second block.
    • computeBlocksStart

      public void computeBlocksStart(int k)
      Description copied from interface: ProgressListener
      Called when blocks are being computed for a new index layer.
      Specified by:
      computeBlocksStart in interface ProgressListener
      Parameters:
      k - The diameter for the layer that blocks are being computed for.
    • computeBlocksEnd

      public void computeBlocksEnd(int k)
      Description copied from interface: ProgressListener
      Called when blocks are done being computed for a new index layer.
      Specified by:
      computeBlocksEnd in interface ProgressListener
      Parameters:
      k - The diameter for the layer that blocks were computed for.
    • coresStart

      public void coresStart(int k)
      Description copied from interface: ProgressListener
      Called when cores for a new layer start being computed.
      Specified by:
      coresStart in interface ProgressListener
      Parameters:
      k - The diameter for the layer cores are computed for.
    • coresBlocksDone

      public void coresBlocksDone(int done, int total)
      Description copied from interface: ProgressListener
      Intermediate core computation progress update.
      Specified by:
      coresBlocksDone in interface ProgressListener
      Parameters:
      done - Total number of computed blocks.
      total - The number of blocks to compute in total.
    • coresEnd

      public void coresEnd(int k)
      Description copied from interface: ProgressListener
      Called when cores for a new layer are done being computed.
      Specified by:
      coresEnd in interface ProgressListener
      Parameters:
      k - The diameter for the layer cores were computed for.
    • mapStart

      public void mapStart()
      Description copied from interface: ProgressListener
      Called when mapping cores to blocks starts.
      Specified by:
      mapStart in interface ProgressListener
    • mapEnd

      public void mapEnd()
      Description copied from interface: ProgressListener
      Called when mapping cores to blocks is done.
      Specified by:
      mapEnd in interface ProgressListener
    • intermediateProgress

      public void intermediateProgress(long total, int blockDone, int totalBlocks)
      Description copied from interface: ProgressListener
      Logs and intermediate progress update.
      Specified by:
      intermediateProgress in interface ProgressListener
      Parameters:
      total - The total number of cores computed so far.
      blockDone - The total number of blocks done.
      totalBlocks - THe total number of blocks.