Class LogEntries

java.lang.Object
com.gigaspaces.log.LogEntries
All Implemented Interfaces:
Externalizable, Serializable, Iterable<LogEntry>

public class LogEntries extends Object implements Iterable<LogEntry>, Externalizable
A collection of log entries, including meta information such as process id, host information.
Author:
kimchy
See Also:
  • Constructor Details

    • LogEntries

      public LogEntries()
      Default constructor for Externalizable readExternal usage
    • LogEntries

      public LogEntries(LogProcessType processType, long pid, String hostName, String hostAddress)
      Empty LogEntries
    • LogEntries

      public LogEntries(LogProcessType processType, List<LogEntry> entries, int totalLogFiles, long pid, long latestTimestamp, String hostName, String hostAddress)
  • Method Details

    • getProcessType

      public LogProcessType getProcessType()
      The process type that generated the logs.
    • getEntries

      public List<LogEntry> getEntries()
      The list of log entries.
    • getPid

      public long getPid()
      The process id of the process responsible for writing the log entries.
    • getHostName

      public String getHostName()
      Ths host name of the process responsible for writing the log entries.
    • getHostAddress

      public String getHostAddress()
      Ths host name of the process responsible for writing the log entries.
    • getLatestLogFileTimestamp

      public long getLatestLogFileTimestamp()
      The latest timestamp of change happened to the log file.
    • getTotalLogFiles

      public int getTotalLogFiles()
      Returns the total number of log files scanned.
    • iterator

      public Iterator<LogEntry> iterator()
      Specified by:
      iterator in interface Iterable<LogEntry>
    • logEntries

      public List<LogEntry> logEntries()
      Returns a list of all the LogEntry which are of the log type (represent an actual log line).
    • typeEntries

      public List<LogEntry> typeEntries(LogEntry.Type type)
      Returns a list of all the LogEntry which are of the prvided type.
    • findFileMarkerFor

      public LogEntry findFileMarkerFor(LogEntry logEntry)
      Finds the log entry of type LogEntry.Type.FILE_MARKER that corresponds the the provided log entry. Basically, allows to get information about the actual file from where this log entry was extracted.
    • writeExternal

      public void writeExternal(ObjectOutput out) throws IOException
      Specified by:
      writeExternal in interface Externalizable
      Throws:
      IOException
    • readExternal

      public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
      Specified by:
      readExternal in interface Externalizable
      Throws:
      IOException
      ClassNotFoundException