| 130 | } |
| 131 | |
| 132 | bool BatchTask::Ready(uint64_t *ready_timestamp_ms) { |
| 133 | if (ready_timestamp_ms) *ready_timestamp_ms = 0; |
| 134 | |
| 135 | if (0 == nitems_ || 0 == start_timestamp_ms_) return false; |
| 136 | |
| 137 | auto now_timestamp_ms = comm::utils::Time::GetSteadyClockMS(); |
| 138 | |
| 139 | if (nbyte_ * 2 >= items_byte_size_limit_ || |
| 140 | nitems_ * 2 >= batch_limit_ || |
| 141 | start_timestamp_ms_ + producer_batch_delay_time_ms_ <= now_timestamp_ms) { |
| 142 | return true; |
| 143 | } |
| 144 | if (ready_timestamp_ms) *ready_timestamp_ms = start_timestamp_ms_ + producer_batch_delay_time_ms_; |
| 145 | |
| 146 | return false; |
| 147 | } |
| 148 | |
| 149 | comm::RetCode BatchTask::Process(bool is_timeout) { |
| 150 | auto now_timestamp_ms = comm::utils::Time::GetSteadyClockMS(); |
no outgoing calls
no test coverage detected