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

Method GetTable

controller/mutators/etcd/schema_mutator.go:58–87  ·  view source on GitHub ↗
(namespace, name string)

Source from the content-addressed store, hash-verified

56}
57
58func (m *tableSchemaMutator) GetTable(namespace, name string) (table *metaCom.Table, err error) {
59 var schemaProto pb.EntityConfig
60 schemaProto, _, err = m.readSchema(namespace, name)
61 if err != nil {
62 return
63 }
64
65 if schemaProto.Tomstoned {
66 return nil, metaCom.ErrTableDoesNotExist
67 }
68
69 table = &metaCom.Table{}
70 table.Config = metaCom.TableConfig{
71 BatchSize: metastore.DefaultBatchSize,
72 ArchivingIntervalMinutes: metastore.DefaultArchivingIntervalMinutes,
73 ArchivingDelayMinutes: metastore.DefaultArchivingDelayMinutes,
74 BackfillMaxBufferSize: metastore.DefaultBackfillMaxBufferSize,
75 BackfillIntervalMinutes: metastore.DefaultBackfillIntervalMinutes,
76 BackfillThresholdInBytes: metastore.DefaultBackfillThresholdInBytes,
77 BackfillStoreBatchSize: metastore.DefaultBackfillStoreBatchSize,
78 RecordRetentionInDays: metastore.DefaultRecordRetentionInDays,
79 SnapshotIntervalMinutes: metastore.DefaultSnapshotIntervalMinutes,
80 SnapshotThreshold: metastore.DefaultSnapshotThreshold,
81 RedoLogRotationInterval: metastore.DefaultRedologRotationInterval,
82 MaxRedoLogFileSize: metastore.DefaultMaxRedoLogSize,
83 }
84
85 err = json.Unmarshal(schemaProto.Config, &table)
86 return table, err
87}
88
89func (m *tableSchemaMutator) CreateTable(namespace string, table *metaCom.Table, force bool) (err error) {
90 if !force {

Callers 1

TestSchemaMutatorFunction · 0.95

Calls 1

readSchemaMethod · 0.95

Tested by 1

TestSchemaMutatorFunction · 0.76