Pārlūkot izejas kodu

Remove tokenRing.GetHostForPartitionKey (#1404)

This function is not used anymore.
Martin Sucha 5 gadi atpakaļ
vecāks
revīzija
cd92c541a0
2 mainītis faili ar 0 papildinājumiem un 11 dzēšanām
  1. 0 8
      token.go
  2. 0 3
      token_test.go

+ 0 - 8
token.go

@@ -202,14 +202,6 @@ func (t *tokenRing) String() string {
 	return string(buf.Bytes())
 }
 
-func (t *tokenRing) GetHostForPartitionKey(partitionKey []byte) (host *HostInfo, endToken token) {
-	if t == nil {
-		return nil, nil
-	}
-
-	return t.GetHostForToken(t.partitioner.Hash(partitionKey))
-}
-
 func (t *tokenRing) GetHostForToken(token token) (host *HostInfo, endToken token) {
 	if t == nil || len(t.tokens) == 0 {
 		return nil, nil

+ 0 - 3
token_test.go

@@ -204,9 +204,6 @@ func TestTokenRing_Nil(t *testing.T) {
 	if host, endToken := ring.GetHostForToken(nil); host != nil || endToken != nil {
 		t.Error("Expected nil for nil token ring")
 	}
-	if host, endToken := ring.GetHostForPartitionKey(nil); host != nil || endToken != nil {
-		t.Error("Expected nil for nil token ring")
-	}
 }
 
 // Test of the recognition of the partitioner class