MCPcopy Create free account
hub / github.com/Tencent/phxqueue / BatchTask

Class BatchTask

phxqueue/producer/batchhelper.cpp:82–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80////////////////////////////////////////////////////////////////////////////////////
81
82class BatchTask {
83public:
84 BatchTask(int topic_id, Producer *producer) : topic_id_(topic_id), producer_(producer) {}
85 ~BatchTask() {}
86
87 void Init();
88 void AddTask(shared_ptr<Task> task);
89 bool Ready(uint64_t *ready_timestamp_ms = nullptr);
90 comm::RetCode Process(bool is_timeout = false);
91
92private:
93 int topic_id_;
94 Producer *producer_ = nullptr;
95 vector<shared_ptr<Task>> tasks_;
96
97 uint32_t nbyte_ = 0;
98 uint32_t nitems_ = 0;
99 uint64_t start_timestamp_ms_ = 0;
100
101 uint32_t items_byte_size_limit_ = 0;
102 uint32_t batch_limit_ = 0;
103 uint32_t producer_batch_delay_time_ms_ = 0;
104};
105
106
107void BatchTask::Init() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected