initialGlobalPriorityQueue will initialize a globalPriorityQueueWithLock and fetch one batch for each table column from batchInfosByColumn.
()
| 492 | // initialGlobalPriorityQueue will initialize a globalPriorityQueueWithLock and fetch |
| 493 | // one batch for each table column from batchInfosByColumn. |
| 494 | func (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. |
no test coverage detected