浏览代码

Improve backward compatibility by keeping FetchResponseBlock.Records

Ivan Babrou 8 年之前
父节点
当前提交
3be0b7c29d
共有 1 个文件被更改,包括 5 次插入0 次删除
  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