MINOR: Improve TransactionIndex.sanityCheck() message

Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Jason Gustafson <jason@confluent.io>

Closes #3446 from ijuma/improve-transaction-index-exception-sanity-check
This commit is contained in:
Ismael Juma 2017-06-29 09:51:04 -07:00 committed by Jason Gustafson
parent dc95456f1d
commit 27fdd46dcd
1 changed files with 2 additions and 1 deletions

View File

@ -174,7 +174,8 @@ class TransactionIndex(val startOffset: Long, @volatile var file: File) extends
def sanityCheck(): Unit = { def sanityCheck(): Unit = {
val buffer = ByteBuffer.allocate(AbortedTxn.TotalSize) val buffer = ByteBuffer.allocate(AbortedTxn.TotalSize)
for ((abortedTxn, _) <- iterator(() => buffer)) { for ((abortedTxn, _) <- iterator(() => buffer)) {
require(abortedTxn.lastOffset >= startOffset) require(abortedTxn.lastOffset >= startOffset, s"Last offset of aborted transaction $abortedTxn is less than " +
s"start offset $startOffset")
} }
} }