Skip to content

Commit d93886f

Browse files
authored
metadata: remove class from keyspace strategy options. (#1051)
1 parent 697e7c5 commit d93886f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

metadata.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,8 +426,9 @@ func getKeyspaceMetadata(session *Session, keyspaceName string) (*KeyspaceMetada
426426
}
427427

428428
keyspace.StrategyClass = replication["class"]
429+
delete(replication, "class")
429430

430-
keyspace.StrategyOptions = make(map[string]interface{})
431+
keyspace.StrategyOptions = make(map[string]interface{}, len(replication))
431432
for k, v := range replication {
432433
keyspace.StrategyOptions[k] = v
433434
}

topology.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ func getStrategy(ks *KeyspaceMetadata) placementStrategy {
4040
case strings.Contains(ks.StrategyClass, "NetworkTopologyStrategy"):
4141
dcs := make(map[string]int)
4242
for dc, rf := range ks.StrategyOptions {
43+
if dc == "class" {
44+
continue
45+
}
46+
4347
dcs[dc] = getReplicationFactorFromOpts(ks.Name+":dc="+dc, rf)
4448
}
4549
return &networkTopology{dcs: dcs}

0 commit comments

Comments
 (0)