kafka.log

LogSegment

class LogSegment extends Range with Logging

A segment of the log. Each segment has two components: a log and an index. The log is a FileMessageSet containing the actual messages. The index is an OffsetIndex that maps from logical offsets to physical file positions. Each segment has a base offset which is an offset <= the least offset of any message in this segment and > any offset in any previous segment.

A segment with a base offset of [base_offset] would be stored in two files, a [base_offset].index and a [base_offset].log file.

Annotations
@nonthreadsafe()
Linear Supertypes
Logging, Range, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. LogSegment
  2. Logging
  3. Range
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new LogSegment(dir: File, startOffset: Long, indexIntervalBytes: Int, maxIndexSize: Int)

  2. new LogSegment(messageSet: FileMessageSet, index: OffsetIndex, start: Long, indexIntervalBytes: Int, time: Time)

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def append(offset: Long, messages: ByteBufferMessageSet): Unit

    Append the given messages starting with the given offset.

    Append the given messages starting with the given offset. Add an entry to the index if needed.

    It is assumed this method is being called from within a lock

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. var bytesSinceLastIndexEntry: Int

  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  10. def close(): Unit

    Close this log segment

  11. def contains(value: Long): Boolean

    if value is in range

    if value is in range

    Definition Classes
    Range
  12. def debug(msg: ⇒ String, e: ⇒ Throwable): Unit

    Definition Classes
    Logging
  13. def debug(e: ⇒ Throwable): Any

    Definition Classes
    Logging
  14. def debug(msg: ⇒ String): Unit

    Definition Classes
    Logging
  15. var deleted: Boolean

  16. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  18. def error(msg: ⇒ String, e: ⇒ Throwable): Unit

    Definition Classes
    Logging
  19. def error(e: ⇒ Throwable): Any

    Definition Classes
    Logging
  20. def error(msg: ⇒ String): Unit

    Definition Classes
    Logging
  21. def fatal(msg: ⇒ String, e: ⇒ Throwable): Unit

    Definition Classes
    Logging
  22. def fatal(e: ⇒ Throwable): Any

    Definition Classes
    Logging
  23. def fatal(msg: ⇒ String): Unit

    Definition Classes
    Logging
  24. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  25. var firstAppendTime: Option[Long]

  26. def flush(): Unit

    Flush this log segment to disk

  27. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  28. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  29. val index: OffsetIndex

  30. val indexIntervalBytes: Int

  31. def info(msg: ⇒ String, e: ⇒ Throwable): Unit

    Definition Classes
    Logging
  32. def info(e: ⇒ Throwable): Any

    Definition Classes
    Logging
  33. def info(msg: ⇒ String): Unit

    Definition Classes
    Logging
  34. def isEmpty: Boolean

    Return true iff the range is empty

    Return true iff the range is empty

    Definition Classes
    Range
  35. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  36. var logIdent: String

    Attributes
    protected
    Definition Classes
    Logging
  37. lazy val logger: Logger

    Definition Classes
    Logging
  38. val loggerName: String

    Definition Classes
    Logging
  39. val messageSet: FileMessageSet

  40. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  41. def nextOffset(): Long

    Calculate the offset that would be used for the next message to be append to this segment.

    Calculate the offset that would be used for the next message to be append to this segment. Note that this is expensive.

  42. final def notify(): Unit

    Definition Classes
    AnyRef
  43. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  44. def read(startOffset: Long, maxSize: Int, maxOffset: Option[Long]): MessageSet

    Read a message set from this segment beginning with the first offset greater than or equal to the startOffset.

    Read a message set from this segment beginning with the first offset greater than or equal to the startOffset. The message set will include no more than maxSize bytes and will end before maxOffset if a maxOffset is specified.

  45. def size: Long

    The total number of indexes in the range

    The total number of indexes in the range

    Definition Classes
    LogSegmentRange
  46. val start: Long

    The first index in the range

    The first index in the range

    Definition Classes
    LogSegmentRange
  47. def swallow(action: ⇒ Unit): Unit

    Definition Classes
    Logging
  48. def swallowDebug(action: ⇒ Unit): Unit

    Definition Classes
    Logging
  49. def swallowError(action: ⇒ Unit): Unit

    Definition Classes
    Logging
  50. def swallowInfo(action: ⇒ Unit): Unit

    Definition Classes
    Logging
  51. def swallowTrace(action: ⇒ Unit): Unit

    Definition Classes
    Logging
  52. def swallowWarn(action: ⇒ Unit): Unit

    Definition Classes
    Logging
  53. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  54. def toString(): String

    Definition Classes
    LogSegmentRange → AnyRef → Any
  55. def trace(msg: ⇒ String, e: ⇒ Throwable): Unit

    Definition Classes
    Logging
  56. def trace(e: ⇒ Throwable): Any

    Definition Classes
    Logging
  57. def trace(msg: ⇒ String): Unit

    Definition Classes
    Logging
  58. def truncateTo(offset: Long): Unit

    Truncate off all index and log entries with offsets greater than or equal to the current offset.

  59. def updateFirstAppendTime(): Unit

  60. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  61. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  62. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  63. def warn(msg: ⇒ String, e: ⇒ Throwable): Unit

    Definition Classes
    Logging
  64. def warn(e: ⇒ Throwable): Any

    Definition Classes
    Logging
  65. def warn(msg: ⇒ String): Unit

    Definition Classes
    Logging

Inherited from Logging

Inherited from Range

Inherited from AnyRef

Inherited from Any

Ungrouped