@@ -18,8 +18,8 @@ type Tablet struct {
18
18
Type topodata.TabletType `json:"type,omitempty"`
19
19
}
20
20
21
- // isReplica returns a bool reflecting if a tablet type is REPLICA
22
- func (t Tablet ) isReplica () bool {
21
+ // IsValidReplica returns a bool reflecting if a tablet type is REPLICA
22
+ func (t Tablet ) IsValidReplica () bool {
23
23
return t .Type == topodata .TabletType_REPLICA
24
24
}
25
25
@@ -40,15 +40,15 @@ func constructAPIURL(api string, keyspace string, shard string) (url string) {
40
40
// filterReplicaTablets parses a list of tablets, returning replica tablets only
41
41
func filterReplicaTablets (tablets []Tablet ) (replicas []Tablet ) {
42
42
for _ , tablet := range tablets {
43
- if tablet .isReplica () {
43
+ if tablet .IsValidReplica () {
44
44
replicas = append (replicas , tablet )
45
45
}
46
46
}
47
47
return replicas
48
48
}
49
49
50
50
// ParseTablets reads from vitess /api/ks_tablets/<keyspace>/[shard] and returns a
51
- // listing (mysql_hostname, mysql_port) of REPLICA tablets
51
+ // listing (mysql_hostname, mysql_port, type ) of REPLICA tablets
52
52
func ParseTablets (api string , keyspace string , shard string ) (tablets []Tablet , err error ) {
53
53
url := constructAPIURL (api , keyspace , shard )
54
54
resp , err := httpClient .Get (url )
0 commit comments