TransactionIndex
is a transaction index of a LogSegment.
TransactionIndex
is created when:
-
LogSegment
utility is used to open a log segment -
DumpLogSegments tool is used (to dump a transaction index (of a log segment))
TransactionIndex
takes the following to be created:
-
Underlying file (Java’s File)
TransactionIndex
initializes the internal properties.
While being created, TransactionIndex
opens a channel to the file if exists already.
append(
abortedTxn: AbortedTxn): Unit
append
…FIXME
Note
|
|
truncateTo(
offset: Long): Unit
truncateTo
…FIXME
Note
|
truncateTo is used when LogSegment is requested to truncate (to a given offset).
|
deleteIfExists(): Boolean
deleteIfExists
…FIXME
Note
|
deleteIfExists is used when LogSegment is requested to deleteIfExists.
|
collectAbortedTxns(
fetchOffset: Long,
upperBoundOffset: Long): TxnIndexSearchResult
collectAbortedTxns
…FIXME
Note
|
collectAbortedTxns is used when LogSegment is requested to collectAbortedTxns.
|
openChannel(): FileChannel
openChannel
uses Java’s FileChannel utility to open a file channel to the underlying file for read and write access (and creating a new file unless it exists already).
openChannel
registers the FileChannel
with the maybeChannel internal registry.
openChannel
sets the file position of the FileChannel
to be the very end of the file.
Note
|
openChannel is used when TransactionIndex is created (and the underlying file is available) and requested for the FileChannel.
|
channel(): FileChannel
channel
takes the FileChannel
out from the maybeChannel internal registry (if available) or opens a new FileChannel.
Note
|
channel is used when TransactionIndex is requested to append and truncateTo.
|
Name | Description |
---|---|
|
lastOffset: Option[Long] = None Used when…FIXME |
|