log_store/kafka.rs
1// Copyright 2023 Greptime Team
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15pub(crate) mod client_manager;
16pub(crate) mod consumer;
17mod high_watermark_manager;
18pub(crate) mod index;
19pub mod log_store;
20pub(crate) mod producer;
21#[cfg(test)]
22pub(crate) mod test_util;
23pub(crate) mod util;
24pub(crate) mod worker;
25
26pub use client_manager::DEFAULT_PARTITION;
27pub use index::{default_index_file, GlobalIndexCollector};
28use serde::{Deserialize, Serialize};
29use store_api::logstore::entry::Id as EntryId;
30
31/// Kafka Namespace implementation.
32#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize, Deserialize)]
33pub struct NamespaceImpl {
34 pub region_id: u64,
35 pub topic: String,
36}
37
38/// Kafka Entry implementation.
39#[derive(Debug, PartialEq, Clone)]
40pub struct EntryImpl {
41 /// Entry payload.
42 pub data: Vec<u8>,
43 /// The logical entry id.
44 pub id: EntryId,
45 /// The namespace used to identify and isolate log entries from different regions.
46 pub ns: NamespaceImpl,
47}