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

Method FetchSchema

client/schema.go:182–196  ·  view source on GitHub ↗

FetchSchema fetchs the schema of given table name

(tableName string)

Source from the content-addressed store, hash-verified

180
181// FetchSchema fetchs the schema of given table name
182func (cf *CachedSchemaHandler) FetchSchema(tableName string) (*TableSchema, error) {
183 cf.RLock()
184 schema, exist := cf.schemas[tableName]
185 cf.RUnlock()
186 if exist {
187 return schema, nil
188 }
189 table, err := cf.schemaFetcher.FetchSchema(tableName)
190 if err != nil {
191 return nil, err
192 }
193 schema = cf.setTable(table)
194 err = cf.fetchAndSetEnumCases(table)
195 return schema, err
196}
197
198// PrepareEnumCases prepares enum cases
199func (cf *CachedSchemaHandler) PrepareEnumCases(tableName, columnName string, enumCases []string) error {

Callers 1

FetchSchemasMethod · 0.95

Calls 5

setTableMethod · 0.95
fetchAndSetEnumCasesMethod · 0.95
RLockMethod · 0.65
RUnlockMethod · 0.65
FetchSchemaMethod · 0.65

Tested by

no test coverage detected