Interface LogDescriptor

All Superinterfaces:
Descriptor, java.io.Serializable
All Known Subinterfaces:
WebServerAccessLog

public interface LogDescriptor
extends Descriptor
Contains a log file.

Unlike other descriptors, logs can get very large and are typically stored on disk in compressed form. Access to log contents through this interface and its subinterfaces is made available in compressed and decompressed form:

  • The raw descriptor bytes are compressed, because logs contain often redundant information that can achieve high compression rates. For example, a 500kB compressed log file might be deflated to 3GB.
  • The uncompressed log contents can be accessed as a stream of bytes.
  • A list of log lines (decompressed) can be retrieved.
Since:
2.2.0
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Interface Description
    static interface  LogDescriptor.Line
    Base interface for accessing log lines.
  • Method Summary

    Modifier and Type Method Description
    java.io.InputStream decompressedByteStream()
    Returns the decompressed raw descriptor bytes of the log as stream.
    java.util.List<java.lang.String> getAnnotations()
    Returns annotations found in the log file, which may be an empty List if a log format does not support adding annotations.
    byte[] getRawDescriptorBytes()
    Returns the raw compressed descriptor bytes of the log.
    java.util.List<java.lang.String> getUnrecognizedLines()
    Returns unrecognized lines encountered while parsing the log, which may be an empty list or a fixed-size list with only a few entries, depending on the log type.
    java.util.stream.Stream<? extends LogDescriptor.Line> logLines()
    Returns a stream of all parseable log lines.

    Methods inherited from interface org.torproject.descriptor.Descriptor

    getDescriptorFile, getRawDescriptorLength