Package dev.roanh.cpqindex
Class ProgressListener.StreamListener
java.lang.Object
dev.roanh.cpqindex.ProgressListener.StreamListener
- All Implemented Interfaces:
ProgressListener
- Enclosing interface:
- 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 inherited from interface dev.roanh.cpqindex.ProgressListener
LOG, NONE
-
Constructor Summary
ModifierConstructorDescriptionprivate
Constructs a new progress listener that log to the given stream. -
Method Summary
Modifier and TypeMethodDescriptionvoid
computeBlocksEnd
(int k) Called when blocks are done being computed for a new index layer.void
computeBlocksStart
(int k) 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
mapEnd()
Called when mapping cores to blocks is done.void
mapStart()
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
partitionStart
(int k) Called when graph partitioning for a new layer starts.protected void
Writes a new message to the stream for this listener.
-
Field Details
-
out
The stream to log to.
-
-
Constructor Details
-
StreamListener
Constructs a new progress listener that log to the given stream.- Parameters:
out
- The stream to log to.
-
-
Method Details
-
write
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 interfaceProgressListener
- 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 interfaceProgressListener
- 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 interfaceProgressListener
- 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 interfaceProgressListener
- 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 interfaceProgressListener
- 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 interfaceProgressListener
- 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 interfaceProgressListener
- 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 interfaceProgressListener
- 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 interfaceProgressListener
- 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 interfaceProgressListener
-
mapEnd
public void mapEnd()Description copied from interface:ProgressListener
Called when mapping cores to blocks is done.- Specified by:
mapEnd
in interfaceProgressListener
-
intermediateProgress
public void intermediateProgress(long total, int blockDone, int totalBlocks) Description copied from interface:ProgressListener
Logs and intermediate progress update.- Specified by:
intermediateProgress
in interfaceProgressListener
- Parameters:
total
- The total number of cores computed so far.blockDone
- The total number of blocks done.totalBlocks
- THe total number of blocks.
-