The protocol spec wiki page was changed *as I was coding this* :P
@@ -2,8 +2,11 @@ package kafka
// Special values accepted by Kafka for the 'time' parameter of OffsetRequest.AddBlock().
const (
- LATEST_OFFSET int64 = -1
- EARLIEST_OFFSETS int64 = -2
+ // Ask for the latest offsets.
+ LATEST_OFFSETS int64 = -1
+ // Ask for the earliest available offset. Note that because offsets are pulled in descending order,
+ // asking for the earliest offset will always return you a single element.
+ EARLIEST_OFFSET int64 = -2
)
type offsetRequestBlock struct {
@@ -1,9 +1,10 @@
package kafka
+// Special values accepted by Kafka for the ResponseCondition member of produce requests.
- NO_RESPONSE int16 = 0
- WAIT_FOR_LOCAL int16 = 1
- WAIT_FOR_ALL int16 = -1
+ NO_RESPONSE int16 = 0 // Don't send any response, the TCP ACK is all you get.
+ WAIT_FOR_LOCAL int16 = 1 // Wait for only the local commit to succeed before responding.
+ WAIT_FOR_ALL int16 = -1 // Wait for all replicas to commit before responding.
type ProduceRequest struct {