Skip to content

Commit abf753d

Browse files
authored
[ISSUE #2065]💫Implement PopReviveService-1🚀 (#2072)
1 parent 66a198e commit abf753d

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

rocketmq-broker/src/processor/processor_service/pop_revive_service.rs

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,40 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17+
use std::collections::BTreeMap;
1718
use std::collections::HashMap;
19+
use std::sync::Arc;
20+
use std::thread::JoinHandle;
1821

1922
use cheetah_string::CheetahString;
2023
use rocketmq_store::pop::pop_check_point::PopCheckPoint;
2124

22-
pub struct PopReviveService;
25+
pub struct PopReviveService {
26+
queue_id: i32,
27+
revive_topic: CheetahString,
28+
current_revive_message_timestamp: i64,
29+
should_run_pop_revive: bool,
30+
inflight_revive_request_map: Arc<parking_lot::Mutex<BTreeMap<PopCheckPoint, (i64, bool)>>>,
31+
revive_offset: i64,
32+
ck_rewrite_intervals_in_seconds: [i32; 17],
33+
join_handle: Option<JoinHandle<()>>,
34+
}
35+
impl PopReviveService {
36+
pub fn new(revive_topic: CheetahString, queue_id: i32, revive_offset: i64) -> Self {
37+
Self {
38+
queue_id,
39+
revive_topic,
40+
current_revive_message_timestamp: -1,
41+
should_run_pop_revive: false,
42+
inflight_revive_request_map: Arc::new(Default::default()),
43+
revive_offset,
44+
ck_rewrite_intervals_in_seconds: [
45+
10, 20, 30, 60, 120, 180, 240, 300, 360, 420, 480, 540, 600, 1200, 1800, 3600, 7200,
46+
],
47+
join_handle: None,
48+
}
49+
}
50+
}
2351

2452
struct ConsumeReviveObj {
2553
map: HashMap<CheetahString, PopCheckPoint>,

0 commit comments

Comments
 (0)