MCPcopy
hub / github.com/uber/aresdb / FetchSchemas

Method FetchSchemas

client/schema.go:162–179  ·  view source on GitHub ↗

FetchSchemas fetch schemas in schemas of CachedSchemaHandler

()

Source from the content-addressed store, hash-verified

160
161// FetchSchemas fetch schemas in schemas of CachedSchemaHandler
162func (cf *CachedSchemaHandler) FetchSchemas() {
163 cf.RLock()
164 tables := make([]string, 0, len(cf.schemas))
165 for tableName := range cf.schemas {
166 tables = append(tables, tableName)
167 }
168 cf.RUnlock()
169
170 for _, tableName := range tables {
171 _, err := cf.FetchSchema(tableName)
172 if err != nil {
173 cf.logger.With("error", err.Error(),
174 "table", tableName).Errorf("Failed to fetch table schema")
175 }
176 }
177
178 return
179}
180
181// FetchSchema fetchs the schema of given table name
182func (cf *CachedSchemaHandler) FetchSchema(tableName string) (*TableSchema, error) {

Callers 1

StartMethod · 0.95

Calls 6

FetchSchemaMethod · 0.95
RLockMethod · 0.65
RUnlockMethod · 0.65
ErrorfMethod · 0.65
WithMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected