// Init memory schemas including infoschema and perfshcema. func newMemSchemaHandle() (*memSchemaHandle, error) { h := &memSchemaHandle{ nameToTable: make(map[string]table.Table), } err := initMemoryTables(h) if err != nil { return nil, errors.Trace(err) } h.perfHandle, err = perfschema.NewPerfHandle() if err != nil { return nil, errors.Trace(err) } return h, nil }
// NewHandle creates a new Handle. func NewHandle(store kv.Storage) (*Handle, error) { h := &Handle{ store: store, } // init memory tables var err error h.perfHandle, err = perfschema.NewPerfHandle() if err != nil { return nil, errors.Trace(err) } if err != nil { return nil, errors.Trace(err) } return h, nil }
func initPerfSchema(store kv.Storage) { perfHandle = perfschema.NewPerfHandle(store) }