Browse Source

Update some constants and document.

The protocol spec wiki page was changed *as I was coding this* :P
Evan Huus 11 years ago
parent
commit
eb8e374888
2 changed files with 9 additions and 5 deletions
  1. 5 2
      offset_request.go
  2. 4 3
      produce_request.go

+ 5 - 2
offset_request.go

@@ -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 {

+ 4 - 3
produce_request.go

@@ -1,9 +1,10 @@
 package kafka
 
+// Special values accepted by Kafka for the ResponseCondition member of produce requests.
 const (
-	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 {