| 526 | |
| 527 | |
| 528 | std::unique_ptr<ral::cache::CacheData> CacheMachine::pullCacheData(std::string message_id) { |
| 529 | CodeTimer cacheEventTimer; |
| 530 | cacheEventTimer.start(); |
| 531 | |
| 532 | std::unique_ptr<message> message_data = waitingCache->get_or_wait(message_id); |
| 533 | if (message_data == nullptr) { |
| 534 | return nullptr; |
| 535 | } |
| 536 | size_t num_rows = message_data->get_data().num_rows(); |
| 537 | size_t num_bytes = message_data->get_data().sizeInBytes(); |
| 538 | int dataType = static_cast<int>(message_data->get_data().get_type()); |
| 539 | std::unique_ptr<ral::cache::CacheData> output = message_data->release_data(); |
| 540 | |
| 541 | cacheEventTimer.stop(); |
| 542 | if(cache_events_logger) { |
| 543 | cache_events_logger->info("{ral_id}|{query_id}|{message_id}|{cache_id}|{num_rows}|{num_bytes}|{event_type}|{timestamp_begin}|{timestamp_end}|{description}", |
| 544 | "ral_id"_a=(ctx ? ctx->getNodeIndex(ral::communication::CommunicationData::getInstance().getSelfNode()) : -1), |
| 545 | "query_id"_a=(ctx ? ctx->getContextToken() : -1), |
| 546 | "message_id"_a=message_id, |
| 547 | "cache_id"_a=cache_id, |
| 548 | "num_rows"_a=num_rows, |
| 549 | "num_bytes"_a=num_bytes, |
| 550 | "event_type"_a="PullCacheData", |
| 551 | "timestamp_begin"_a=cacheEventTimer.start_time(), |
| 552 | "timestamp_end"_a=cacheEventTimer.end_time(), |
| 553 | "description"_a="Pull from CacheMachine CacheData object type {}"_format(dataType)); |
| 554 | } |
| 555 | return output; |
| 556 | } |
| 557 | |
| 558 | std::unique_ptr<ral::frame::BlazingTable> CacheMachine::pullUnorderedFromCache() { |
| 559 | if (is_array_access) { |