Browse Source

Rename client.Isr to client.InSyncReplicas

Kyle Hargraves 8 years ago
parent
commit
dbc0382c17
2 changed files with 6 additions and 4 deletions
  1. 5 3
      client.go
  2. 1 1
      client_test.go

+ 5 - 3
client.go

@@ -38,8 +38,10 @@ type Client interface {
 	// Replicas returns the set of all replica IDs for the given partition.
 	Replicas(topic string, partitionID int32) ([]int32, error)
 
-	// Isr returns the set of in-sync replica IDs for the given partition.
-	Isr(topic string, partitionID int32) ([]int32, error)
+	// InSyncReplicas returns the set of all in-sync replica IDs for the given
+	// partition. In-sync replicas are replicas which are fully caught up with
+	// the partition leader.
+	InSyncReplicas(topic string, partitionID int32) ([]int32, error)
 
 	// RefreshMetadata takes a list of topics and queries the cluster to refresh the
 	// available metadata for those topics. If no topics are provided, it will refresh
@@ -298,7 +300,7 @@ func (client *client) Replicas(topic string, partitionID int32) ([]int32, error)
 	return dupeAndSort(metadata.Replicas), nil
 }
 
-func (client *client) Isr(topic string, partitionID int32) ([]int32, error) {
+func (client *client) InSyncReplicas(topic string, partitionID int32) ([]int32, error) {
 	if client.Closed() {
 		return nil, ErrClosedClient
 	}

+ 1 - 1
client_test.go

@@ -196,7 +196,7 @@ func TestClientMetadata(t *testing.T) {
 		t.Error("Incorrect (or unsorted) replica")
 	}
 
-	isr, err = client.Isr("my_topic", 0)
+	isr, err = client.InSyncReplicas("my_topic", 0)
 	if err != nil {
 		t.Error(err)
 	} else if len(isr) != 2 {