FindDeviceForQuery calls device manager to find a device for the query
(memStore memstore.MemStore, preferredDevice int, deviceManager *DeviceManager, timeout int)
| 1287 | |
| 1288 | // FindDeviceForQuery calls device manager to find a device for the query |
| 1289 | func (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 | |
| 1307 | func (qc *AQLQueryContext) runBatchExecutor(e BatchExecutor, isLastBatch bool) { |
| 1308 | start := utils.Now() |
no test coverage detected