kafka.log

LogSegment

class LogSegment extends 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, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. LogSegment
  2. Logging
  3. AnyRef
  4. 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, rollJitterMs: Long, time: Time)

  2. new LogSegment(log: FileMessageSet, index: OffsetIndex, baseOffset: Long, indexIntervalBytes: Int, rollJitterMs: Long, time: Time)

    log

    The message set containing log entries

    index

    The offset index

    baseOffset

    A lower bound on the offsets in this segment

    indexIntervalBytes

    The approximate number of bytes between entries in the index

    time

    The time instance

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.

    offset

    The first offset in the message set.

    messages

    The messages to append.

    Annotations
    @nonthreadsafe()
  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. val baseOffset: Long

    A lower bound on the offsets in this segment

  9. def changeFileSuffixes(oldSuffix: String, newSuffix: String): Unit

    Change the suffix for the index and log file for this log segment

  10. def clone(): AnyRef

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

    Close this log segment

  12. var created: Long

  13. def debug(msg: ⇒ String, e: ⇒ Throwable): Unit

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

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

    Definition Classes
    Logging
  16. def delete(): Unit

    Delete this log segment from the filesystem.

    Delete this log segment from the filesystem.

    Exceptions thrown
    KafkaStorageException

    if the delete fails.

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

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

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

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

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

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

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

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

    Definition Classes
    Logging
  25. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  26. def flush(): Unit

    Flush this log segment to disk

    Flush this log segment to disk

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

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

    Definition Classes
    AnyRef → Any
  29. val index: OffsetIndex

    The offset index

  30. val indexIntervalBytes: Int

    The approximate number of bytes between entries in the index

  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. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  35. def lastModified: Long

    The last modified time of this log segment as a unix time stamp

  36. def lastModified_=(ms: Long): Boolean

    Change the last modified time for this log segment

  37. val log: FileMessageSet

    The message set containing log entries

  38. var logIdent: String

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

    Definition Classes
    Logging
  40. val loggerName: String

    Definition Classes
    Logging
  41. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  42. 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.

    Annotations
    @threadsafe()
  43. final def notify(): Unit

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

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

    Read a message set from this segment beginning with the first offset >= startOffset.

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

    startOffset

    A lower bound on the first offset to include in the message set we read

    maxOffset

    An optional maximum offset for the message set we read

    maxSize

    The maximum number of bytes to include in the message set we read

    returns

    The fetched data and the offset metadata of the first message whose offset is >= startOffset, or null if the startOffset is larger than the largest offset in this log

    Annotations
    @threadsafe()
  46. def recover(maxMessageSize: Int): Int

    Run recovery on the given segment.

    Run recovery on the given segment. This will rebuild the index from the log file and lop off any invalid bytes from the end of the log and index.

    maxMessageSize

    A bound the memory allocation in the case of a corrupt message size--we will assume any message larger than this is corrupt.

    returns

    The number of bytes truncated from the log

    Annotations
    @nonthreadsafe()
  47. val rollJitterMs: Long

  48. def size: Long

  49. def swallow(action: ⇒ Unit): Unit

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

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

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

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

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

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

    Definition Classes
    AnyRef
  56. def toString(): String

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

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

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

    Definition Classes
    Logging
  60. def truncateTo(offset: Long): Int

    Truncate off all index and log entries with offsets >= the given offset.

    Truncate off all index and log entries with offsets >= the given offset. If the given offset is larger than the largest message in this segment, do nothing.

    offset

    The offset to truncate to

    returns

    The number of log bytes truncated

    Annotations
    @nonthreadsafe()
  61. final def wait(): Unit

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

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

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

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

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

    Definition Classes
    Logging

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped