Review Board 1.7.22


Log.getOffsetsBefore(t, …) does not return the last confirmed offset before t

Review Request #14771 - Created Oct. 19, 2013 and updated

Swapnil Ghike
KAFKA-1093
Reviewers
kafka
kafka
Log.getOffsetsBefore(t, …) does not return the last confirmed offset before t
Unit tests pass.

Diff revision 1 (Latest)

  1. core/src/main/scala/kafka/log/Log.scala: Loading...
core/src/main/scala/kafka/log/Log.scala
Revision f6348969ea38258065f4de358bfbf3f20b4eb74a New Change
[20] 560 lines
[+20]
561
    if(segsArray.last.size > 0)
561
    if(segsArray.last.size > 0)
562
      offsetTimeArray = new Array[(Long, Long)](segsArray.length + 1)
562
      offsetTimeArray = new Array[(Long, Long)](segsArray.length + 1)
563
    else
563
    else
564
      offsetTimeArray = new Array[(Long, Long)](segsArray.length)
564
      offsetTimeArray = new Array[(Long, Long)](segsArray.length)
565

    
   
565

   
566
    for(i <- 0 until segsArray.length)
566
    for(i <- 0 until segsArray.length) {

    
   
567
      if (segsArray(i).size > 0)

    
   
568
        offsetTimeArray(i) = (segsArray(i).start, segsArray(i).firstAppendTime.get)

    
   
569
      else
567
      offsetTimeArray(i) = (segsArray(i).start, segsArray(i).messageSet.file.lastModified)
570
        offsetTimeArray(i) = (segsArray(i).start, segsArray(i).messageSet.file.lastModified)

    
   
571
    }
568
    if(segsArray.last.size > 0)
572
    if(segsArray.last.size > 0)
569
      offsetTimeArray(segsArray.length) = (logEndOffset, time.milliseconds)
573
      offsetTimeArray(segsArray.length) = (logEndOffset, time.milliseconds)
570

    
   
574

   
571
    var startIndex = -1
575
    var startIndex = -1
572
    timestamp match {
576
    timestamp match {
[+20] [20] 115 lines
  1. core/src/main/scala/kafka/log/Log.scala: Loading...