| 119 | |
| 120 | |
| 121 | void BatchTask::AddTask(shared_ptr<Task> task) { |
| 122 | auto req = task->GetReq(); |
| 123 | if (nullptr == req) return; |
| 124 | if (0 == start_timestamp_ms_) start_timestamp_ms_ = comm::utils::Time::GetSteadyClockMS(); |
| 125 | |
| 126 | nbyte_ += req->ByteSize(); |
| 127 | nitems_ += req->items_size(); |
| 128 | |
| 129 | tasks_.push_back(task); |
| 130 | } |
| 131 | |
| 132 | bool BatchTask::Ready(uint64_t *ready_timestamp_ms) { |
| 133 | if (ready_timestamp_ms) *ready_timestamp_ms = 0; |