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

Function NewMemStore

memstore/memstore.go:113–125  ·  view source on GitHub ↗

NewMemStore creates a MemStore from the specified MetaStore.

(metaStore metaCom.MetaStore, diskStore diskstore.DiskStore, options Options)

Source from the content-addressed store, hash-verified

111
112// NewMemStore creates a MemStore from the specified MetaStore.
113func NewMemStore(metaStore metaCom.MetaStore, diskStore diskstore.DiskStore, options Options) MemStore {
114 memStore := &memStoreImpl{
115 TableShards: make(map[string]map[int]*TableShard),
116 TableSchemas: make(map[string]*common.TableSchema),
117 metaStore: metaStore,
118 diskStore: diskStore,
119 options: options,
120 }
121 // Create HostMemoryManager
122 memStore.HostMemManager = NewHostMemoryManager(memStore, utils.GetConfig().TotalMemorySize)
123 memStore.scheduler = newScheduler(memStore)
124 return memStore
125}
126
127func (m *memStoreImpl) GetMemoryUsageDetails() (map[string]TableShardMemoryUsage, error) {
128 archiveMemoryUsageByTableShard, err := m.HostMemManager.GetArchiveMemoryUsageByTableShard()

Callers 6

startFunction · 0.92
NewDataNodeFunction · 0.92
NewMockMemStoreMethod · 0.85
createMemStoreFunction · 0.85
bootstrap_test.goFile · 0.85

Calls 3

GetConfigFunction · 0.92
NewHostMemoryManagerFunction · 0.85
newSchedulerFunction · 0.85

Tested by 1

createMemStoreFunction · 0.68