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

    Fields
    Modifier and Type
    Field
    Description
    protected final com.yahoo.search.logging.AbstractThreadedLogger.WorkerThreadExecutor
     
    protected static final Logger
     
    protected final Spooler
     

    Fields inherited from class com.yahoo.component.AbstractComponent

    isDeconstructable
  • Constructor Summary

    Constructors
    Constructor
    Description
     
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Synchronously shuts down and waits for enqueued entries to be sent.
    protected void
     
    protected boolean
     
    void
    run()
     
    boolean
     
    void
    Deprecated.
    void
    Start processing files, must be called by subclasses
    abstract boolean
    Actually transports the entry to its destination

    Methods inherited from class com.yahoo.component.AbstractComponent

    clone, compareTo, getClassName, getId, getIdString, hasInitializedId, initId, isDeconstructable, setIsDeconstructable, toString

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.yahoo.search.logging.Logger

    newEntry
  • Field Details

    • log

      protected static final Logger log
    • spooler

      protected final Spooler spooler
    • executor

      protected final com.yahoo.search.logging.AbstractThreadedLogger.WorkerThreadExecutor executor
  • Constructor Details

    • AbstractSpoolingLogger

      public AbstractSpoolingLogger()
    • AbstractSpoolingLogger

      public AbstractSpoolingLogger(Spooler spooler)
  • Method Details

    • start

      public void start()
      Start processing files, must be called by subclasses
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • send

      public boolean send(LoggerEntry entry)
      Specified by:
      send in interface Logger
    • shutdown

      @Deprecated public void shutdown()
      Deprecated.
    • deconstruct

      public void deconstruct()
      Synchronously shuts down and waits for enqueued entries to be sent.
      Specified by:
      deconstruct in interface com.yahoo.component.Deconstructable
    • enqueue

      protected boolean enqueue(LoggerEntry entry)
    • dequeue

      protected void dequeue(LoggerEntry entry)
    • transport

      public abstract boolean transport(LoggerEntry entry)
      Actually transports the entry to its destination