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

Method FindDeviceForQuery

query/aql_processor.go:1289–1305  ·  view source on GitHub ↗

FindDeviceForQuery calls device manager to find a device for the query

(memStore memstore.MemStore, preferredDevice int,
	deviceManager *DeviceManager, timeout int)

Source from the content-addressed store, hash-verified

1287
1288// FindDeviceForQuery calls device manager to find a device for the query
1289func (qc *AQLQueryContext) FindDeviceForQuery(memStore memstore.MemStore, preferredDevice int,
1290 deviceManager *DeviceManager, timeout int) {
1291 memoryRequired := qc.calculateMemoryRequirement(memStore)
1292 if qc.Error != nil {
1293 return
1294 }
1295
1296 qc.OOPK.DeviceMemoryRequirement = memoryRequired
1297
1298 waitStart := utils.Now()
1299 device := deviceManager.FindDevice(qc.Query, memoryRequired, preferredDevice, timeout)
1300 if device == -1 {
1301 qc.Error = utils.StackError(nil, "Unable to find device to run this query")
1302 }
1303 qc.OOPK.DurationWaitedForDevice = utils.Now().Sub(waitStart)
1304 qc.Device = device
1305}
1306
1307func (qc *AQLQueryContext) runBatchExecutor(e BatchExecutor, isLastBatch bool) {
1308 start := utils.Now()

Callers 3

handleAQLInternalMethod · 0.95
handleQueryFunction · 0.80

Calls 4

NowFunction · 0.92
StackErrorFunction · 0.92
FindDeviceMethod · 0.80

Tested by

no test coverage detected