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

Method initialGlobalPriorityQueue

memstore/host_memory_manager.go:494–509  ·  view source on GitHub ↗

initialGlobalPriorityQueue will initialize a globalPriorityQueueWithLock and fetch one batch for each table column from batchInfosByColumn.

()

Source from the content-addressed store, hash-verified

492// initialGlobalPriorityQueue will initialize a globalPriorityQueueWithLock and fetch
493// one batch for each table column from batchInfosByColumn.
494func (h *hostMemoryManager) initialGlobalPriorityQueue() *globalPriorityQueue {
495 gpq := newGlobalPriorityQueue()
496 utils.GetLogger().Debugf("Trying to init priority queue to hold batch objects")
497 h.RLock()
498 for tableName, columnsBatchesList := range h.batchInfosByColumn {
499 utils.GetLogger().Debugf("Looking at table:%s, columnsBatchesList.size() = %d", tableName, len(columnsBatchesList))
500 for columnID, columnBatchInfos := range columnsBatchesList {
501 columnBatchIt := columnBatchInfos.batchInfoByID.Iterator()
502 if columnBatchIt.Next() {
503 gpq.pushBatchIntoGlobalPriorityQueue(h, columnBatchInfos, columnID, columnBatchIt)
504 }
505 }
506 }
507 h.RUnlock()
508 return gpq
509}
510
511// globalPriority is the holding struct for all the neccesarry fields to
512// compare batch priority in a global view.

Callers 1

tryEvictionMethod · 0.95

Calls 7

GetLoggerFunction · 0.92
newGlobalPriorityQueueFunction · 0.85
DebugfMethod · 0.65
RLockMethod · 0.65
IteratorMethod · 0.65
RUnlockMethod · 0.65

Tested by

no test coverage detected