blob: e74eae292fa47a6214499f880203742c2a5975aa [file]
// 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.
pub mod consumer_group_client_state;
mod error;
pub mod http;
mod macros;
mod traits;
mod types;
mod utils;
pub mod wire_conversions;
pub use error::client_error::ClientError;
pub use error::eviction::eviction_reason_to_error;
pub use error::iggy_error::{IggyError, IggyErrorDiscriminants};
// Locking is feature gated, thus only mod level re-export.
pub mod locking;
pub use chrono::{DateTime, Duration as ChronoDuration, Utc};
pub use consumer_group_client_state::ConsumerGroupClientState;
/// Sentinel `partition_id` in an otherwise-empty poll reply that tells the
/// client its cached consumer-group assignment is stale (a generation fence
/// rejected the partition it polled) and it must re-sync before retrying. The
/// VSR reply header carries no status field yet, so this rides the empty-poll
/// body -- an application payload, not a wire-format header. Never a real
/// partition id (those are small, dense, zero-based), so it can't collide with
/// a genuine end-of-partition empty poll, which echoes the real partition id.
pub const RESYNC_REQUIRED_PARTITION_SENTINEL: u32 = u32::MAX;
/// Client-side `partition_id` of an empty poll reply for a consumer-group
/// member that currently holds no partitions. The server never sends it: the
/// transport fills it in when the synced assignment is empty, so a caller can
/// tell "nothing assigned" from a genuine empty poll, which echoes the real
/// partition id. Same value as the Go and Node SDKs use for that case.
pub const NO_ASSIGNED_PARTITION: u32 = u32::MAX - 1;
/// Frozen ceiling on the widest batch record any admission path can persist.
/// Two knobs bound admission and both are validated against this at boot:
/// `message_bus.max_message_size` caps every bus-framed wire message, and
/// `http.max_request_size` caps the one path that is NOT bus-framed (the
/// HTTP produce handler builds its bus message in-process, so the request
/// body is what bounds its record). Frozen rather than knob-derived because
/// boot-time segment recovery sizes fixed scan and allocation limits from the
/// widest LEGAL record: a limit read from a live knob would change meaning
/// between boots and refuse partitions written under an older value.
///
/// Raising it is a compatibility decision, not a tuning change: segments
/// written under a larger value would exceed what recovery on an older build
/// accepts. The same applies to data from any build that admitted wider
/// records -- a deployment holding them cannot upgrade in place, because
/// recovery treats a record above the ceiling as implausible (truncating or
/// refusing the segment); such data must be drained and re-produced below
/// the ceiling first.
pub const MAX_MESSAGE_SIZE_UPPER_BYTES: u64 = 256 * 1024 * 1024;
pub use http::consumer_groups::*;
pub use http::consumer_offsets::*;
pub use http::messages::*;
pub use http::partitions::*;
pub use http::personal_access_tokens::*;
pub use http::segments::*;
pub use http::streams::*;
pub use http::system::*;
pub use http::topics::*;
pub use http::users::*;
pub use iggy_binary_protocol::responses::messages::{
SendMessagesConfirmationResponse, SendMessagesResponse,
};
pub use traits::binary_client::BinaryClient;
pub use traits::binary_transport::BinaryTransport;
pub use traits::binary_transport::{VsrSessionControl, VsrSessionSealed};
pub use traits::client::Client;
pub use traits::cluster_client::ClusterClient;
pub use traits::consumer_group_client::ConsumerGroupClient;
pub use traits::consumer_offset_client::ConsumerOffsetClient;
pub use traits::decode_send_confirmations;
pub use traits::message_client::MessageClient;
pub use traits::partition_client::PartitionClient;
pub use traits::partitioner::Partitioner;
pub use traits::personal_access_token_client::PersonalAccessTokenClient;
pub use traits::segment_client::SegmentClient;
pub use traits::sizeable::Sizeable;
pub use traits::stream_client::StreamClient;
pub use traits::system_client::SystemClient;
pub use traits::topic_client::TopicClient;
pub use traits::user_client::UserClient;
pub use traits::validatable::Validatable;
pub use types::args::*;
pub use types::client::client_info::*;
pub use types::client_state::ClientState;
pub use types::cluster::*;
pub use types::compression::compression_algorithm::*;
pub use types::configuration::auth_config::auto_login::*;
pub use types::configuration::auth_config::connection_string::*;
pub use types::configuration::auth_config::connection_string_options::*;
pub use types::configuration::auth_config::credentials::*;
pub use types::configuration::http_config::http_client_config::*;
pub use types::configuration::http_config::http_client_config_builder::*;
pub use types::configuration::http_config::http_connection_string_options::*;
pub use types::configuration::quic_config::quic_client_config::*;
pub use types::configuration::quic_config::quic_client_config_builder::*;
pub use types::configuration::quic_config::quic_client_reconnection_config::*;
pub use types::configuration::quic_config::quic_connection_string_options::*;
pub use types::configuration::tcp_config::tcp_client_config::*;
pub use types::configuration::tcp_config::tcp_client_config_builder::*;
pub use types::configuration::tcp_config::tcp_client_reconnection_config::*;
pub use types::configuration::tcp_config::tcp_connection_string_options::*;
pub use types::configuration::transport::TransportProtocol;
pub use types::configuration::websocket_config::websocket_client_config::*;
pub use types::configuration::websocket_config::websocket_client_config_builder::*;
pub use types::configuration::websocket_config::websocket_client_reconnection_config::*;
pub use types::configuration::websocket_config::websocket_connection_string_options::*;
pub use types::consumer::consumer_group::*;
pub use types::consumer::consumer_group_id::*;
pub use types::consumer::consumer_group_offsets::*;
pub use types::consumer::consumer_kind::*;
pub use types::consumer::consumer_offset::*;
pub use types::consumer::consumer_offset_info::*;
pub use types::consumer::consumer_offsets::*;
pub use types::diagnostic::diagnostic_event::DiagnosticEvent;
pub use types::either::Either;
pub use types::http::HttpMethod;
pub use types::identifier::*;
pub use types::message::*;
pub use types::options::*;
pub use types::partition::*;
pub use types::permissions::permissions_global::*;
pub use types::permissions::personal_access_token::*;
pub use types::personal_access_tokens::*;
pub use types::segment::Segment;
pub use types::snapshot::*;
pub use types::stats::*;
pub use types::stream::*;
pub use types::streaming_stats::*;
pub use types::topic::*;
pub use types::user::user_identity_info::*;
pub use types::user::user_info::*;
pub use types::user::user_status::*;
pub use utils::byte_size::IggyByteSize;
pub use utils::checksum::*;
pub use utils::crypto::*;
pub use utils::duration::{IggyDuration, NonZeroDurationError, NonZeroIggyDuration, SEC_IN_MICRO};
pub use utils::expiry::IggyExpiry;
pub use utils::hash::*;
pub use utils::net::validate_api_url;
pub use utils::net::validate_server_address;
pub use utils::personal_access_token_expiry::PersonalAccessTokenExpiry;
pub use utils::random_id;
pub use utils::serde_secret;
pub use utils::text;
pub use utils::timestamp::*;
pub use utils::topic_size::MaxTopicSize;
pub use utils::versioning::SemanticVersion;
pub const MAX_NAME_LENGTH: usize = 255;
pub const MAX_PARTITIONS_COUNT: u32 = 1000;