Package com.yahoo.search.logging
Class AbstractSpoolingLogger
java.lang.Object
com.yahoo.component.AbstractComponent
com.yahoo.search.logging.AbstractSpoolingLogger
- All Implemented Interfaces:
com.yahoo.component.Component,com.yahoo.component.Deconstructable,Logger,Comparable<com.yahoo.component.Component>,Runnable
public abstract class AbstractSpoolingLogger
extends com.yahoo.component.AbstractComponent
implements Runnable
Abstract class that deals with storing event entries on disk and making sure all stored
entries are eventually sent. Note that the
start() method needs to be called by subclasses as
the last statement in their constructor.- Author:
- hmusum
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.yahoo.search.logging.AbstractThreadedLogger.WorkerThreadExecutorprotected static final Loggerprotected final SpoolerFields inherited from class com.yahoo.component.AbstractComponent
isDeconstructable -
Constructor Summary
ConstructorsConstructorDescriptionAbstractSpoolingLogger(int maxFailures) AbstractSpoolingLogger(Spooler spooler) -
Method Summary
Modifier and TypeMethodDescriptionvoidSynchronously shuts down and waits for enqueued entries to be sent.protected voiddequeue(LoggerEntry entry) protected booleanenqueue(LoggerEntry entry) voidrun()booleansend(LoggerEntry entry) voidshutdown()Deprecated.voidstart()Start processing files, must be called by subclassesabstract booleantransport(LoggerEntry entry) Actually transports the entry to its destinationMethods inherited from class com.yahoo.component.AbstractComponent
clone, compareTo, getClassName, getId, getIdString, hasInitializedId, initId, isDeconstructable, setIsDeconstructable, toString
-
Field Details
-
log
-
spooler
-
executor
protected final com.yahoo.search.logging.AbstractThreadedLogger.WorkerThreadExecutor executor
-
-
Constructor Details
-
AbstractSpoolingLogger
public AbstractSpoolingLogger() -
AbstractSpoolingLogger
public AbstractSpoolingLogger(int maxFailures) -
AbstractSpoolingLogger
-
-
Method Details
-
start
public void start()Start processing files, must be called by subclasses -
run
public void run() -
send
-
shutdown
Deprecated. -
deconstruct
public void deconstruct()Synchronously shuts down and waits for enqueued entries to be sent.- Specified by:
deconstructin interfacecom.yahoo.component.Deconstructable
-
enqueue
-
dequeue
-
transport
Actually transports the entry to its destination
-