Browse Source

Improve backward compatibility by keeping FetchResponseBlock.Records

Ivan Babrou 8 years ago
parent
commit
3be0b7c29d
1 changed files with 5 additions and 0 deletions
  1. 5 0
      fetch_response.go

+ 5 - 0
fetch_response.go

@@ -33,6 +33,7 @@ type FetchResponseBlock struct {
 	HighWaterMarkOffset int64
 	LastStableOffset    int64
 	AbortedTransactions []*AbortedTransaction
+	Records             *Records // deprecated: use FetchResponseBlock.Records
 	RecordsSet          []*Records
 	Partial             bool
 }
@@ -109,6 +110,10 @@ func (b *FetchResponseBlock) decode(pd packetDecoder, version int16) (err error)
 		}
 
 		b.RecordsSet = append(b.RecordsSet, records)
+
+		if b.Records == nil {
+			b.Records = records
+		}
 	}
 
 	return nil