Package edu.stanford.nlp.util.logging
Class RepeatedRecordHandler
- java.lang.Object
-
- edu.stanford.nlp.util.logging.LogRecordHandler
-
- edu.stanford.nlp.util.logging.RepeatedRecordHandler
-
public class RepeatedRecordHandler extends LogRecordHandler
Filters repeated messages and replaces them with the number of times they were logged.- Author:
- David McClosky,, Gabor Angeli (angeli at cs.stanford): approximate record equality, repeated tracks squashed
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRepeatedRecordHandler.ApproximateRepeatSemanticsJudges two records to be equal if they come from the same place, and begin with the same string, modulo numbersstatic classRepeatedRecordHandler.ExactRepeatSemanticsJudges two records to be equal if they are from the same place, and have the same messagestatic interfaceRepeatedRecordHandler.RepeatSemanticsDetermines the semantics of what constitutes a repeated record
-
Field Summary
Fields Modifier and Type Field Description static RepeatedRecordHandler.ApproximateRepeatSemanticsAPPROXIMATEstatic RepeatedRecordHandler.ExactRepeatSemanticsEXACT-
Fields inherited from class edu.stanford.nlp.util.logging.LogRecordHandler
EMPTY
-
-
Constructor Summary
Constructors Constructor Description RepeatedRecordHandler(RepeatedRecordHandler.RepeatSemantics repeatSemantics)Create a new repeated log message handler, using the given semantics for what constitutes a repeated record.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Redwood.Record>handle(Redwood.Record record)Handle a log Record, either as a filter or by producing a side effect.List<Redwood.Record>signalEndTrack(int newDepth, long timeEnded)Signal the end of a track, i.e.List<Redwood.Record>signalShutdown()List<Redwood.Record>signalStartTrack(Redwood.Record signal)Signal the start of a track, i.e.
-
-
-
Field Detail
-
APPROXIMATE
public static final RepeatedRecordHandler.ApproximateRepeatSemantics APPROXIMATE
-
EXACT
public static final RepeatedRecordHandler.ExactRepeatSemantics EXACT
-
-
Constructor Detail
-
RepeatedRecordHandler
public RepeatedRecordHandler(RepeatedRecordHandler.RepeatSemantics repeatSemantics)
Create a new repeated log message handler, using the given semantics for what constitutes a repeated record.- Parameters:
repeatSemantics- The semantics for what constitutes a repeated record
-
-
Method Detail
-
handle
public List<Redwood.Record> handle(Redwood.Record record)
Handle a log Record, either as a filter or by producing a side effect.- Specified by:
handlein classLogRecordHandler- Parameters:
record- The log record to handle- Returns:
- a (possibly empty) list of records to be sent on in the pipeline
-
signalStartTrack
public List<Redwood.Record> signalStartTrack(Redwood.Record signal)
Signal the start of a track, i.e. that we have descended a level deeper.- Overrides:
signalStartTrackin classLogRecordHandler- Parameters:
signal- A record corresponding to the information in the track header. The depth in this object is the old log depth.- Returns:
- A list of records to pass down the pipeline, not including the startTrack() signal. The returned records are passed to handle(), not startTrack(), and are sent before the startTrack() signal.
-
signalEndTrack
public List<Redwood.Record> signalEndTrack(int newDepth, long timeEnded)
Signal the end of a track, i.e. that we have popped up to a higher level.- Overrides:
signalEndTrackin classLogRecordHandler- Parameters:
newDepth- The new depth; that is, the current depth - 1.- Returns:
- A list of records to pass down the pipeline. The returned records are passed to handle(), not endTrack(). and are sent before the startTrack() signal.
-
signalShutdown
public List<Redwood.Record> signalShutdown()
- Overrides:
signalShutdownin classLogRecordHandler
-
-