AddTableShard adds a reporter for the given table and shards. It should be called when bootstrap the table shards or shard ownership changes.
(tableName string, shardID int)
| 1089 | // AddTableShard adds a reporter for the given table and shards. It should |
| 1090 | // be called when bootstrap the table shards or shard ownership changes. |
| 1091 | func (f *ReporterFactory) AddTableShard(tableName string, shardID int) { |
| 1092 | f.Lock() |
| 1093 | defer f.Unlock() |
| 1094 | key := fmt.Sprintf("%s_%d", tableName, shardID) |
| 1095 | _, ok := f.reporters[key] |
| 1096 | if !ok { |
| 1097 | f.reporters[key] = NewReporter(f.rootReporter.GetRootScope().Tagged(map[string]string{ |
| 1098 | metricsTagTable: tableName, |
| 1099 | metricsTagShard: strconv.Itoa(shardID), |
| 1100 | })) |
| 1101 | } |
| 1102 | } |
| 1103 | |
| 1104 | // DeleteTableShard deletes the reporter for the given table and shards. It should |
| 1105 | // be called when the table shard no longer belongs to current node. |
nothing calls this directly
no test coverage detected