-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
23 changed files
with
973 additions
and
363 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,5 @@ | |
* limitations under the License. | ||
*/ | ||
|
||
pub(crate) mod manager; | ||
mod consumer_filter_data; | ||
pub(crate) mod manager; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
use rocketmq_filter::utils::bloom_filter_data::BloomFilterData; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Clone, Debug, Serialize, Deserialize, Default)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct ConsumerFilterData { | ||
consumer_group: String, | ||
topic: String, | ||
expression: String, | ||
expression_type: String, | ||
//compiled_expression: Expression, | ||
born_time: u64, | ||
dead_time: u64, | ||
bloom_filter_data: BloomFilterData, | ||
client_version: u64, | ||
} | ||
|
||
impl ConsumerFilterData { | ||
pub fn consumer_group(&self) -> &str { | ||
&self.consumer_group | ||
} | ||
pub fn topic(&self) -> &str { | ||
&self.topic | ||
} | ||
pub fn expression(&self) -> &str { | ||
&self.expression | ||
} | ||
pub fn expression_type(&self) -> &str { | ||
&self.expression_type | ||
} | ||
pub fn born_time(&self) -> u64 { | ||
self.born_time | ||
} | ||
pub fn dead_time(&self) -> u64 { | ||
self.dead_time | ||
} | ||
pub fn bloom_filter_data(&self) -> &BloomFilterData { | ||
&self.bloom_filter_data | ||
} | ||
pub fn client_version(&self) -> u64 { | ||
self.client_version | ||
} | ||
pub fn set_consumer_group(&mut self, consumer_group: String) { | ||
self.consumer_group = consumer_group; | ||
} | ||
pub fn set_topic(&mut self, topic: String) { | ||
self.topic = topic; | ||
} | ||
pub fn set_expression(&mut self, expression: String) { | ||
self.expression = expression; | ||
} | ||
pub fn set_expression_type(&mut self, expression_type: String) { | ||
self.expression_type = expression_type; | ||
} | ||
pub fn set_born_time(&mut self, born_time: u64) { | ||
self.born_time = born_time; | ||
} | ||
pub fn set_dead_time(&mut self, dead_time: u64) { | ||
self.dead_time = dead_time; | ||
} | ||
pub fn set_bloom_filter_data(&mut self, bloom_filter_data: BloomFilterData) { | ||
self.bloom_filter_data = bloom_filter_data; | ||
} | ||
pub fn set_client_version(&mut self, client_version: u64) { | ||
self.client_version = client_version; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
rocketmq-broker/src/filter/manager/consumer_filter_wrapper.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
use std::collections::HashMap; | ||
|
||
use rocketmq_remoting::protocol::DataVersion; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
use crate::filter::consumer_filter_data::ConsumerFilterData; | ||
|
||
#[derive(Clone, Debug, Serialize, Deserialize, Default)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct ConsumerFilterWrapper { | ||
filter_data_by_topic: HashMap<String /* Topic */, FilterDataMapByTopic>, | ||
} | ||
|
||
#[derive(Clone, Debug, Serialize, Deserialize, Default)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct FilterDataMapByTopic { | ||
filter_data_map: HashMap<String /* consumer group */, ConsumerFilterData>, | ||
topic: DataVersion, | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
rocketmq-broker/src/offset/manager/consumer_order_info_lock_manager.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
use crate::offset::manager::consumer_order_info_manager::ConsumerOrderInfoWrapper; | ||
|
||
pub struct ConsumerOrderInfoLockManager {} | ||
|
||
impl ConsumerOrderInfoLockManager { | ||
pub fn recover(&mut self, _consumer_order_info_wrapper: &ConsumerOrderInfoWrapper) {} | ||
} | ||
|
Oops, something went wrong.