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;
17pub mod log_store;
18mod periodic_offset_fetcher;
19pub(crate) mod producer;
20#[cfg(test)]
21pub(crate) mod test_util;
22pub(crate) mod util;
23pub(crate) mod worker;
24
25pub use client_manager::DEFAULT_PARTITION;
26use serde::{Deserialize, Serialize};
27use store_api::logstore::entry::Id as EntryId;
28
29/// Kafka Namespace implementation.
30#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize, Deserialize)]
31pub struct NamespaceImpl {
32 pub region_id: u64,
33 pub topic: String,
34}
35
36/// Kafka Entry implementation.
37#[derive(Debug, PartialEq, Clone)]
38pub struct EntryImpl {
39 /// Entry payload.
40 pub data: Vec<u8>,
41 /// The logical entry id.
42 pub id: EntryId,
43 /// The namespace used to identify and isolate log entries from different regions.
44 pub ns: NamespaceImpl,
45}