You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by hg...@apache.org on 2025/05/10 21:27:42 UTC
(iggy) branch master updated: chore(repo): update Rust edition to 2024 across multiple Cargo.toml files (#1772)
This is an automated email from the ASF dual-hosted git repository.
hgruszecki pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iggy.git
The following commit(s) were added to refs/heads/master by this push:
new 50fd0af0 chore(repo): update Rust edition to 2024 across multiple Cargo.toml files (#1772)
50fd0af0 is described below
commit 50fd0af0ce16f1dc121c284614b4379dfbef2e80
Author: Hubert Gruszecki <h....@gmail.com>
AuthorDate: Sat May 10 23:27:39 2025 +0200
chore(repo): update Rust edition to 2024 across multiple Cargo.toml files (#1772)
Additionally, the Dockerfile has been updated to use Rust version 1.86,
aligning with the new edition requirements.
---
core/bench/Cargo.toml | 2 +-
core/bench/dashboard/frontend/Cargo.toml | 2 +-
.../frontend/src/components/app_content.rs | 8 +-
.../frontend/src/components/chart/plot_trend.rs | 2 +-
.../frontend/src/components/chart/single_chart.rs | 2 +-
.../frontend/src/components/chart/trend_chart.rs | 2 +-
.../frontend/src/components/layout/main_content.rs | 2 +-
.../frontend/src/components/layout/sidebar.rs | 4 +-
.../frontend/src/components/layout/topbar.rs | 2 +-
.../src/components/selectors/benchmark_selector.rs | 2 +-
.../src/components/selectors/hardware_selector.rs | 2 +-
.../src/components/selectors/view_mode_selector.rs | 2 +-
core/bench/dashboard/server/Cargo.toml | 2 +-
core/bench/dashboard/server/Dockerfile | 2 +-
core/bench/dashboard/server/src/args.rs | 2 +-
core/bench/dashboard/server/src/github/client.rs | 4 +-
core/bench/dashboard/server/src/handlers.rs | 4 +-
core/bench/dashboard/server/src/main.rs | 5 +-
core/bench/dashboard/shared/Cargo.toml | 2 +-
core/bench/report/Cargo.toml | 2 +-
core/bench/report/src/plotting/chart.rs | 2 +-
core/bench/runner/Cargo.toml | 2 +-
.../bench/runner/src/app/local_benchmark_runner.rs | 2 +-
core/bench/runner/src/main.rs | 2 +-
core/bench/src/actors/consumer.rs | 9 +-
core/bench/src/actors/producer.rs | 2 +-
core/bench/src/actors/producing_consumer.rs | 29 +++---
core/bench/src/analytics/metrics/group.rs | 2 +-
core/bench/src/analytics/metrics/individual.rs | 2 +-
.../time_series/calculators/throughput.rs | 2 +-
.../src/args/kinds/balanced/consumer_group.rs | 2 +-
core/bench/src/args/kinds/balanced/producer.rs | 2 +-
.../kinds/balanced/producer_and_consumer_group.rs | 2 +-
.../args/kinds/end_to_end/producing_consumer.rs | 2 +-
.../kinds/end_to_end/producing_consumer_group.rs | 2 +-
core/bench/src/args/kinds/pinned/consumer.rs | 2 +-
core/bench/src/args/kinds/pinned/producer.rs | 2 +-
.../src/args/kinds/pinned/producer_and_consumer.rs | 2 +-
.../src/benchmarks/balanced_consumer_group.rs | 4 +-
core/bench/src/benchmarks/balanced_producer.rs | 4 +-
.../balanced_producer_and_consumer_group.rs | 4 +-
core/bench/src/benchmarks/benchmark.rs | 2 +-
core/bench/src/benchmarks/common.rs | 6 +-
.../benchmarks/end_to_end_producing_consumer.rs | 4 +-
core/bench/src/benchmarks/pinned_producer.rs | 4 +-
.../src/benchmarks/pinned_producer_and_consumer.rs | 4 +-
core/bench/src/main.rs | 2 +-
core/bench/src/runner.rs | 2 +-
core/bench/src/utils/batch_generator.rs | 8 +-
core/bench/src/utils/finish_condition.rs | 2 +-
core/bench/src/utils/rate_limiter.rs | 2 +-
core/bench/src/utils/server_starter.rs | 8 +-
core/binary_protocol/Cargo.toml | 2 +-
.../src/cli/binary_client/get_client.rs | 6 +-
.../src/cli/binary_client/get_clients.rs | 4 +-
.../create_consumer_group.rs | 6 +-
.../delete_consumer_group.rs | 6 +-
.../binary_consumer_groups/get_consumer_group.rs | 8 +-
.../binary_consumer_groups/get_consumer_groups.rs | 6 +-
.../binary_consumer_offsets/get_consumer_offset.rs | 4 +-
.../binary_consumer_offsets/set_consumer_offset.rs | 6 +-
.../src/cli/binary_context/common.rs | 2 +-
.../src/cli/binary_context/get_contexts.rs | 4 +-
.../src/cli/binary_context/use_context.rs | 4 +-
.../src/cli/binary_message/flush_messages.rs | 4 +-
.../src/cli/binary_message/poll_messages.rs | 4 +-
.../src/cli/binary_message/send_messages.rs | 4 +-
.../src/cli/binary_partitions/create_partitions.rs | 6 +-
.../src/cli/binary_partitions/delete_partitions.rs | 6 +-
.../create_personal_access_token.rs | 6 +-
.../delete_personal_access_tokens.rs | 4 +-
.../get_personal_access_tokens.rs | 4 +-
.../src/cli/binary_segments/delete_segments.rs | 6 +-
.../src/cli/binary_streams/create_stream.rs | 4 +-
.../src/cli/binary_streams/delete_stream.rs | 6 +-
.../src/cli/binary_streams/get_stream.rs | 6 +-
.../src/cli/binary_streams/get_streams.rs | 4 +-
.../src/cli/binary_streams/purge_stream.rs | 6 +-
.../src/cli/binary_streams/update_stream.rs | 6 +-
.../binary_protocol/src/cli/binary_system/login.rs | 4 +-
.../src/cli/binary_system/logout.rs | 4 +-
core/binary_protocol/src/cli/binary_system/me.rs | 4 +-
core/binary_protocol/src/cli/binary_system/ping.rs | 6 +-
.../src/cli/binary_system/snapshot.rs | 4 +-
.../binary_protocol/src/cli/binary_system/stats.rs | 4 +-
.../src/cli/binary_topics/create_topic.rs | 4 +-
.../src/cli/binary_topics/delete_topic.rs | 6 +-
.../src/cli/binary_topics/get_topic.rs | 6 +-
.../src/cli/binary_topics/get_topics.rs | 4 +-
.../src/cli/binary_topics/purge_topic.rs | 6 +-
.../src/cli/binary_topics/update_topic.rs | 4 +-
.../src/cli/binary_users/change_password.rs | 6 +-
.../src/cli/binary_users/create_user.rs | 6 +-
.../src/cli/binary_users/delete_user.rs | 6 +-
.../src/cli/binary_users/get_user.rs | 6 +-
.../src/cli/binary_users/get_users.rs | 4 +-
.../src/cli/binary_users/update_permissions.rs | 4 +-
.../src/cli/binary_users/update_user.rs | 6 +-
.../src/client/binary_clients/binary_client.rs | 2 +-
.../src/client/binary_consumer_offsets/mod.rs | 2 +-
.../src/client/binary_messages/mod.rs | 4 +-
.../src/client/binary_segments/mod.rs | 2 +-
core/cli/Cargo.toml | 2 +-
core/cli/src/args/mod.rs | 2 +-
core/cli/src/args/user.rs | 2 +-
core/cli/src/credentials.rs | 10 +-
core/cli/src/main.rs | 5 +-
core/common/Cargo.toml | 2 +-
.../consumer_groups/create_consumer_group.rs | 4 +-
.../consumer_groups/delete_consumer_group.rs | 2 +-
.../commands/consumer_groups/get_consumer_group.rs | 2 +-
.../consumer_groups/get_consumer_groups.rs | 2 +-
.../consumer_groups/join_consumer_group.rs | 2 +-
.../consumer_groups/leave_consumer_group.rs | 2 +-
.../consumer_offsets/delete_consumer_offset.rs | 2 +-
.../consumer_offsets/get_consumer_offset.rs | 2 +-
.../consumer_offsets/store_consumer_offset.rs | 2 +-
.../src/commands/messages/flush_unsaved_buffer.rs | 9 +-
core/common/src/commands/messages/poll_messages.rs | 6 +-
core/common/src/commands/messages/send_messages.rs | 8 +-
.../src/commands/partitions/create_partitions.rs | 4 +-
.../src/commands/partitions/delete_partitions.rs | 2 +-
.../create_personal_access_token.rs | 6 +-
.../delete_personal_access_token.rs | 4 +-
.../get_personal_access_tokens.rs | 2 +-
.../login_with_personal_access_token.rs | 4 +-
.../src/commands/segments/delete_segments.rs | 2 +-
core/common/src/commands/streams/create_stream.rs | 4 +-
core/common/src/commands/streams/delete_stream.rs | 2 +-
core/common/src/commands/streams/get_stream.rs | 2 +-
core/common/src/commands/streams/get_streams.rs | 2 +-
core/common/src/commands/streams/purge_stream.rs | 2 +-
core/common/src/commands/streams/update_stream.rs | 2 +-
core/common/src/commands/system/get_client.rs | 2 +-
core/common/src/commands/system/get_clients.rs | 2 +-
core/common/src/commands/system/get_me.rs | 2 +-
core/common/src/commands/system/get_snapshot.rs | 2 +-
core/common/src/commands/system/get_stats.rs | 2 +-
core/common/src/commands/system/ping.rs | 2 +-
core/common/src/commands/topics/create_topic.rs | 8 +-
core/common/src/commands/topics/delete_topic.rs | 2 +-
core/common/src/commands/topics/get_topic.rs | 2 +-
core/common/src/commands/topics/get_topics.rs | 2 +-
core/common/src/commands/topics/purge_topic.rs | 2 +-
core/common/src/commands/topics/update_topic.rs | 6 +-
core/common/src/commands/users/change_password.rs | 4 +-
core/common/src/commands/users/create_user.rs | 4 +-
core/common/src/commands/users/delete_user.rs | 2 +-
core/common/src/commands/users/get_user.rs | 2 +-
core/common/src/commands/users/get_users.rs | 2 +-
core/common/src/commands/users/login_user.rs | 2 +-
core/common/src/commands/users/logout_user.rs | 2 +-
.../src/commands/users/update_permissions.rs | 2 +-
core/common/src/commands/users/update_user.rs | 2 +-
core/common/src/error/iggy_error.rs | 30 +++---
core/common/src/traits/partitioner.rs | 2 +-
core/common/src/types/command/mod.rs | 2 +-
.../src/types/compression/compression_algorithm.rs | 2 +-
core/common/src/types/consumer/consumer_kind.rs | 4 +-
core/common/src/types/consumer/mod.rs | 4 +-
core/common/src/types/identifier/mod.rs | 4 +-
core/common/src/types/message/iggy_message.rs | 10 +-
core/common/src/types/message/indexes.rs | 2 +-
core/common/src/types/message/message_header.rs | 2 +-
.../src/types/message/message_header_view.rs | 10 +-
core/common/src/types/message/message_view.rs | 6 +-
core/common/src/types/message/messages_batch.rs | 4 +-
core/common/src/types/message/mod.rs | 10 +-
core/common/src/types/message/partitioning.rs | 2 +-
core/common/src/types/message/polled_messages.rs | 2 +-
core/common/src/types/message/polling_strategy.rs | 4 +-
core/common/src/types/message/user_headers.rs | 2 +-
.../src/types/permissions/permissions_global.rs | 4 +-
core/common/src/types/topic/mod.rs | 4 +-
core/common/src/types/user/user_info.rs | 2 +-
core/common/src/utils/crypto.rs | 2 +-
core/common/src/utils/duration.rs | 2 +-
core/common/src/utils/expiry.rs | 4 +-
core/common/src/utils/text.rs | 2 +-
core/common/src/utils/timestamp.rs | 2 +-
core/common/src/utils/topic_size.rs | 2 +-
core/examples/Cargo.toml | 2 +-
core/examples/src/multi-tenant/consumer/main.rs | 18 +++-
core/examples/src/multi-tenant/producer/main.rs | 7 +-
core/examples/src/new-sdk/consumer/main.rs | 14 ++-
core/examples/src/shared/messages_generator.rs | 2 +-
core/examples/src/shared/system.rs | 10 +-
core/integration/Cargo.toml | 2 +-
core/integration/src/test_server.rs | 4 +-
core/integration/tests/archiver/s3.rs | 2 +-
core/integration/tests/bench/mod.rs | 2 +-
.../tests/cli/client/test_client_help_command.rs | 2 +-
.../tests/cli/client/test_client_list_command.rs | 2 +-
core/integration/tests/cli/common/mod.rs | 4 +-
.../test_consumer_group_create_command.rs | 17 +++-
.../test_consumer_group_delete_command.rs | 10 +-
.../test_consumer_group_get_command.rs | 4 +-
.../test_consumer_group_help_command.rs | 2 +-
.../test_consumer_group_list_command.rs | 4 +-
.../test_consumer_offset_get_command.rs | 9 +-
.../test_consumer_offset_set_command.rs | 4 +-
core/integration/tests/cli/context/common.rs | 2 +-
.../tests/cli/context/test_context_list_command.rs | 2 +-
.../tests/cli/context/test_context_use_command.rs | 2 +-
.../tests/cli/general/test_help_command.rs | 2 +-
.../tests/cli/general/test_overview_command.rs | 2 +-
.../cli/message/test_message_flush_command.rs | 8 +-
.../tests/cli/message/test_message_help_command.rs | 2 +-
.../tests/cli/message/test_message_poll_command.rs | 10 +-
.../message/test_message_poll_to_file_command.rs | 6 +-
.../tests/cli/message/test_message_send_command.rs | 10 +-
.../cli/partition/test_partition_create_command.rs | 10 +-
.../cli/partition/test_partition_delete_command.rs | 10 +-
.../cli/partition/test_partition_help_command.rs | 2 +-
.../test_pat_create_command.rs | 10 +-
.../test_pat_delete_command.rs | 6 +-
.../personal_access_token/test_pat_help_command.rs | 2 +-
.../personal_access_token/test_pat_list_command.rs | 2 +-
.../tests/cli/stream/test_stream_delete_command.rs | 2 +-
.../tests/cli/stream/test_stream_get_command.rs | 2 +-
.../tests/cli/stream/test_stream_help_command.rs | 2 +-
.../tests/cli/stream/test_stream_list_command.rs | 2 +-
.../tests/cli/stream/test_stream_purge_command.rs | 2 +-
.../tests/cli/stream/test_stream_update_command.rs | 12 ++-
.../tests/cli/system/test_ping_command.rs | 2 +-
.../tests/cli/system/test_stats_command.rs | 2 +-
.../tests/cli/topic/test_topic_create_command.rs | 2 +-
.../tests/cli/topic/test_topic_delete_command.rs | 10 +-
.../tests/cli/topic/test_topic_get_command.rs | 4 +-
.../tests/cli/topic/test_topic_help_command.rs | 2 +-
.../tests/cli/topic/test_topic_list_command.rs | 4 +-
.../tests/cli/topic/test_topic_purge_command.rs | 10 +-
.../tests/cli/topic/test_topic_update_command.rs | 10 +-
.../tests/cli/user/test_login_options.rs | 2 +-
.../tests/cli/user/test_user_create_command.rs | 2 +-
.../tests/cli/user/test_user_delete_command.rs | 2 +-
.../tests/cli/user/test_user_get_command.rs | 2 +-
.../tests/cli/user/test_user_help_command.rs | 2 +-
.../tests/cli/user/test_user_list_command.rs | 2 +-
.../tests/cli/user/test_user_name_command.rs | 8 +-
.../tests/cli/user/test_user_password_command.rs | 5 +-
.../cli/user/test_user_permissions_command.rs | 5 +-
.../tests/cli/user/test_user_status_command.rs | 15 ++-
core/integration/tests/config_provider/mod.rs | 46 +++++----
.../data_integrity/verify_after_server_restart.rs | 2 +-
core/integration/tests/examples/mod.rs | 2 +-
core/integration/tests/mod.rs | 2 +-
.../scenarios/consumer_group_join_scenario.rs | 7 +-
...h_multiple_clients_polling_messages_scenario.rs | 10 +-
...with_single_client_polling_messages_scenario.rs | 10 +-
.../server/scenarios/create_message_payload.rs | 14 +--
.../server/scenarios/message_headers_scenario.rs | 18 ++--
.../server/scenarios/message_size_scenario.rs | 10 +-
core/integration/tests/server/scenarios/mod.rs | 2 +-
.../scenarios/stream_size_validation_scenario.rs | 4 +-
.../tests/server/scenarios/system_scenario.rs | 8 +-
.../tests/server/scenarios/user_scenario.rs | 6 +-
core/integration/tests/state/file.rs | 2 +-
core/integration/tests/state/system.rs | 2 +-
core/integration/tests/streaming/get_by_offset.rs | 8 +-
.../tests/streaming/get_by_timestamp.rs | 8 +-
core/integration/tests/streaming/messages.rs | 2 +-
core/integration/tests/streaming/partition.rs | 2 +-
core/integration/tests/streaming/segment.rs | 24 +++--
core/integration/tests/streaming/topic.rs | 2 +-
core/integration/tests/streaming/topic_messages.rs | 2 +-
core/sdk/Cargo.toml | 2 +-
core/sdk/src/clients/consumer.rs | 85 +++++++++++-----
core/sdk/src/clients/producer.rs | 8 +-
core/sdk/src/http/binary_consumer_groups.rs | 2 +-
core/sdk/src/http/binary_personal_access_tokens.rs | 4 +-
core/sdk/src/http/binary_system.rs | 2 +-
core/sdk/src/http/http_client.rs | 6 +-
core/sdk/src/prelude.rs | 31 +++---
core/sdk/src/quic/quick_client.rs | 12 ++-
.../src/stream_builder/build/build_stream_topic.rs | 6 +-
core/sdk/src/stream_builder/iggy_stream.rs | 2 +-
.../sdk/src/stream_builder/iggy_stream_consumer.rs | 2 +-
.../sdk/src/stream_builder/iggy_stream_producer.rs | 2 +-
core/sdk/src/tcp/tcp_client.rs | 12 ++-
core/sdk/src/tcp/tcp_connection_stream.rs | 2 +-
core/server/Cargo.toml | 2 +-
.../create_consumer_group_handler.rs | 2 +-
.../delete_consumer_group_handler.rs | 2 +-
.../consumer_groups/get_consumer_group_handler.rs | 2 +-
.../consumer_groups/get_consumer_groups_handler.rs | 2 +-
.../consumer_groups/join_consumer_group_handler.rs | 2 +-
.../leave_consumer_group_handler.rs | 2 +-
.../delete_consumer_offset_handler.rs | 2 +-
.../get_consumer_offset_handler.rs | 2 +-
.../store_consumer_offset_handler.rs | 2 +-
.../handlers/messages/send_messages_handler.rs | 2 +-
.../partitions/create_partitions_handler.rs | 2 +-
.../partitions/delete_partitions_handler.rs | 2 +-
.../create_personal_access_token_handler.rs | 2 +-
.../delete_personal_access_token_handler.rs | 2 +-
.../get_personal_access_tokens_handler.rs | 2 +-
.../login_with_personal_access_token_handler.rs | 2 +-
.../handlers/segments/delete_segments_handler.rs | 2 +-
.../handlers/streams/create_stream_handler.rs | 2 +-
.../handlers/streams/delete_stream_handler.rs | 2 +-
.../binary/handlers/streams/get_stream_handler.rs | 2 +-
.../binary/handlers/streams/get_streams_handler.rs | 2 +-
.../handlers/streams/purge_stream_handler.rs | 2 +-
.../handlers/streams/update_stream_handler.rs | 2 +-
.../binary/handlers/system/get_client_handler.rs | 2 +-
.../binary/handlers/system/get_clients_handler.rs | 2 +-
.../src/binary/handlers/system/get_me_handler.rs | 2 +-
.../src/binary/handlers/system/get_snapshot.rs | 2 +-
.../binary/handlers/system/get_stats_handler.rs | 2 +-
.../src/binary/handlers/system/ping_handler.rs | 4 +-
.../binary/handlers/topics/create_topic_handler.rs | 2 +-
.../binary/handlers/topics/delete_topic_handler.rs | 2 +-
.../binary/handlers/topics/get_topic_handler.rs | 2 +-
.../binary/handlers/topics/get_topics_handler.rs | 2 +-
.../binary/handlers/topics/purge_topic_handler.rs | 2 +-
.../binary/handlers/topics/update_topic_handler.rs | 2 +-
.../handlers/users/change_password_handler.rs | 2 +-
.../binary/handlers/users/create_user_handler.rs | 2 +-
.../binary/handlers/users/delete_user_handler.rs | 2 +-
.../src/binary/handlers/users/get_user_handler.rs | 2 +-
.../src/binary/handlers/users/get_users_handler.rs | 2 +-
.../binary/handlers/users/login_user_handler.rs | 2 +-
.../binary/handlers/users/logout_user_handler.rs | 2 +-
.../handlers/users/update_permissions_handler.rs | 2 +-
.../binary/handlers/users/update_user_handler.rs | 2 +-
core/server/src/build.rs | 4 +-
.../commands/clean_personal_access_tokens.rs | 4 +-
.../src/channels/commands/maintain_messages.rs | 22 +++--
core/server/src/channels/commands/print_sysinfo.rs | 26 ++---
core/server/src/channels/commands/save_messages.rs | 4 +-
.../src/channels/commands/verify_heartbeats.rs | 8 +-
.../src/compat/index_rebuilding/index_rebuilder.rs | 2 +-
core/server/src/configs/config_provider.rs | 8 +-
core/server/src/configs/displays.rs | 108 +++++++++++++--------
core/server/src/configs/http.rs | 2 +-
core/server/src/configs/quic.rs | 2 +-
core/server/src/configs/server.rs | 4 +-
core/server/src/configs/system.rs | 2 +-
core/server/src/configs/tcp.rs | 2 +-
core/server/src/configs/validators.rs | 6 +-
core/server/src/http/consumer_groups.rs | 6 +-
core/server/src/http/consumer_offsets.rs | 8 +-
core/server/src/http/diagnostics.rs | 4 +-
core/server/src/http/error.rs | 2 +-
core/server/src/http/http_server.rs | 2 +-
core/server/src/http/jwt/jwt_manager.rs | 8 +-
core/server/src/http/jwt/storage.rs | 2 +-
core/server/src/http/mapper.rs | 4 +-
core/server/src/http/messages.rs | 2 +-
core/server/src/http/partitions.rs | 6 +-
core/server/src/http/personal_access_tokens.rs | 6 +-
core/server/src/http/streams.rs | 6 +-
core/server/src/http/system.rs | 8 +-
core/server/src/http/topics.rs | 6 +-
core/server/src/http/users.rs | 2 +-
core/server/src/log/logger.rs | 18 ++--
core/server/src/main.rs | 2 +-
core/server/src/quic/quic_server.rs | 2 +-
core/server/src/state/command.rs | 8 +-
core/server/src/state/entry.rs | 2 +-
core/server/src/state/file.rs | 4 +-
core/server/src/state/models.rs | 8 +-
core/server/src/state/system.rs | 14 ++-
.../server/src/streaming/clients/client_manager.rs | 4 +-
.../src/streaming/partitions/consumer_offsets.rs | 32 +++---
core/server/src/streaming/partitions/messages.rs | 44 ++++-----
core/server/src/streaming/partitions/partition.rs | 4 +-
.../server/src/streaming/partitions/persistence.rs | 2 +-
core/server/src/streaming/partitions/segments.rs | 2 +-
core/server/src/streaming/partitions/storage.rs | 72 +++++++++++---
core/server/src/streaming/persistence/task.rs | 2 +-
.../personal_access_token.rs | 2 +-
.../src/streaming/segments/indexes/index_reader.rs | 24 ++---
.../src/streaming/segments/indexes/index_writer.rs | 4 +-
.../src/streaming/segments/indexes/indexes_mut.rs | 2 +-
.../streaming/segments/messages/messages_reader.rs | 20 ++--
.../streaming/segments/messages/messages_writer.rs | 4 +-
.../streaming/segments/messages/persister_task.rs | 10 +-
.../src/streaming/segments/messages_accumulator.rs | 11 +--
.../src/streaming/segments/reading_messages.rs | 5 +-
core/server/src/streaming/segments/segment.rs | 30 +++---
.../streaming/segments/types/message_view_mut.rs | 2 +-
.../streaming/segments/types/messages_batch_mut.rs | 31 +++---
.../src/streaming/segments/writing_messages.rs | 14 ++-
core/server/src/streaming/storage.rs | 2 +-
core/server/src/streaming/streams/persistence.rs | 2 +-
core/server/src/streaming/streams/storage.rs | 26 +++--
core/server/src/streaming/streams/stream.rs | 2 +-
core/server/src/streaming/streams/topics.rs | 4 +-
core/server/src/streaming/systems/clients.rs | 6 +-
.../src/streaming/systems/consumer_groups.rs | 4 +-
.../src/streaming/systems/consumer_offsets.rs | 2 +-
core/server/src/streaming/systems/info.rs | 8 +-
core/server/src/streaming/systems/messages.rs | 11 ++-
core/server/src/streaming/systems/partitions.rs | 2 +-
.../streaming/systems/personal_access_tokens.rs | 6 +-
core/server/src/streaming/systems/segments.rs | 4 +-
core/server/src/streaming/systems/stats.rs | 2 +-
core/server/src/streaming/systems/storage.rs | 4 +-
core/server/src/streaming/systems/streams.rs | 14 ++-
core/server/src/streaming/systems/system.rs | 2 +-
core/server/src/streaming/systems/topics.rs | 2 +-
core/server/src/streaming/systems/users.rs | 14 +--
core/server/src/streaming/topics/consumer_group.rs | 20 ++--
.../server/src/streaming/topics/consumer_groups.rs | 6 +-
.../src/streaming/topics/consumer_offsets.rs | 44 ++++++---
core/server/src/streaming/topics/messages.rs | 16 ++-
core/server/src/streaming/topics/partitions.rs | 2 +-
core/server/src/streaming/topics/persistence.rs | 4 +-
core/server/src/streaming/topics/storage.rs | 29 ++++--
core/server/src/streaming/topics/topic.rs | 2 +-
core/server/src/streaming/users/user.rs | 2 +-
core/server/src/streaming/utils/file.rs | 2 +-
core/server/src/streaming/utils/memory_pool.rs | 5 +-
core/server/src/streaming/utils/mod.rs | 2 +-
core/server/src/streaming/utils/pooled_buffer.rs | 2 +-
core/server/src/tcp/tcp_listener.rs | 8 +-
core/server/src/tcp/tcp_tls_listener.rs | 8 +-
core/tools/Cargo.toml | 2 +-
420 files changed, 1358 insertions(+), 1058 deletions(-)
diff --git a/core/bench/Cargo.toml b/core/bench/Cargo.toml
index add699ca..3b2c6c64 100644
--- a/core/bench/Cargo.toml
+++ b/core/bench/Cargo.toml
@@ -18,7 +18,7 @@
[package]
name = "bench"
version = "0.2.4"
-edition = "2021"
+edition = "2024"
license = "Apache-2.0"
# Due to dependency to integration, which has a dependency to server, setting
# mimalloc on server is also setting it on bench.
diff --git a/core/bench/dashboard/frontend/Cargo.toml b/core/bench/dashboard/frontend/Cargo.toml
index e12303ac..bb7a14e1 100644
--- a/core/bench/dashboard/frontend/Cargo.toml
+++ b/core/bench/dashboard/frontend/Cargo.toml
@@ -2,7 +2,7 @@
name = "bench-dashboard-frontend"
license = "Apache-2.0"
version = "0.1.0"
-edition = "2021"
+edition = "2024"
[package.metadata.cargo-machete]
ignored = ["getrandom"]
diff --git a/core/bench/dashboard/frontend/src/components/app_content.rs b/core/bench/dashboard/frontend/src/components/app_content.rs
index 594f0307..8e9f9fab 100644
--- a/core/bench/dashboard/frontend/src/components/app_content.rs
+++ b/core/bench/dashboard/frontend/src/components/app_content.rs
@@ -19,10 +19,10 @@ use crate::{
api,
components::layout::{main_content::MainContent, sidebar::Sidebar},
state::{
- benchmark::{use_benchmark, BenchmarkAction, BenchmarkContext},
- gitref::{use_gitref, GitrefAction, GitrefContext},
- hardware::{use_hardware, HardwareAction, HardwareContext},
- ui::{use_ui, UiAction},
+ benchmark::{BenchmarkAction, BenchmarkContext, use_benchmark},
+ gitref::{GitrefAction, GitrefContext, use_gitref},
+ hardware::{HardwareAction, HardwareContext, use_hardware},
+ ui::{UiAction, use_ui},
},
};
use gloo::console::log;
diff --git a/core/bench/dashboard/frontend/src/components/chart/plot_trend.rs b/core/bench/dashboard/frontend/src/components/chart/plot_trend.rs
index b2d3b8fb..4268120b 100644
--- a/core/bench/dashboard/frontend/src/components/chart/plot_trend.rs
+++ b/core/bench/dashboard/frontend/src/components/chart/plot_trend.rs
@@ -24,9 +24,9 @@ use bench_report::{
plotting::{chart::IggyChart, chart_kind::ChartKind},
};
use charming::{
+ Chart, Echarts, WasmRenderer,
element::{Symbol, Tooltip, Trigger},
theme::Theme,
- Chart, Echarts, WasmRenderer,
};
fn trend_chart_title(params: &BenchmarkParams, kind: ChartKind) -> String {
diff --git a/core/bench/dashboard/frontend/src/components/chart/single_chart.rs b/core/bench/dashboard/frontend/src/components/chart/single_chart.rs
index 555fd853..9ec8729b 100644
--- a/core/bench/dashboard/frontend/src/components/chart/single_chart.rs
+++ b/core/bench/dashboard/frontend/src/components/chart/single_chart.rs
@@ -16,7 +16,7 @@
// under the License.
use crate::api::fetch_benchmark_report_full;
-use crate::components::chart::{dispose_chart, PlotConfig};
+use crate::components::chart::{PlotConfig, dispose_chart};
use crate::components::selectors::measurement_type_selector::MeasurementType;
use bench_report::report::BenchmarkReport;
use charming::theme::Theme;
diff --git a/core/bench/dashboard/frontend/src/components/chart/trend_chart.rs b/core/bench/dashboard/frontend/src/components/chart/trend_chart.rs
index 99a1ab76..3afe40af 100644
--- a/core/bench/dashboard/frontend/src/components/chart/trend_chart.rs
+++ b/core/bench/dashboard/frontend/src/components/chart/trend_chart.rs
@@ -17,7 +17,7 @@
use crate::api::fetch_benchmark_trend;
use crate::components::chart::plot_trend::create_chart;
-use crate::components::chart::{dispose_chart, PlotConfig, PlotType};
+use crate::components::chart::{PlotConfig, PlotType, dispose_chart};
use crate::components::selectors::measurement_type_selector::MeasurementType;
use crate::state::hardware::use_hardware;
use charming::Echarts;
diff --git a/core/bench/dashboard/frontend/src/components/layout/main_content.rs b/core/bench/dashboard/frontend/src/components/layout/main_content.rs
index 60869f9e..99ddc642 100644
--- a/core/bench/dashboard/frontend/src/components/layout/main_content.rs
+++ b/core/bench/dashboard/frontend/src/components/layout/main_content.rs
@@ -19,7 +19,7 @@ use crate::components::chart::single_chart::SingleChart;
use crate::components::chart::trend_chart::TrendChart;
use crate::components::layout::topbar::TopBar;
use crate::state::benchmark::use_benchmark;
-use crate::state::ui::{use_ui, ViewMode};
+use crate::state::ui::{ViewMode, use_ui};
use yew::prelude::*;
#[derive(Properties, PartialEq)]
diff --git a/core/bench/dashboard/frontend/src/components/layout/sidebar.rs b/core/bench/dashboard/frontend/src/components/layout/sidebar.rs
index 63533d81..947e8dfa 100644
--- a/core/bench/dashboard/frontend/src/components/layout/sidebar.rs
+++ b/core/bench/dashboard/frontend/src/components/layout/sidebar.rs
@@ -20,9 +20,9 @@ use crate::components::selectors::benchmark_selector::BenchmarkSelector;
use crate::components::selectors::gitref_selector::GitrefSelector;
use crate::components::selectors::hardware_selector::HardwareSelector;
use crate::components::selectors::view_mode_selector::ViewModeSelector;
-use crate::state::benchmark::{use_benchmark, BenchmarkAction};
+use crate::state::benchmark::{BenchmarkAction, use_benchmark};
use crate::state::gitref::use_gitref;
-use crate::state::ui::{use_ui, ViewMode};
+use crate::state::ui::{ViewMode, use_ui};
use bench_report::benchmark_kind::BenchmarkKind;
use yew::prelude::*;
diff --git a/core/bench/dashboard/frontend/src/components/layout/topbar.rs b/core/bench/dashboard/frontend/src/components/layout/topbar.rs
index 4d854bc2..2a4ff5f0 100644
--- a/core/bench/dashboard/frontend/src/components/layout/topbar.rs
+++ b/core/bench/dashboard/frontend/src/components/layout/topbar.rs
@@ -23,7 +23,7 @@ use crate::components::tooltips::benchmark_info_tooltip::BenchmarkInfoTooltip;
use crate::components::tooltips::server_stats_toggle::ServerStatsToggle;
use crate::components::tooltips::server_stats_tooltip::ServerStatsTooltip;
use crate::state::benchmark::use_benchmark;
-use crate::state::ui::{use_ui, UiAction};
+use crate::state::ui::{UiAction, use_ui};
use yew::prelude::*;
#[derive(Properties, PartialEq)]
diff --git a/core/bench/dashboard/frontend/src/components/selectors/benchmark_selector.rs b/core/bench/dashboard/frontend/src/components/selectors/benchmark_selector.rs
index f798fc04..23554803 100644
--- a/core/bench/dashboard/frontend/src/components/selectors/benchmark_selector.rs
+++ b/core/bench/dashboard/frontend/src/components/selectors/benchmark_selector.rs
@@ -17,7 +17,7 @@
use crate::{
components::selectors::benchmark_kind_selector::BenchmarkKindSelector,
- state::benchmark::{use_benchmark, BenchmarkAction},
+ state::benchmark::{BenchmarkAction, use_benchmark},
};
use bench_report::benchmark_kind::BenchmarkKind;
use std::collections::HashSet;
diff --git a/core/bench/dashboard/frontend/src/components/selectors/hardware_selector.rs b/core/bench/dashboard/frontend/src/components/selectors/hardware_selector.rs
index 0564a137..633beab0 100644
--- a/core/bench/dashboard/frontend/src/components/selectors/hardware_selector.rs
+++ b/core/bench/dashboard/frontend/src/components/selectors/hardware_selector.rs
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-use crate::state::hardware::{use_hardware, HardwareAction};
+use crate::state::hardware::{HardwareAction, use_hardware};
use web_sys::HtmlSelectElement;
use yew::prelude::*;
diff --git a/core/bench/dashboard/frontend/src/components/selectors/view_mode_selector.rs b/core/bench/dashboard/frontend/src/components/selectors/view_mode_selector.rs
index 0cf6ea86..9652595a 100644
--- a/core/bench/dashboard/frontend/src/components/selectors/view_mode_selector.rs
+++ b/core/bench/dashboard/frontend/src/components/selectors/view_mode_selector.rs
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-use crate::state::ui::{use_ui, UiAction, ViewMode};
+use crate::state::ui::{UiAction, ViewMode, use_ui};
use yew::prelude::*;
#[function_component(ViewModeSelector)]
diff --git a/core/bench/dashboard/server/Cargo.toml b/core/bench/dashboard/server/Cargo.toml
index b0640519..8f6473af 100644
--- a/core/bench/dashboard/server/Cargo.toml
+++ b/core/bench/dashboard/server/Cargo.toml
@@ -2,7 +2,7 @@
name = "bench-dashboard-server"
license = "Apache-2.0"
version = "0.1.0"
-edition = "2021"
+edition = "2024"
[dependencies]
actix-cors = "0.7.1"
diff --git a/core/bench/dashboard/server/Dockerfile b/core/bench/dashboard/server/Dockerfile
index 8a053d3b..df89efe8 100644
--- a/core/bench/dashboard/server/Dockerfile
+++ b/core/bench/dashboard/server/Dockerfile
@@ -16,7 +16,7 @@
# under the License.
# Build stage
-FROM rust:1.83-slim-bookworm as builder
+FROM rust:1.86-slim-bookworm as builder
WORKDIR /usr/src/iggy-bench-dashboard
diff --git a/core/bench/dashboard/server/src/args.rs b/core/bench/dashboard/server/src/args.rs
index f5c746bf..b56d30ae 100644
--- a/core/bench/dashboard/server/src/args.rs
+++ b/core/bench/dashboard/server/src/args.rs
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-use clap::{error::ErrorKind, CommandFactory, Parser, Subcommand};
+use clap::{CommandFactory, Parser, Subcommand, error::ErrorKind};
use serde::Deserialize;
use std::path::PathBuf;
diff --git a/core/bench/dashboard/server/src/github/client.rs b/core/bench/dashboard/server/src/github/client.rs
index b7d7441b..965493f0 100644
--- a/core/bench/dashboard/server/src/github/client.rs
+++ b/core/bench/dashboard/server/src/github/client.rs
@@ -17,13 +17,13 @@
use crate::error::IggyBenchDashboardServerError;
use octocrab::{
+ Octocrab,
models::{
+ RunId,
repos::Tag,
workflows::{Run, WorkflowListArtifact},
- RunId,
},
params::actions::ArchiveFormat,
- Octocrab,
};
use std::io::Cursor;
use tempfile::TempDir;
diff --git a/core/bench/dashboard/server/src/handlers.rs b/core/bench/dashboard/server/src/handlers.rs
index cf1566d9..6c2d7451 100644
--- a/core/bench/dashboard/server/src/handlers.rs
+++ b/core/bench/dashboard/server/src/handlers.rs
@@ -16,12 +16,12 @@
// under the License.
use crate::{cache::BenchmarkCache, error::IggyBenchDashboardServerError};
-use actix_web::{get, web, HttpRequest, HttpResponse};
+use actix_web::{HttpRequest, HttpResponse, get, web};
use std::sync::Arc;
use tracing::{info, warn};
use uuid::Uuid;
use walkdir::WalkDir;
-use zip::{write::FileOptions, ZipWriter};
+use zip::{ZipWriter, write::FileOptions};
type Result<T> = std::result::Result<T, IggyBenchDashboardServerError>;
diff --git a/core/bench/dashboard/server/src/main.rs b/core/bench/dashboard/server/src/main.rs
index 95b8ddc8..93bc66ad 100644
--- a/core/bench/dashboard/server/src/main.rs
+++ b/core/bench/dashboard/server/src/main.rs
@@ -25,9 +25,10 @@ use crate::cache::CacheWatcher;
use actix_cors::Cors;
use actix_files::{self as fs, NamedFile};
use actix_web::{
+ App, HttpServer,
http::header,
middleware::{Compress, Logger},
- web, App, HttpServer,
+ web,
};
use args::{IggyBenchDashboardServerArgs, PollGithub};
use cache::BenchmarkCache;
@@ -36,10 +37,10 @@ use handlers::AppState;
use std::sync::Arc;
use tracing::{error, info};
use tracing_subscriber::{
+ EnvFilter,
fmt::{self, format::Format},
layer::SubscriberExt,
util::SubscriberInitExt,
- EnvFilter,
};
#[derive(Clone)]
diff --git a/core/bench/dashboard/shared/Cargo.toml b/core/bench/dashboard/shared/Cargo.toml
index 2bc60eea..4c5ff89b 100644
--- a/core/bench/dashboard/shared/Cargo.toml
+++ b/core/bench/dashboard/shared/Cargo.toml
@@ -2,7 +2,7 @@
name = "bench-dashboard-shared"
license = "Apache-2.0"
version = "0.1.0"
-edition = "2021"
+edition = "2024"
[dependencies]
bench-report = { workspace = true }
diff --git a/core/bench/report/Cargo.toml b/core/bench/report/Cargo.toml
index bfed486a..45cbde6b 100644
--- a/core/bench/report/Cargo.toml
+++ b/core/bench/report/Cargo.toml
@@ -18,7 +18,7 @@
[package]
name = "bench-report"
version = "0.2.2"
-edition = "2021"
+edition = "2024"
description = "Benchmark report and chart generation library for iggy-bench binary and iggy-benchmarks-dashboard web app"
license = "Apache-2.0"
diff --git a/core/bench/report/src/plotting/chart.rs b/core/bench/report/src/plotting/chart.rs
index 4dc77e38..a1965164 100644
--- a/core/bench/report/src/plotting/chart.rs
+++ b/core/bench/report/src/plotting/chart.rs
@@ -17,6 +17,7 @@
*/
use charming::{
+ Chart,
component::{
Axis, DataView, DataZoom, DataZoomType, Feature, Grid, Legend, LegendSelectedMode,
LegendType, Restore, SaveAsImage, Title, Toolbox, ToolboxDataZoom,
@@ -26,7 +27,6 @@ use charming::{
NameLocation, Orient, SplitLine, Symbol, TextAlign, TextStyle, Tooltip,
},
series::Line,
- Chart,
};
pub struct IggyChart {
diff --git a/core/bench/runner/Cargo.toml b/core/bench/runner/Cargo.toml
index 0d5513a1..138ee025 100644
--- a/core/bench/runner/Cargo.toml
+++ b/core/bench/runner/Cargo.toml
@@ -2,7 +2,7 @@
name = "bench-runner"
license = "Apache-2.0"
version = "0.1.0"
-edition = "2021"
+edition = "2024"
[dependencies]
anyhow = { workspace = true }
diff --git a/core/bench/runner/src/app/local_benchmark_runner.rs b/core/bench/runner/src/app/local_benchmark_runner.rs
index 29dcd198..b85f6f6e 100644
--- a/core/bench/runner/src/app/local_benchmark_runner.rs
+++ b/core/bench/runner/src/app/local_benchmark_runner.rs
@@ -20,7 +20,7 @@ use std::path::PathBuf;
use anyhow::{Context, Result};
use dircpy::*;
use git2::{
- build::CheckoutBuilder, Branch, BranchType, Cred, FetchOptions, RemoteCallbacks, Repository,
+ Branch, BranchType, Cred, FetchOptions, RemoteCallbacks, Repository, build::CheckoutBuilder,
};
use tempfile::TempDir;
use tokio::{fs, process::Command};
diff --git a/core/bench/runner/src/main.rs b/core/bench/runner/src/main.rs
index 4998a9d2..5ae814f4 100644
--- a/core/bench/runner/src/main.rs
+++ b/core/bench/runner/src/main.rs
@@ -24,10 +24,10 @@ use args::IggyBenchRunnerArgs;
use clap::Parser;
use tracing::{error, info};
use tracing_subscriber::{
+ EnvFilter,
fmt::{self, format::Format},
layer::SubscriberExt,
util::SubscriberInitExt,
- EnvFilter,
};
#[tokio::main]
diff --git a/core/bench/src/actors/consumer.rs b/core/bench/src/actors/consumer.rs
index 36a7d833..a00a7e80 100644
--- a/core/bench/src/actors/consumer.rs
+++ b/core/bench/src/actors/consumer.rs
@@ -28,7 +28,7 @@ use bench_report::individual_metrics::BenchmarkIndividualMetrics;
use bench_report::numeric_parameter::BenchmarkNumericParameter;
use human_repr::HumanCount;
use iggy::prelude::*;
-use integration::test_server::{login_root, ClientFactory};
+use integration::test_server::{ClientFactory, login_root};
use std::sync::Arc;
use std::time::Duration;
use tokio::time::Instant;
@@ -255,8 +255,11 @@ impl BenchmarkConsumer {
if should_warn {
warn!(
- "Consumer #{} → Messages are empty for offset: {}, received {}, retrying... ({} warnings skipped)",
- self.consumer_id, offset, self.finish_condition.status(), skipped_warnings_count
+ "Consumer #{} → Messages are empty for offset: {}, received {}, retrying... ({} warnings skipped)",
+ self.consumer_id,
+ offset,
+ self.finish_condition.status(),
+ skipped_warnings_count
);
last_warning_time = Some(Instant::now());
skipped_warnings_count = 0;
diff --git a/core/bench/src/actors/producer.rs b/core/bench/src/actors/producer.rs
index f2bafdd9..972aed22 100644
--- a/core/bench/src/actors/producer.rs
+++ b/core/bench/src/actors/producer.rs
@@ -27,7 +27,7 @@ use bench_report::individual_metrics::BenchmarkIndividualMetrics;
use bench_report::numeric_parameter::BenchmarkNumericParameter;
use human_repr::HumanCount;
use iggy::prelude::*;
-use integration::test_server::{login_root, ClientFactory};
+use integration::test_server::{ClientFactory, login_root};
use std::sync::Arc;
use std::time::Duration;
use tokio::time::Instant;
diff --git a/core/bench/src/actors/producing_consumer.rs b/core/bench/src/actors/producing_consumer.rs
index 07d6f609..f99d62e0 100644
--- a/core/bench/src/actors/producing_consumer.rs
+++ b/core/bench/src/actors/producing_consumer.rs
@@ -30,7 +30,7 @@ use bench_report::individual_metrics::BenchmarkIndividualMetrics;
use bench_report::numeric_parameter::BenchmarkNumericParameter;
use human_repr::HumanCount;
use iggy::prelude::*;
-use integration::test_server::{login_root, ClientFactory};
+use integration::test_server::{ClientFactory, login_root};
use std::sync::Arc;
use std::time::Duration;
use tokio::time::Instant;
@@ -272,10 +272,15 @@ impl BenchmarkProducingConsumer {
.account_and_check(batch.user_data_bytes)
{
info!(
- "ProducingConsumer #{} → finished sending {} messages in {} batches ({} bytes of user data, {} bytes of total data), send finish condition: {}, poll finish condition: {}",
- self.actor_id, sent_messages.human_count_bare(), sent_batches.human_count_bare(), sent_user_bytes_processed.human_count_bytes(),
- sent_total_bytes_processed.human_count_bytes(), self.send_finish_condition.status(), self.poll_finish_condition.status()
- );
+ "ProducingConsumer #{} → finished sending {} messages in {} batches ({} bytes of user data, {} bytes of total data), send finish condition: {}, poll finish condition: {}",
+ self.actor_id,
+ sent_messages.human_count_bare(),
+ sent_batches.human_count_bare(),
+ sent_user_bytes_processed.human_count_bytes(),
+ sent_total_bytes_processed.human_count_bytes(),
+ self.send_finish_condition.status(),
+ self.poll_finish_condition.status()
+ );
}
}
@@ -305,13 +310,13 @@ impl BenchmarkProducingConsumer {
if should_warn {
warn!(
- "ProducingConsumer #{} → received empty batch, sent: {}, polled: {}, polling kind: {:?}, retrying... ({} warnings skipped in last second)",
- self.actor_id,
- self.send_finish_condition.status(),
- self.poll_finish_condition.status(),
- self.polling_kind,
- skipped_warnings_count
- );
+ "ProducingConsumer #{} → received empty batch, sent: {}, polled: {}, polling kind: {:?}, retrying... ({} warnings skipped in last second)",
+ self.actor_id,
+ self.send_finish_condition.status(),
+ self.poll_finish_condition.status(),
+ self.polling_kind,
+ skipped_warnings_count
+ );
last_warning_time = Some(Instant::now());
skipped_warnings_count = 0;
} else {
diff --git a/core/bench/src/analytics/metrics/group.rs b/core/bench/src/analytics/metrics/group.rs
index 24ae19f5..47aaf83e 100644
--- a/core/bench/src/analytics/metrics/group.rs
+++ b/core/bench/src/analytics/metrics/group.rs
@@ -18,7 +18,7 @@
use crate::analytics::time_series::{
calculator::TimeSeriesCalculator,
- processors::{moving_average::MovingAverageProcessor, TimeSeriesProcessor},
+ processors::{TimeSeriesProcessor, moving_average::MovingAverageProcessor},
};
use bench_report::{
actor_kind::ActorKind, group_metrics::BenchmarkGroupMetrics,
diff --git a/core/bench/src/analytics/metrics/individual.rs b/core/bench/src/analytics/metrics/individual.rs
index 526c0a9b..30ec44af 100644
--- a/core/bench/src/analytics/metrics/individual.rs
+++ b/core/bench/src/analytics/metrics/individual.rs
@@ -18,8 +18,8 @@
use crate::analytics::record::BenchmarkRecord;
use crate::analytics::time_series::calculator::TimeSeriesCalculator;
-use crate::analytics::time_series::processors::moving_average::MovingAverageProcessor;
use crate::analytics::time_series::processors::TimeSeriesProcessor;
+use crate::analytics::time_series::processors::moving_average::MovingAverageProcessor;
use bench_report::actor_kind::ActorKind;
use bench_report::benchmark_kind::BenchmarkKind;
use bench_report::individual_metrics::BenchmarkIndividualMetrics;
diff --git a/core/bench/src/analytics/time_series/calculators/throughput.rs b/core/bench/src/analytics/time_series/calculators/throughput.rs
index 0d0ca8d3..b6708fa2 100644
--- a/core/bench/src/analytics/time_series/calculators/throughput.rs
+++ b/core/bench/src/analytics/time_series/calculators/throughput.rs
@@ -126,7 +126,7 @@ impl<T: ThroughputCalculation> TimeSeriesCalculation for ThroughputTimeSeriesCal
let points = values_per_bucket
.iter()
.enumerate()
- .filter(|(_, &value)| value > 0)
+ .filter(|&(_, &value)| value > 0)
.map(|(i, &value)| {
let time_s = (i as u64 * bucket_size_us) as f64 / 1_000_000.0;
let throughput = self.calculator.calculate_throughput(value, bucket_size_us);
diff --git a/core/bench/src/args/kinds/balanced/consumer_group.rs b/core/bench/src/args/kinds/balanced/consumer_group.rs
index d49ea23c..d9068c51 100644
--- a/core/bench/src/args/kinds/balanced/consumer_group.rs
+++ b/core/bench/src/args/kinds/balanced/consumer_group.rs
@@ -20,7 +20,7 @@ use crate::args::{
common::IggyBenchArgs, defaults::*, props::BenchmarkKindProps,
transport::BenchmarkTransportCommand,
};
-use clap::{error::ErrorKind, CommandFactory, Parser};
+use clap::{CommandFactory, Parser, error::ErrorKind};
use iggy::prelude::IggyByteSize;
use std::num::NonZeroU32;
diff --git a/core/bench/src/args/kinds/balanced/producer.rs b/core/bench/src/args/kinds/balanced/producer.rs
index a6b26fcd..10ffdd2f 100644
--- a/core/bench/src/args/kinds/balanced/producer.rs
+++ b/core/bench/src/args/kinds/balanced/producer.rs
@@ -20,7 +20,7 @@ use crate::args::{
common::IggyBenchArgs, defaults::*, props::BenchmarkKindProps,
transport::BenchmarkTransportCommand,
};
-use clap::{error::ErrorKind, CommandFactory, Parser};
+use clap::{CommandFactory, Parser, error::ErrorKind};
use iggy::prelude::IggyByteSize;
use std::num::NonZeroU32;
diff --git a/core/bench/src/args/kinds/balanced/producer_and_consumer_group.rs b/core/bench/src/args/kinds/balanced/producer_and_consumer_group.rs
index 4a767052..6a288f3b 100644
--- a/core/bench/src/args/kinds/balanced/producer_and_consumer_group.rs
+++ b/core/bench/src/args/kinds/balanced/producer_and_consumer_group.rs
@@ -20,7 +20,7 @@ use crate::args::{
common::IggyBenchArgs, defaults::*, props::BenchmarkKindProps,
transport::BenchmarkTransportCommand,
};
-use clap::{error::ErrorKind, CommandFactory, Parser};
+use clap::{CommandFactory, Parser, error::ErrorKind};
use iggy::prelude::IggyByteSize;
use std::num::NonZeroU32;
diff --git a/core/bench/src/args/kinds/end_to_end/producing_consumer.rs b/core/bench/src/args/kinds/end_to_end/producing_consumer.rs
index b9248d99..b33ee05e 100644
--- a/core/bench/src/args/kinds/end_to_end/producing_consumer.rs
+++ b/core/bench/src/args/kinds/end_to_end/producing_consumer.rs
@@ -20,7 +20,7 @@ use crate::args::{
common::IggyBenchArgs, defaults::*, props::BenchmarkKindProps,
transport::BenchmarkTransportCommand,
};
-use clap::{error::ErrorKind, CommandFactory, Parser};
+use clap::{CommandFactory, Parser, error::ErrorKind};
use iggy::prelude::IggyByteSize;
use std::num::NonZeroU32;
diff --git a/core/bench/src/args/kinds/end_to_end/producing_consumer_group.rs b/core/bench/src/args/kinds/end_to_end/producing_consumer_group.rs
index 22a9681f..218b4e3d 100644
--- a/core/bench/src/args/kinds/end_to_end/producing_consumer_group.rs
+++ b/core/bench/src/args/kinds/end_to_end/producing_consumer_group.rs
@@ -20,7 +20,7 @@ use crate::args::{
common::IggyBenchArgs, defaults::*, props::BenchmarkKindProps,
transport::BenchmarkTransportCommand,
};
-use clap::{error::ErrorKind, CommandFactory, Parser};
+use clap::{CommandFactory, Parser, error::ErrorKind};
use iggy::prelude::IggyByteSize;
use std::num::NonZeroU32;
diff --git a/core/bench/src/args/kinds/pinned/consumer.rs b/core/bench/src/args/kinds/pinned/consumer.rs
index ed80ae0f..5d29d395 100644
--- a/core/bench/src/args/kinds/pinned/consumer.rs
+++ b/core/bench/src/args/kinds/pinned/consumer.rs
@@ -20,7 +20,7 @@ use crate::args::{
common::IggyBenchArgs, defaults::*, props::BenchmarkKindProps,
transport::BenchmarkTransportCommand,
};
-use clap::{error::ErrorKind, CommandFactory, Parser};
+use clap::{CommandFactory, Parser, error::ErrorKind};
use iggy::prelude::IggyByteSize;
use std::num::NonZeroU32;
diff --git a/core/bench/src/args/kinds/pinned/producer.rs b/core/bench/src/args/kinds/pinned/producer.rs
index 21d1e646..5ae60eea 100644
--- a/core/bench/src/args/kinds/pinned/producer.rs
+++ b/core/bench/src/args/kinds/pinned/producer.rs
@@ -20,7 +20,7 @@ use crate::args::{
common::IggyBenchArgs, defaults::*, props::BenchmarkKindProps,
transport::BenchmarkTransportCommand,
};
-use clap::{error::ErrorKind, CommandFactory, Parser};
+use clap::{CommandFactory, Parser, error::ErrorKind};
use iggy::prelude::IggyByteSize;
use std::num::NonZeroU32;
diff --git a/core/bench/src/args/kinds/pinned/producer_and_consumer.rs b/core/bench/src/args/kinds/pinned/producer_and_consumer.rs
index 863610ae..bb21073e 100644
--- a/core/bench/src/args/kinds/pinned/producer_and_consumer.rs
+++ b/core/bench/src/args/kinds/pinned/producer_and_consumer.rs
@@ -20,7 +20,7 @@ use crate::args::{
common::IggyBenchArgs, defaults::*, props::BenchmarkKindProps,
transport::BenchmarkTransportCommand,
};
-use clap::{error::ErrorKind, CommandFactory, Parser};
+use clap::{CommandFactory, Parser, error::ErrorKind};
use iggy::prelude::IggyByteSize;
use std::num::NonZeroU32;
diff --git a/core/bench/src/benchmarks/balanced_consumer_group.rs b/core/bench/src/benchmarks/balanced_consumer_group.rs
index 0a4d5664..bb044806 100644
--- a/core/bench/src/benchmarks/balanced_consumer_group.rs
+++ b/core/bench/src/benchmarks/balanced_consumer_group.rs
@@ -78,6 +78,8 @@ impl Benchmarkable for BalancedConsumerGroupBenchmark {
let cg_count = format!("consumer groups: {}", self.args.number_of_consumer_groups());
let common_params = self.common_params_str();
- info!("Staring benchmark BalancedConsumerGroup, {streams}, {consumers}, {cg_count}, {common_params}");
+ info!(
+ "Staring benchmark BalancedConsumerGroup, {streams}, {consumers}, {cg_count}, {common_params}"
+ );
}
}
diff --git a/core/bench/src/benchmarks/balanced_producer.rs b/core/bench/src/benchmarks/balanced_producer.rs
index f1f589a0..1f8261e6 100644
--- a/core/bench/src/benchmarks/balanced_producer.rs
+++ b/core/bench/src/benchmarks/balanced_producer.rs
@@ -82,6 +82,8 @@ impl Benchmarkable for BalancedProducerBenchmark {
};
let common_params = self.common_params_str();
- info!("Staring benchmark BalancedProducer, {streams}, {partitions}, {producers}, {max_topic_size}, {common_params}");
+ info!(
+ "Staring benchmark BalancedProducer, {streams}, {partitions}, {producers}, {max_topic_size}, {common_params}"
+ );
}
}
diff --git a/core/bench/src/benchmarks/balanced_producer_and_consumer_group.rs b/core/bench/src/benchmarks/balanced_producer_and_consumer_group.rs
index 957a7591..8c86afc3 100644
--- a/core/bench/src/benchmarks/balanced_producer_and_consumer_group.rs
+++ b/core/bench/src/benchmarks/balanced_producer_and_consumer_group.rs
@@ -90,6 +90,8 @@ impl Benchmarkable for BalancedProducerAndConsumerGroupBenchmark {
};
let common_params = self.common_params_str();
- info!("Staring benchmark BalancedProducerAndConsumerGroup, {streams}, {partitions}, {producers}, {consumers}, {cg_count}, {max_topic_size}, {common_params}");
+ info!(
+ "Staring benchmark BalancedProducerAndConsumerGroup, {streams}, {partitions}, {producers}, {consumers}, {cg_count}, {max_topic_size}, {common_params}"
+ );
}
}
diff --git a/core/bench/src/benchmarks/benchmark.rs b/core/bench/src/benchmarks/benchmark.rs
index b79b4472..e7e2aa47 100644
--- a/core/bench/src/benchmarks/benchmark.rs
+++ b/core/bench/src/benchmarks/benchmark.rs
@@ -27,7 +27,7 @@ use iggy::prelude::IggyError;
use iggy::prelude::IggyExpiry;
use iggy::prelude::MaxTopicSize;
use iggy::prelude::{StreamClient, TopicClient};
-use integration::test_server::{login_root, ClientFactory};
+use integration::test_server::{ClientFactory, login_root};
use std::sync::Arc;
use tokio::task::JoinSet;
use tracing::info;
diff --git a/core/bench/src/benchmarks/common.rs b/core/bench/src/benchmarks/common.rs
index e77ba688..de6356d2 100644
--- a/core/bench/src/benchmarks/common.rs
+++ b/core/bench/src/benchmarks/common.rs
@@ -27,7 +27,7 @@ use crate::{
};
use bench_report::{benchmark_kind::BenchmarkKind, individual_metrics::BenchmarkIndividualMetrics};
use iggy::prelude::*;
-use integration::test_server::{login_root, ClientFactory};
+use integration::test_server::{ClientFactory, login_root};
use std::{future::Future, sync::Arc};
use tracing::{error, info};
@@ -106,7 +106,7 @@ pub fn build_producer_futures(
client_factory: &Arc<dyn ClientFactory>,
args: &IggyBenchArgs,
) -> Result<
- Vec<impl Future<Output = Result<BenchmarkIndividualMetrics, IggyError>> + Send>,
+ Vec<impl Future<Output = Result<BenchmarkIndividualMetrics, IggyError>> + Send + use<>>,
IggyError,
> {
let streams = args.streams();
@@ -163,7 +163,7 @@ pub fn build_consumer_futures(
client_factory: &Arc<dyn ClientFactory>,
args: &IggyBenchArgs,
) -> Result<
- Vec<impl Future<Output = Result<BenchmarkIndividualMetrics, IggyError>> + Send>,
+ Vec<impl Future<Output = Result<BenchmarkIndividualMetrics, IggyError>> + Send + use<>>,
IggyError,
> {
let start_stream_id = args.start_stream_id();
diff --git a/core/bench/src/benchmarks/end_to_end_producing_consumer.rs b/core/bench/src/benchmarks/end_to_end_producing_consumer.rs
index cdc54ca5..a7be281f 100644
--- a/core/bench/src/benchmarks/end_to_end_producing_consumer.rs
+++ b/core/bench/src/benchmarks/end_to_end_producing_consumer.rs
@@ -82,6 +82,8 @@ impl Benchmarkable for EndToEndProducingConsumerBenchmark {
};
let common_params = self.common_params_str();
- info!("Staring benchmark EndToEndProducingConsumer, {streams}, {producers}, {max_topic_size}, {common_params}");
+ info!(
+ "Staring benchmark EndToEndProducingConsumer, {streams}, {producers}, {max_topic_size}, {common_params}"
+ );
}
}
diff --git a/core/bench/src/benchmarks/pinned_producer.rs b/core/bench/src/benchmarks/pinned_producer.rs
index 194d2c66..d2b301a0 100644
--- a/core/bench/src/benchmarks/pinned_producer.rs
+++ b/core/bench/src/benchmarks/pinned_producer.rs
@@ -83,6 +83,8 @@ impl Benchmarkable for PinnedProducerBenchmark {
};
let common_params = self.common_params_str();
- info!("Staring benchmark PinnedProducer, {streams}, {producers}, {max_topic_size}, {common_params}");
+ info!(
+ "Staring benchmark PinnedProducer, {streams}, {producers}, {max_topic_size}, {common_params}"
+ );
}
}
diff --git a/core/bench/src/benchmarks/pinned_producer_and_consumer.rs b/core/bench/src/benchmarks/pinned_producer_and_consumer.rs
index aabfff7b..1940dc9b 100644
--- a/core/bench/src/benchmarks/pinned_producer_and_consumer.rs
+++ b/core/bench/src/benchmarks/pinned_producer_and_consumer.rs
@@ -88,6 +88,8 @@ impl Benchmarkable for PinnedProducerAndConsumerBenchmark {
};
let common_params = self.common_params_str();
- info!("Staring benchmark PinnedProducerAndConsumer, {streams}, {partitions}, {producers}, {consumers}, {max_topic_size}, {common_params}");
+ info!(
+ "Staring benchmark PinnedProducerAndConsumer, {streams}, {partitions}, {producers}, {consumers}, {max_topic_size}, {common_params}"
+ );
}
}
diff --git a/core/bench/src/main.rs b/core/bench/src/main.rs
index b05dd75b..fc23cf5f 100644
--- a/core/bench/src/main.rs
+++ b/core/bench/src/main.rs
@@ -31,7 +31,7 @@ use iggy::prelude::IggyError;
use std::fs;
use std::path::Path;
use tracing::{error, info};
-use tracing_subscriber::{fmt, layer::SubscriberExt, util::SubscriberInitExt, EnvFilter};
+use tracing_subscriber::{EnvFilter, fmt, layer::SubscriberExt, util::SubscriberInitExt};
use utils::cpu_name::append_cpu_name_lowercase;
#[tokio::main]
diff --git a/core/bench/src/runner.rs b/core/bench/src/runner.rs
index dcfea8cb..db0feaf6 100644
--- a/core/bench/src/runner.rs
+++ b/core/bench/src/runner.rs
@@ -19,7 +19,7 @@
use crate::analytics::report_builder::BenchmarkReportBuilder;
use crate::args::common::IggyBenchArgs;
use crate::benchmarks::benchmark::Benchmarkable;
-use crate::plot::{plot_chart, ChartType};
+use crate::plot::{ChartType, plot_chart};
use crate::utils::cpu_name::append_cpu_name_lowercase;
use crate::utils::server_starter::start_server_if_needed;
use crate::utils::{collect_server_logs_and_save_to_file, params_from_args_and_metrics};
diff --git a/core/bench/src/utils/batch_generator.rs b/core/bench/src/utils/batch_generator.rs
index b330e2d0..5ab3c9e8 100644
--- a/core/bench/src/utils/batch_generator.rs
+++ b/core/bench/src/utils/batch_generator.rs
@@ -18,7 +18,7 @@
use bench_report::numeric_parameter::BenchmarkNumericParameter;
use bytes::Bytes;
use iggy::prelude::*;
-use rand::{distr::Alphanumeric, Rng};
+use rand::{Rng, distr::Alphanumeric};
pub struct BenchmarkMessagesBatch {
pub messages: Vec<IggyMessage>,
@@ -45,7 +45,7 @@ impl BenchmarkBatchGenerator {
let random: Vec<u8> = rand::rng().sample_iter(distr).take(max_len).collect();
- let mut gen = Self {
+ let mut batch_generator = Self {
message_size,
messages_per_batch,
full_payload: Bytes::from(random),
@@ -58,10 +58,10 @@ impl BenchmarkBatchGenerator {
};
if is_fixed {
- gen.batch = gen.build_single_fixed();
+ batch_generator.batch = batch_generator.build_single_fixed();
}
- gen
+ batch_generator
}
pub fn generate_batch(&mut self) -> &mut BenchmarkMessagesBatch {
diff --git a/core/bench/src/utils/finish_condition.rs b/core/bench/src/utils/finish_condition.rs
index d5fb9185..102e65ab 100644
--- a/core/bench/src/utils/finish_condition.rs
+++ b/core/bench/src/utils/finish_condition.rs
@@ -20,8 +20,8 @@ use human_repr::HumanCount;
use std::{
fmt::Display,
sync::{
- atomic::{AtomicI64, Ordering},
Arc,
+ atomic::{AtomicI64, Ordering},
},
};
diff --git a/core/bench/src/utils/rate_limiter.rs b/core/bench/src/utils/rate_limiter.rs
index 7e77e654..f365c958 100644
--- a/core/bench/src/utils/rate_limiter.rs
+++ b/core/bench/src/utils/rate_limiter.rs
@@ -16,9 +16,9 @@
// under the License.
use governor::{
+ Quota, RateLimiter as GovernorRateLimiter,
clock::DefaultClock,
state::{InMemoryState, NotKeyed},
- Quota, RateLimiter as GovernorRateLimiter,
};
use iggy::prelude::IggyByteSize;
use std::num::NonZeroU32;
diff --git a/core/bench/src/utils/server_starter.rs b/core/bench/src/utils/server_starter.rs
index 32e974d1..c3d0df52 100644
--- a/core/bench/src/utils/server_starter.rs
+++ b/core/bench/src/utils/server_starter.rs
@@ -17,7 +17,7 @@
*/
use crate::args::common::IggyBenchArgs;
-use integration::test_server::{IpAddrKind, TestServer, Transport, SYSTEM_PATH_ENV_VAR};
+use integration::test_server::{IpAddrKind, SYSTEM_PATH_ENV_VAR, TestServer, Transport};
use serde::Deserialize;
use std::net::SocketAddr;
use std::{collections::HashMap, time::Instant};
@@ -126,7 +126,11 @@ pub async fn start_server_if_needed(args: &mut IggyBenchArgs) -> Option<TestServ
test_server.start();
let elapsed = now.elapsed();
if elapsed.as_millis() > 1000 {
- warn!("Test iggy-server started, pid: {}, startup took {} ms because it had to load messages from disk to cache", test_server.pid(), elapsed.as_millis());
+ warn!(
+ "Test iggy-server started, pid: {}, startup took {} ms because it had to load messages from disk to cache",
+ test_server.pid(),
+ elapsed.as_millis()
+ );
} else {
info!(
"Test iggy-server started, pid: {}, startup time: {} ms",
diff --git a/core/binary_protocol/Cargo.toml b/core/binary_protocol/Cargo.toml
index 2a3b43ed..9a7f57ec 100644
--- a/core/binary_protocol/Cargo.toml
+++ b/core/binary_protocol/Cargo.toml
@@ -19,7 +19,7 @@
name = "iggy_binary_protocol"
version = "0.7.0"
description = "Iggy is the persistent message streaming platform written in Rust, supporting QUIC, TCP and HTTP transport protocols, capable of processing millions of messages per second."
-edition = "2021"
+edition = "2024"
license = "Apache-2.0"
keywords = ["iggy", "messaging", "streaming"]
categories = ["command-line-utilities", "database", "network-programming"]
diff --git a/core/binary_protocol/src/cli/binary_client/get_client.rs b/core/binary_protocol/src/cli/binary_client/get_client.rs
index 9fd5bc25..bf20afff 100644
--- a/core/binary_protocol/src/cli/binary_client/get_client.rs
+++ b/core/binary_protocol/src/cli/binary_client/get_client.rs
@@ -16,13 +16,13 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
-use comfy_table::{presets::ASCII_NO_BORDERS, Table};
+use comfy_table::{Table, presets::ASCII_NO_BORDERS};
use iggy_common::get_client::GetClient;
-use tracing::{event, Level};
+use tracing::{Level, event};
pub struct GetClientCmd {
get_client: GetClient,
diff --git a/core/binary_protocol/src/cli/binary_client/get_clients.rs b/core/binary_protocol/src/cli/binary_client/get_clients.rs
index ae5ac62e..565e69cf 100644
--- a/core/binary_protocol/src/cli/binary_client/get_clients.rs
+++ b/core/binary_protocol/src/cli/binary_client/get_clients.rs
@@ -16,13 +16,13 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::Table;
use iggy_common::get_clients::GetClients;
-use tracing::{event, Level};
+use tracing::{Level, event};
pub enum GetClientsOutput {
Table,
diff --git a/core/binary_protocol/src/cli/binary_consumer_groups/create_consumer_group.rs b/core/binary_protocol/src/cli/binary_consumer_groups/create_consumer_group.rs
index c4d30f23..a72061fd 100644
--- a/core/binary_protocol/src/cli/binary_consumer_groups/create_consumer_group.rs
+++ b/core/binary_protocol/src/cli/binary_consumer_groups/create_consumer_group.rs
@@ -16,13 +16,13 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
-use iggy_common::create_consumer_group::CreateConsumerGroup;
use iggy_common::Identifier;
-use tracing::{event, Level};
+use iggy_common::create_consumer_group::CreateConsumerGroup;
+use tracing::{Level, event};
pub struct CreateConsumerGroupCmd {
create_consumer_group: CreateConsumerGroup,
diff --git a/core/binary_protocol/src/cli/binary_consumer_groups/delete_consumer_group.rs b/core/binary_protocol/src/cli/binary_consumer_groups/delete_consumer_group.rs
index 094294df..bd113d7d 100644
--- a/core/binary_protocol/src/cli/binary_consumer_groups/delete_consumer_group.rs
+++ b/core/binary_protocol/src/cli/binary_consumer_groups/delete_consumer_group.rs
@@ -16,13 +16,13 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
-use iggy_common::delete_consumer_group::DeleteConsumerGroup;
use iggy_common::Identifier;
-use tracing::{event, Level};
+use iggy_common::delete_consumer_group::DeleteConsumerGroup;
+use tracing::{Level, event};
pub struct DeleteConsumerGroupCmd {
delete_consumer_group: DeleteConsumerGroup,
diff --git a/core/binary_protocol/src/cli/binary_consumer_groups/get_consumer_group.rs b/core/binary_protocol/src/cli/binary_consumer_groups/get_consumer_group.rs
index 293c9e7c..49ae1f7e 100644
--- a/core/binary_protocol/src/cli/binary_consumer_groups/get_consumer_group.rs
+++ b/core/binary_protocol/src/cli/binary_consumer_groups/get_consumer_group.rs
@@ -16,14 +16,14 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
-use comfy_table::{presets::ASCII_NO_BORDERS, Table};
-use iggy_common::get_consumer_group::GetConsumerGroup;
+use comfy_table::{Table, presets::ASCII_NO_BORDERS};
use iggy_common::Identifier;
-use tracing::{event, Level};
+use iggy_common::get_consumer_group::GetConsumerGroup;
+use tracing::{Level, event};
pub struct GetConsumerGroupCmd {
get_consumer_group: GetConsumerGroup,
diff --git a/core/binary_protocol/src/cli/binary_consumer_groups/get_consumer_groups.rs b/core/binary_protocol/src/cli/binary_consumer_groups/get_consumer_groups.rs
index 9323ff87..8b5f88b8 100644
--- a/core/binary_protocol/src/cli/binary_consumer_groups/get_consumer_groups.rs
+++ b/core/binary_protocol/src/cli/binary_consumer_groups/get_consumer_groups.rs
@@ -16,15 +16,15 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::Table;
-use iggy_common::get_consumer_groups::GetConsumerGroups;
use iggy_common::Identifier;
+use iggy_common::get_consumer_groups::GetConsumerGroups;
use std::fmt::{self, Display, Formatter};
-use tracing::{event, Level};
+use tracing::{Level, event};
pub enum GetConsumerGroupsOutput {
Table,
diff --git a/core/binary_protocol/src/cli/binary_consumer_offsets/get_consumer_offset.rs b/core/binary_protocol/src/cli/binary_consumer_offsets/get_consumer_offset.rs
index 05bd4894..3b5bf893 100644
--- a/core/binary_protocol/src/cli/binary_consumer_offsets/get_consumer_offset.rs
+++ b/core/binary_protocol/src/cli/binary_consumer_offsets/get_consumer_offset.rs
@@ -16,14 +16,14 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::Table;
use iggy_common::get_consumer_offset::GetConsumerOffset;
use iggy_common::{Consumer, ConsumerKind, Identifier};
-use tracing::{event, Level};
+use tracing::{Level, event};
pub struct GetConsumerOffsetCmd {
get_consumer_offset: GetConsumerOffset,
diff --git a/core/binary_protocol/src/cli/binary_consumer_offsets/set_consumer_offset.rs b/core/binary_protocol/src/cli/binary_consumer_offsets/set_consumer_offset.rs
index 13f0bac7..3c200a02 100644
--- a/core/binary_protocol/src/cli/binary_consumer_offsets/set_consumer_offset.rs
+++ b/core/binary_protocol/src/cli/binary_consumer_offsets/set_consumer_offset.rs
@@ -16,14 +16,14 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
-use iggy_common::store_consumer_offset::StoreConsumerOffset;
use iggy_common::Identifier;
+use iggy_common::store_consumer_offset::StoreConsumerOffset;
use iggy_common::{Consumer, ConsumerKind};
-use tracing::{event, Level};
+use tracing::{Level, event};
pub struct SetConsumerOffsetCmd {
set_consumer_offset: StoreConsumerOffset,
diff --git a/core/binary_protocol/src/cli/binary_context/common.rs b/core/binary_protocol/src/cli/binary_context/common.rs
index 537a3eae..9ba0ea03 100644
--- a/core/binary_protocol/src/cli/binary_context/common.rs
+++ b/core/binary_protocol/src/cli/binary_context/common.rs
@@ -16,7 +16,7 @@
* under the License.
*/
-use anyhow::{bail, Context, Result};
+use anyhow::{Context, Result, bail};
use dirs::home_dir;
use serde::{Deserialize, Serialize};
use std::path::PathBuf;
diff --git a/core/binary_protocol/src/cli/binary_context/get_contexts.rs b/core/binary_protocol/src/cli/binary_context/get_contexts.rs
index cc056668..b331d811 100644
--- a/core/binary_protocol/src/cli/binary_context/get_contexts.rs
+++ b/core/binary_protocol/src/cli/binary_context/get_contexts.rs
@@ -18,10 +18,10 @@
use async_trait::async_trait;
use comfy_table::Table;
-use tracing::{event, Level};
+use tracing::{Level, event};
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use super::common::ContextManager;
diff --git a/core/binary_protocol/src/cli/binary_context/use_context.rs b/core/binary_protocol/src/cli/binary_context/use_context.rs
index 6d9e390b..ff88b57c 100644
--- a/core/binary_protocol/src/cli/binary_context/use_context.rs
+++ b/core/binary_protocol/src/cli/binary_context/use_context.rs
@@ -17,10 +17,10 @@
*/
use async_trait::async_trait;
-use tracing::{event, Level};
+use tracing::{Level, event};
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use super::common::{ContextManager, DEFAULT_CONTEXT_NAME};
diff --git a/core/binary_protocol/src/cli/binary_message/flush_messages.rs b/core/binary_protocol/src/cli/binary_message/flush_messages.rs
index e1ed8dab..7551ebbf 100644
--- a/core/binary_protocol/src/cli/binary_message/flush_messages.rs
+++ b/core/binary_protocol/src/cli/binary_message/flush_messages.rs
@@ -16,12 +16,12 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::{Context, Error};
use async_trait::async_trait;
use iggy_common::Identifier;
-use tracing::{event, Level};
+use tracing::{Level, event};
pub struct FlushMessagesCmd {
stream_id: Identifier,
diff --git a/core/binary_protocol/src/cli/binary_message/poll_messages.rs b/core/binary_protocol/src/cli/binary_message/poll_messages.rs
index 111abf1f..12716ab6 100644
--- a/core/binary_protocol/src/cli/binary_message/poll_messages.rs
+++ b/core/binary_protocol/src/cli/binary_message/poll_messages.rs
@@ -16,8 +16,8 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::{Cell, CellAlignment, Row, Table};
@@ -27,7 +27,7 @@ use iggy_common::{
};
use std::collections::{HashMap, HashSet};
use tokio::io::AsyncWriteExt;
-use tracing::{event, Level};
+use tracing::{Level, event};
pub struct PollMessagesCmd {
poll_messages: PollMessages,
diff --git a/core/binary_protocol/src/cli/binary_message/send_messages.rs b/core/binary_protocol/src/cli/binary_message/send_messages.rs
index 540329cd..fa42a984 100644
--- a/core/binary_protocol/src/cli/binary_message/send_messages.rs
+++ b/core/binary_protocol/src/cli/binary_message/send_messages.rs
@@ -16,8 +16,8 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use bytes::Bytes;
@@ -27,7 +27,7 @@ use iggy_common::{
use std::collections::HashMap;
use std::io::{self, Read};
use tokio::io::AsyncReadExt;
-use tracing::{event, Level};
+use tracing::{Level, event};
pub struct SendMessagesCmd {
stream_id: Identifier,
diff --git a/core/binary_protocol/src/cli/binary_partitions/create_partitions.rs b/core/binary_protocol/src/cli/binary_partitions/create_partitions.rs
index 85a8e2c1..0ddce4dd 100644
--- a/core/binary_protocol/src/cli/binary_partitions/create_partitions.rs
+++ b/core/binary_protocol/src/cli/binary_partitions/create_partitions.rs
@@ -16,13 +16,13 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
-use iggy_common::create_partitions::CreatePartitions;
use iggy_common::Identifier;
-use tracing::{event, Level};
+use iggy_common::create_partitions::CreatePartitions;
+use tracing::{Level, event};
pub struct CreatePartitionsCmd {
create_partition: CreatePartitions,
diff --git a/core/binary_protocol/src/cli/binary_partitions/delete_partitions.rs b/core/binary_protocol/src/cli/binary_partitions/delete_partitions.rs
index 37729e47..a05d6a07 100644
--- a/core/binary_protocol/src/cli/binary_partitions/delete_partitions.rs
+++ b/core/binary_protocol/src/cli/binary_partitions/delete_partitions.rs
@@ -16,13 +16,13 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
-use iggy_common::delete_partitions::DeletePartitions;
use iggy_common::Identifier;
-use tracing::{event, Level};
+use iggy_common::delete_partitions::DeletePartitions;
+use tracing::{Level, event};
pub struct DeletePartitionsCmd {
delete_partitions: DeletePartitions,
diff --git a/core/binary_protocol/src/cli/binary_personal_access_tokens/create_personal_access_token.rs b/core/binary_protocol/src/cli/binary_personal_access_tokens/create_personal_access_token.rs
index eb735bec..14adfe16 100644
--- a/core/binary_protocol/src/cli/binary_personal_access_tokens/create_personal_access_token.rs
+++ b/core/binary_protocol/src/cli/binary_personal_access_tokens/create_personal_access_token.rs
@@ -16,14 +16,14 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
-use iggy_common::create_personal_access_token::CreatePersonalAccessToken;
use iggy_common::PersonalAccessTokenExpiry;
+use iggy_common::create_personal_access_token::CreatePersonalAccessToken;
use keyring::Entry;
-use tracing::{event, Level};
+use tracing::{Level, event};
pub struct CreatePersonalAccessTokenCmd {
create_token: CreatePersonalAccessToken,
diff --git a/core/binary_protocol/src/cli/binary_personal_access_tokens/delete_personal_access_tokens.rs b/core/binary_protocol/src/cli/binary_personal_access_tokens/delete_personal_access_tokens.rs
index 14b5a89f..d8ca5ce4 100644
--- a/core/binary_protocol/src/cli/binary_personal_access_tokens/delete_personal_access_tokens.rs
+++ b/core/binary_protocol/src/cli/binary_personal_access_tokens/delete_personal_access_tokens.rs
@@ -16,13 +16,13 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use iggy_common::delete_personal_access_token::DeletePersonalAccessToken;
use keyring::Entry;
-use tracing::{event, Level};
+use tracing::{Level, event};
pub struct DeletePersonalAccessTokenCmd {
delete_token: DeletePersonalAccessToken,
diff --git a/core/binary_protocol/src/cli/binary_personal_access_tokens/get_personal_access_tokens.rs b/core/binary_protocol/src/cli/binary_personal_access_tokens/get_personal_access_tokens.rs
index 38961b63..51617d99 100644
--- a/core/binary_protocol/src/cli/binary_personal_access_tokens/get_personal_access_tokens.rs
+++ b/core/binary_protocol/src/cli/binary_personal_access_tokens/get_personal_access_tokens.rs
@@ -16,13 +16,13 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::Table;
use iggy_common::get_personal_access_tokens::GetPersonalAccessTokens;
-use tracing::{event, Level};
+use tracing::{Level, event};
pub enum GetPersonalAccessTokensOutput {
Table,
diff --git a/core/binary_protocol/src/cli/binary_segments/delete_segments.rs b/core/binary_protocol/src/cli/binary_segments/delete_segments.rs
index 3ba374ef..64a0be28 100644
--- a/core/binary_protocol/src/cli/binary_segments/delete_segments.rs
+++ b/core/binary_protocol/src/cli/binary_segments/delete_segments.rs
@@ -15,13 +15,13 @@
* specific language governing permissions and limitations
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
-use iggy_common::delete_segments::DeleteSegments;
use iggy_common::Identifier;
-use tracing::{event, Level};
+use iggy_common::delete_segments::DeleteSegments;
+use tracing::{Level, event};
pub struct DeleteSegmentsCmd {
delete_segments: DeleteSegments,
diff --git a/core/binary_protocol/src/cli/binary_streams/create_stream.rs b/core/binary_protocol/src/cli/binary_streams/create_stream.rs
index c8b54002..4398679b 100644
--- a/core/binary_protocol/src/cli/binary_streams/create_stream.rs
+++ b/core/binary_protocol/src/cli/binary_streams/create_stream.rs
@@ -16,12 +16,12 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use iggy_common::create_stream::CreateStream;
-use tracing::{event, Level};
+use tracing::{Level, event};
pub struct CreateStreamCmd {
create_stream: CreateStream,
diff --git a/core/binary_protocol/src/cli/binary_streams/delete_stream.rs b/core/binary_protocol/src/cli/binary_streams/delete_stream.rs
index 61475349..b1cf60ff 100644
--- a/core/binary_protocol/src/cli/binary_streams/delete_stream.rs
+++ b/core/binary_protocol/src/cli/binary_streams/delete_stream.rs
@@ -16,13 +16,13 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
-use iggy_common::delete_stream::DeleteStream;
use iggy_common::Identifier;
-use tracing::{event, Level};
+use iggy_common::delete_stream::DeleteStream;
+use tracing::{Level, event};
pub struct DeleteStreamCmd {
delete_stream: DeleteStream,
diff --git a/core/binary_protocol/src/cli/binary_streams/get_stream.rs b/core/binary_protocol/src/cli/binary_streams/get_stream.rs
index cb98d880..64b4512e 100644
--- a/core/binary_protocol/src/cli/binary_streams/get_stream.rs
+++ b/core/binary_protocol/src/cli/binary_streams/get_stream.rs
@@ -16,14 +16,14 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::Table;
-use iggy_common::get_stream::GetStream;
use iggy_common::Identifier;
-use tracing::{event, Level};
+use iggy_common::get_stream::GetStream;
+use tracing::{Level, event};
pub struct GetStreamCmd {
get_stream: GetStream,
diff --git a/core/binary_protocol/src/cli/binary_streams/get_streams.rs b/core/binary_protocol/src/cli/binary_streams/get_streams.rs
index e8a50fde..15926a86 100644
--- a/core/binary_protocol/src/cli/binary_streams/get_streams.rs
+++ b/core/binary_protocol/src/cli/binary_streams/get_streams.rs
@@ -16,13 +16,13 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::Table;
use iggy_common::get_streams::GetStreams;
-use tracing::{event, Level};
+use tracing::{Level, event};
pub enum GetStreamsOutput {
Table,
diff --git a/core/binary_protocol/src/cli/binary_streams/purge_stream.rs b/core/binary_protocol/src/cli/binary_streams/purge_stream.rs
index 915f890f..e633faa8 100644
--- a/core/binary_protocol/src/cli/binary_streams/purge_stream.rs
+++ b/core/binary_protocol/src/cli/binary_streams/purge_stream.rs
@@ -16,13 +16,13 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
-use iggy_common::purge_stream::PurgeStream;
use iggy_common::Identifier;
-use tracing::{event, Level};
+use iggy_common::purge_stream::PurgeStream;
+use tracing::{Level, event};
pub struct PurgeStreamCmd {
purge_stream: PurgeStream,
diff --git a/core/binary_protocol/src/cli/binary_streams/update_stream.rs b/core/binary_protocol/src/cli/binary_streams/update_stream.rs
index aecab7a2..246ab5b1 100644
--- a/core/binary_protocol/src/cli/binary_streams/update_stream.rs
+++ b/core/binary_protocol/src/cli/binary_streams/update_stream.rs
@@ -16,13 +16,13 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
-use iggy_common::update_stream::UpdateStream;
use iggy_common::Identifier;
-use tracing::{event, Level};
+use iggy_common::update_stream::UpdateStream;
+use tracing::{Level, event};
pub struct UpdateStreamCmd {
update_stream: UpdateStream,
diff --git a/core/binary_protocol/src/cli/binary_system/login.rs b/core/binary_protocol/src/cli/binary_system/login.rs
index 365d49ac..1ec321c1 100644
--- a/core/binary_protocol/src/cli/binary_system/login.rs
+++ b/core/binary_protocol/src/cli/binary_system/login.rs
@@ -16,14 +16,14 @@
* under the License.
*/
+use crate::Client;
use crate::cli::binary_system::session::ServerSession;
use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::cli::utils::login_session_expiry::LoginSessionExpiry;
-use crate::Client;
use anyhow::Context;
use async_trait::async_trait;
use iggy_common::SEC_IN_MICRO;
-use tracing::{event, Level};
+use tracing::{Level, event};
const DEFAULT_LOGIN_SESSION_TIMEOUT: u64 = SEC_IN_MICRO * 15 * 60;
diff --git a/core/binary_protocol/src/cli/binary_system/logout.rs b/core/binary_protocol/src/cli/binary_system/logout.rs
index 9afa4cb1..8466dd73 100644
--- a/core/binary_protocol/src/cli/binary_system/logout.rs
+++ b/core/binary_protocol/src/cli/binary_system/logout.rs
@@ -16,12 +16,12 @@
* under the License.
*/
+use crate::Client;
use crate::cli::binary_system::session::ServerSession;
use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
-use crate::Client;
use anyhow::Context;
use async_trait::async_trait;
-use tracing::{event, Level};
+use tracing::{Level, event};
pub struct LogoutCmd {
server_session: ServerSession,
diff --git a/core/binary_protocol/src/cli/binary_system/me.rs b/core/binary_protocol/src/cli/binary_system/me.rs
index 80cb9662..78d59e95 100644
--- a/core/binary_protocol/src/cli/binary_system/me.rs
+++ b/core/binary_protocol/src/cli/binary_system/me.rs
@@ -16,13 +16,13 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::Table;
use iggy_common::get_me::GetMe;
-use tracing::{event, Level};
+use tracing::{Level, event};
pub struct GetMeCmd {
_get_me: GetMe,
diff --git a/core/binary_protocol/src/cli/binary_system/ping.rs b/core/binary_protocol/src/cli/binary_system/ping.rs
index d577139f..5718691a 100644
--- a/core/binary_protocol/src/cli/binary_system/ping.rs
+++ b/core/binary_protocol/src/cli/binary_system/ping.rs
@@ -16,15 +16,15 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use iggy_common::ping::Ping;
use std::fmt::{Display, Formatter, Result};
use std::time::Duration;
-use tokio::time::{sleep, Instant};
-use tracing::{event, Level};
+use tokio::time::{Instant, sleep};
+use tracing::{Level, event};
pub struct PingCmd {
_ping: Ping,
diff --git a/core/binary_protocol/src/cli/binary_system/snapshot.rs b/core/binary_protocol/src/cli/binary_system/snapshot.rs
index 0d798641..5ecba57a 100644
--- a/core/binary_protocol/src/cli/binary_system/snapshot.rs
+++ b/core/binary_protocol/src/cli/binary_system/snapshot.rs
@@ -18,15 +18,15 @@
use std::path::Path;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::Table;
use iggy_common::get_snapshot::GetSnapshot;
use iggy_common::{SnapshotCompression, SystemSnapshotType};
use tokio::io::AsyncWriteExt;
-use tracing::{event, Level};
+use tracing::{Level, event};
pub struct GetSnapshotCmd {
_get_snapshot: GetSnapshot,
diff --git a/core/binary_protocol/src/cli/binary_system/stats.rs b/core/binary_protocol/src/cli/binary_system/stats.rs
index c7ed928d..b20fe917 100644
--- a/core/binary_protocol/src/cli/binary_system/stats.rs
+++ b/core/binary_protocol/src/cli/binary_system/stats.rs
@@ -16,15 +16,15 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::Table;
use iggy_common::get_stats::GetStats;
use std::fmt::Display;
use std::time::SystemTime;
-use tracing::{event, Level};
+use tracing::{Level, event};
#[derive(Debug, Clone, Copy, Eq, PartialEq)]
pub enum GetStatsOutput {
diff --git a/core/binary_protocol/src/cli/binary_topics/create_topic.rs b/core/binary_protocol/src/cli/binary_topics/create_topic.rs
index 950902dd..9eaf6801 100644
--- a/core/binary_protocol/src/cli/binary_topics/create_topic.rs
+++ b/core/binary_protocol/src/cli/binary_topics/create_topic.rs
@@ -16,14 +16,14 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use core::fmt;
use iggy_common::create_topic::CreateTopic;
use iggy_common::{CompressionAlgorithm, Identifier, IggyExpiry, MaxTopicSize};
-use tracing::{event, Level};
+use tracing::{Level, event};
pub struct CreateTopicCmd {
create_topic: CreateTopic,
diff --git a/core/binary_protocol/src/cli/binary_topics/delete_topic.rs b/core/binary_protocol/src/cli/binary_topics/delete_topic.rs
index 3ee27224..e48665b5 100644
--- a/core/binary_protocol/src/cli/binary_topics/delete_topic.rs
+++ b/core/binary_protocol/src/cli/binary_topics/delete_topic.rs
@@ -16,13 +16,13 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
-use iggy_common::delete_topic::DeleteTopic;
use iggy_common::Identifier;
-use tracing::{event, Level};
+use iggy_common::delete_topic::DeleteTopic;
+use tracing::{Level, event};
pub struct DeleteTopicCmd {
delete_topic: DeleteTopic,
diff --git a/core/binary_protocol/src/cli/binary_topics/get_topic.rs b/core/binary_protocol/src/cli/binary_topics/get_topic.rs
index f78c5854..f20731e9 100644
--- a/core/binary_protocol/src/cli/binary_topics/get_topic.rs
+++ b/core/binary_protocol/src/cli/binary_topics/get_topic.rs
@@ -16,15 +16,15 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::Table;
-use iggy_common::get_topic::GetTopic;
use iggy_common::Identifier;
use iggy_common::IggyExpiry;
-use tracing::{event, Level};
+use iggy_common::get_topic::GetTopic;
+use tracing::{Level, event};
pub struct GetTopicCmd {
get_topic: GetTopic,
diff --git a/core/binary_protocol/src/cli/binary_topics/get_topics.rs b/core/binary_protocol/src/cli/binary_topics/get_topics.rs
index 7f70b0d2..da98918f 100644
--- a/core/binary_protocol/src/cli/binary_topics/get_topics.rs
+++ b/core/binary_protocol/src/cli/binary_topics/get_topics.rs
@@ -16,15 +16,15 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::Table;
use iggy_common::get_topics::GetTopics;
use iggy_common::{Identifier, IggyExpiry};
use std::fmt::{self, Display, Formatter};
-use tracing::{event, Level};
+use tracing::{Level, event};
pub enum GetTopicsOutput {
Table,
diff --git a/core/binary_protocol/src/cli/binary_topics/purge_topic.rs b/core/binary_protocol/src/cli/binary_topics/purge_topic.rs
index b204dcc6..65447f77 100644
--- a/core/binary_protocol/src/cli/binary_topics/purge_topic.rs
+++ b/core/binary_protocol/src/cli/binary_topics/purge_topic.rs
@@ -16,13 +16,13 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
-use iggy_common::purge_topic::PurgeTopic;
use iggy_common::Identifier;
-use tracing::{event, Level};
+use iggy_common::purge_topic::PurgeTopic;
+use tracing::{Level, event};
pub struct PurgeTopicCmd {
purge_topic: PurgeTopic,
diff --git a/core/binary_protocol/src/cli/binary_topics/update_topic.rs b/core/binary_protocol/src/cli/binary_topics/update_topic.rs
index 001381c9..7e1eb2db 100644
--- a/core/binary_protocol/src/cli/binary_topics/update_topic.rs
+++ b/core/binary_protocol/src/cli/binary_topics/update_topic.rs
@@ -16,14 +16,14 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use core::fmt;
use iggy_common::update_topic::UpdateTopic;
use iggy_common::{CompressionAlgorithm, Identifier, IggyExpiry, MaxTopicSize};
-use tracing::{event, Level};
+use tracing::{Level, event};
pub struct UpdateTopicCmd {
update_topic: UpdateTopic,
diff --git a/core/binary_protocol/src/cli/binary_users/change_password.rs b/core/binary_protocol/src/cli/binary_users/change_password.rs
index e7de2d76..a64e8be3 100644
--- a/core/binary_protocol/src/cli/binary_users/change_password.rs
+++ b/core/binary_protocol/src/cli/binary_users/change_password.rs
@@ -16,13 +16,13 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use iggy_common::Identifier;
-use passterm::{isatty, prompt_password_stdin, prompt_password_tty, Stream};
-use tracing::{event, Level};
+use passterm::{Stream, isatty, prompt_password_stdin, prompt_password_tty};
+use tracing::{Level, event};
pub struct ChangePasswordCmd {
user_id: Identifier,
diff --git a/core/binary_protocol/src/cli/binary_users/create_user.rs b/core/binary_protocol/src/cli/binary_users/create_user.rs
index 94bb38b1..5054f7c0 100644
--- a/core/binary_protocol/src/cli/binary_users/create_user.rs
+++ b/core/binary_protocol/src/cli/binary_users/create_user.rs
@@ -16,14 +16,14 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
-use iggy_common::create_user::CreateUser;
use iggy_common::Permissions;
use iggy_common::UserStatus;
-use tracing::{event, Level};
+use iggy_common::create_user::CreateUser;
+use tracing::{Level, event};
pub struct CreateUserCmd {
create_user: CreateUser,
diff --git a/core/binary_protocol/src/cli/binary_users/delete_user.rs b/core/binary_protocol/src/cli/binary_users/delete_user.rs
index d8a75ccb..23e027d6 100644
--- a/core/binary_protocol/src/cli/binary_users/delete_user.rs
+++ b/core/binary_protocol/src/cli/binary_users/delete_user.rs
@@ -16,13 +16,13 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
-use iggy_common::delete_user::DeleteUser;
use iggy_common::Identifier;
-use tracing::{event, Level};
+use iggy_common::delete_user::DeleteUser;
+use tracing::{Level, event};
pub struct DeleteUserCmd {
delete_user: DeleteUser,
diff --git a/core/binary_protocol/src/cli/binary_users/get_user.rs b/core/binary_protocol/src/cli/binary_users/get_user.rs
index 48ba58c2..e7a459bd 100644
--- a/core/binary_protocol/src/cli/binary_users/get_user.rs
+++ b/core/binary_protocol/src/cli/binary_users/get_user.rs
@@ -16,14 +16,14 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::Table;
-use iggy_common::get_user::GetUser;
use iggy_common::Identifier;
-use tracing::{event, Level};
+use iggy_common::get_user::GetUser;
+use tracing::{Level, event};
pub struct GetUserCmd {
get_user: GetUser,
diff --git a/core/binary_protocol/src/cli/binary_users/get_users.rs b/core/binary_protocol/src/cli/binary_users/get_users.rs
index 7a7d325d..72f327bd 100644
--- a/core/binary_protocol/src/cli/binary_users/get_users.rs
+++ b/core/binary_protocol/src/cli/binary_users/get_users.rs
@@ -16,13 +16,13 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::Table;
use iggy_common::get_users::GetUsers;
-use tracing::{event, Level};
+use tracing::{Level, event};
pub enum GetUsersOutput {
Table,
diff --git a/core/binary_protocol/src/cli/binary_users/update_permissions.rs b/core/binary_protocol/src/cli/binary_users/update_permissions.rs
index 09e1ad7d..395983da 100644
--- a/core/binary_protocol/src/cli/binary_users/update_permissions.rs
+++ b/core/binary_protocol/src/cli/binary_users/update_permissions.rs
@@ -16,13 +16,13 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use iggy_common::update_permissions::UpdatePermissions;
use iggy_common::{Identifier, Permissions};
-use tracing::{event, Level};
+use tracing::{Level, event};
pub struct UpdatePermissionsCmd {
update_permissions: UpdatePermissions,
diff --git a/core/binary_protocol/src/cli/binary_users/update_user.rs b/core/binary_protocol/src/cli/binary_users/update_user.rs
index fe76129c..c16d9722 100644
--- a/core/binary_protocol/src/cli/binary_users/update_user.rs
+++ b/core/binary_protocol/src/cli/binary_users/update_user.rs
@@ -16,14 +16,14 @@
* under the License.
*/
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use crate::Client;
+use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
-use iggy_common::update_user::UpdateUser;
use iggy_common::Identifier;
use iggy_common::UserStatus;
-use tracing::{event, Level};
+use iggy_common::update_user::UpdateUser;
+use tracing::{Level, event};
#[derive(Debug, Clone)]
pub enum UpdateUserType {
diff --git a/core/binary_protocol/src/client/binary_clients/binary_client.rs b/core/binary_protocol/src/client/binary_clients/binary_client.rs
index c8cfe877..b0d5f29f 100644
--- a/core/binary_protocol/src/client/binary_clients/binary_client.rs
+++ b/core/binary_protocol/src/client/binary_clients/binary_client.rs
@@ -16,8 +16,8 @@
* under the License.
*/
-use crate::client::binary_clients::client::Client;
use crate::BinaryTransport;
+use crate::client::binary_clients::client::Client;
use async_trait::async_trait;
/// A client that can send and receive binary messages.
diff --git a/core/binary_protocol/src/client/binary_consumer_offsets/mod.rs b/core/binary_protocol/src/client/binary_consumer_offsets/mod.rs
index a6517594..9d2ceda7 100644
--- a/core/binary_protocol/src/client/binary_consumer_offsets/mod.rs
+++ b/core/binary_protocol/src/client/binary_consumer_offsets/mod.rs
@@ -15,10 +15,10 @@
* specific language governing permissions and limitations
* under the License.
*/
+use crate::ConsumerOffsetClient;
use crate::client::binary_clients::BinaryClient;
use crate::utils::auth::fail_if_not_authenticated;
use crate::utils::mapper;
-use crate::ConsumerOffsetClient;
use iggy_common::delete_consumer_offset::DeleteConsumerOffset;
use iggy_common::get_consumer_offset::GetConsumerOffset;
use iggy_common::store_consumer_offset::StoreConsumerOffset;
diff --git a/core/binary_protocol/src/client/binary_messages/mod.rs b/core/binary_protocol/src/client/binary_messages/mod.rs
index 784a4293..cef26620 100644
--- a/core/binary_protocol/src/client/binary_messages/mod.rs
+++ b/core/binary_protocol/src/client/binary_messages/mod.rs
@@ -19,8 +19,8 @@ use crate::utils::auth::fail_if_not_authenticated;
use crate::{BinaryClient, MessageClient};
use iggy_common::{
BytesSerializable, Consumer, FlushUnsavedBuffer, Identifier, IggyError, IggyMessage,
- Partitioning, PollMessages, PolledMessages, PollingStrategy, SendMessages, POLL_MESSAGES_CODE,
- SEND_MESSAGES_CODE,
+ POLL_MESSAGES_CODE, Partitioning, PollMessages, PolledMessages, PollingStrategy,
+ SEND_MESSAGES_CODE, SendMessages,
};
#[async_trait::async_trait]
diff --git a/core/binary_protocol/src/client/binary_segments/mod.rs b/core/binary_protocol/src/client/binary_segments/mod.rs
index b1b52847..f7fa840f 100644
--- a/core/binary_protocol/src/client/binary_segments/mod.rs
+++ b/core/binary_protocol/src/client/binary_segments/mod.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::utils::auth::fail_if_not_authenticated;
#[allow(deprecated)]
use crate::BinaryClient;
use crate::SegmentClient;
+use crate::utils::auth::fail_if_not_authenticated;
use iggy_common::delete_segments::DeleteSegments;
use iggy_common::{Identifier, IggyError};
diff --git a/core/cli/Cargo.toml b/core/cli/Cargo.toml
index 5ad5af43..eecd3956 100644
--- a/core/cli/Cargo.toml
+++ b/core/cli/Cargo.toml
@@ -18,7 +18,7 @@
[package]
name = "iggy-cli"
version = "0.9.0"
-edition = "2021"
+edition = "2024"
authors = ["bartosz.ciesla@gmail.com"]
repository = "https://github.com/apache/iggy"
homepage = "https://iggy.apache.org"
diff --git a/core/cli/src/args/mod.rs b/core/cli/src/args/mod.rs
index 380c1b42..1d9d8c6e 100644
--- a/core/cli/src/args/mod.rs
+++ b/core/cli/src/args/mod.rs
@@ -20,7 +20,7 @@ use std::path::PathBuf;
use clap::{Args, Command as ClapCommand};
use clap::{Parser, Subcommand};
-use clap_complete::{generate, Generator, Shell};
+use clap_complete::{Generator, Shell, generate};
use figlet_rs::FIGfont;
use iggy::prelude::{Args as IggyArgs, ArgsOptional as IggyArgsOptional};
diff --git a/core/cli/src/args/user.rs b/core/cli/src/args/user.rs
index e065bcd3..ea51533f 100644
--- a/core/cli/src/args/user.rs
+++ b/core/cli/src/args/user.rs
@@ -17,8 +17,8 @@
*/
use crate::args::common::ListMode;
-use crate::args::permissions::stream::StreamPermissionsArg;
use crate::args::permissions::UserStatusArg;
+use crate::args::permissions::stream::StreamPermissionsArg;
use clap::{Args, Subcommand};
use iggy::prelude::Identifier;
diff --git a/core/cli/src/credentials.rs b/core/cli/src/credentials.rs
index e9a1fa25..97089d7f 100644
--- a/core/cli/src/credentials.rs
+++ b/core/cli/src/credentials.rs
@@ -18,20 +18,20 @@
use crate::args::CliOptions;
use crate::error::{CmdToolError, IggyCmdError};
-use anyhow::{bail, Context};
+use anyhow::{Context, bail};
use iggy::clients::client::IggyClient;
use iggy::prelude::Args;
use iggy::prelude::IggyError;
use iggy::prelude::{PersonalAccessTokenClient, UserClient};
use iggy_binary_protocol::cli::binary_system::session::ServerSession;
-use passterm::{isatty, prompt_password_stdin, prompt_password_tty, Stream};
+use passterm::{Stream, isatty, prompt_password_stdin, prompt_password_tty};
use std::env::var;
#[cfg(feature = "login-session")]
mod credentials_login_session {
pub(crate) use iggy_binary_protocol::cli::cli_command::PRINT_TARGET;
pub(crate) use keyring::Entry;
- pub(crate) use tracing::{event, Level};
+ pub(crate) use tracing::{Level, event};
}
#[cfg(feature = "login-session")]
@@ -185,7 +185,9 @@ impl<'a> IggyCredentials<'a> {
) {
let server_session = ServerSession::new(server_address.clone());
server_session.delete()?;
- bail!("Login session expired for Iggy server: {server_address}, please login again or use other authentication method");
+ bail!(
+ "Login session expired for Iggy server: {server_address}, please login again or use other authentication method"
+ );
} else {
bail!("Problem with server login with token: {token_value}");
}
diff --git a/core/cli/src/main.rs b/core/cli/src/main.rs
index 91896331..132a263b 100644
--- a/core/cli/src/main.rs
+++ b/core/cli/src/main.rs
@@ -22,10 +22,9 @@ mod error;
mod logging;
use crate::args::{
- client::ClientAction, consumer_group::ConsumerGroupAction,
+ Command, IggyConsoleArgs, client::ClientAction, consumer_group::ConsumerGroupAction,
consumer_offset::ConsumerOffsetAction, permissions::PermissionsArgs,
personal_access_token::PersonalAccessTokenAction, stream::StreamAction, topic::TopicAction,
- Command, IggyConsoleArgs,
};
use crate::credentials::IggyCredentials;
use crate::error::IggyCmdError;
@@ -90,7 +89,7 @@ use iggy_binary_protocol::cli::{
},
};
use std::sync::Arc;
-use tracing::{event, Level};
+use tracing::{Level, event};
#[cfg(feature = "login-session")]
mod main_login_session {
diff --git a/core/common/Cargo.toml b/core/common/Cargo.toml
index f973230b..660d70f4 100644
--- a/core/common/Cargo.toml
+++ b/core/common/Cargo.toml
@@ -18,7 +18,7 @@
name = "iggy_common"
version = "0.7.0"
description = "Iggy is the persistent message streaming platform written in Rust, supporting QUIC, TCP and HTTP transport protocols, capable of processing millions of messages per second."
-edition = "2021"
+edition = "2024"
license = "Apache-2.0"
keywords = ["iggy", "messaging", "streaming"]
categories = ["command-line-utilities", "database", "network-programming"]
diff --git a/core/common/src/commands/consumer_groups/create_consumer_group.rs b/core/common/src/commands/consumer_groups/create_consumer_group.rs
index e4862120..f9ea4303 100644
--- a/core/common/src/commands/consumer_groups/create_consumer_group.rs
+++ b/core/common/src/commands/consumer_groups/create_consumer_group.rs
@@ -17,12 +17,12 @@
*/
use super::MAX_NAME_LENGTH;
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Identifier;
use crate::Sizeable;
use crate::Validatable;
-use crate::{Command, CREATE_CONSUMER_GROUP_CODE};
+use crate::error::IggyError;
+use crate::{CREATE_CONSUMER_GROUP_CODE, Command};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
use std::fmt::Display;
diff --git a/core/common/src/commands/consumer_groups/delete_consumer_group.rs b/core/common/src/commands/consumer_groups/delete_consumer_group.rs
index 0355577c..3eee5cc1 100644
--- a/core/common/src/commands/consumer_groups/delete_consumer_group.rs
+++ b/core/common/src/commands/consumer_groups/delete_consumer_group.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Identifier;
use crate::Sizeable;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, DELETE_CONSUMER_GROUP_CODE};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/consumer_groups/get_consumer_group.rs b/core/common/src/commands/consumer_groups/get_consumer_group.rs
index 2870eced..6febd539 100644
--- a/core/common/src/commands/consumer_groups/get_consumer_group.rs
+++ b/core/common/src/commands/consumer_groups/get_consumer_group.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Identifier;
use crate::Sizeable;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, GET_CONSUMER_GROUP_CODE};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/consumer_groups/get_consumer_groups.rs b/core/common/src/commands/consumer_groups/get_consumer_groups.rs
index ca970a87..d2f64293 100644
--- a/core/common/src/commands/consumer_groups/get_consumer_groups.rs
+++ b/core/common/src/commands/consumer_groups/get_consumer_groups.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Identifier;
use crate::Sizeable;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, GET_CONSUMER_GROUPS_CODE};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/consumer_groups/join_consumer_group.rs b/core/common/src/commands/consumer_groups/join_consumer_group.rs
index 3dc5e3e2..5385373e 100644
--- a/core/common/src/commands/consumer_groups/join_consumer_group.rs
+++ b/core/common/src/commands/consumer_groups/join_consumer_group.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Identifier;
use crate::Sizeable;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, JOIN_CONSUMER_GROUP_CODE};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/consumer_groups/leave_consumer_group.rs b/core/common/src/commands/consumer_groups/leave_consumer_group.rs
index 80a51cee..ff22829d 100644
--- a/core/common/src/commands/consumer_groups/leave_consumer_group.rs
+++ b/core/common/src/commands/consumer_groups/leave_consumer_group.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Identifier;
use crate::Sizeable;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, LEAVE_CONSUMER_GROUP_CODE};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/consumer_offsets/delete_consumer_offset.rs b/core/common/src/commands/consumer_offsets/delete_consumer_offset.rs
index c49b1955..aab6c096 100644
--- a/core/common/src/commands/consumer_offsets/delete_consumer_offset.rs
+++ b/core/common/src/commands/consumer_offsets/delete_consumer_offset.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Identifier;
use crate::Sizeable;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, DELETE_CONSUMER_OFFSET_CODE};
use crate::{Consumer, ConsumerKind};
use bytes::{BufMut, Bytes, BytesMut};
diff --git a/core/common/src/commands/consumer_offsets/get_consumer_offset.rs b/core/common/src/commands/consumer_offsets/get_consumer_offset.rs
index 7f1fe41d..c2a3dda8 100644
--- a/core/common/src/commands/consumer_offsets/get_consumer_offset.rs
+++ b/core/common/src/commands/consumer_offsets/get_consumer_offset.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Identifier;
use crate::Sizeable;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, GET_CONSUMER_OFFSET_CODE};
use crate::{Consumer, ConsumerKind};
use bytes::{BufMut, Bytes, BytesMut};
diff --git a/core/common/src/commands/consumer_offsets/store_consumer_offset.rs b/core/common/src/commands/consumer_offsets/store_consumer_offset.rs
index 2cbd53ed..ad3c4eae 100644
--- a/core/common/src/commands/consumer_offsets/store_consumer_offset.rs
+++ b/core/common/src/commands/consumer_offsets/store_consumer_offset.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Identifier;
use crate::Sizeable;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, STORE_CONSUMER_OFFSET_CODE};
use crate::{Consumer, ConsumerKind};
use bytes::{BufMut, Bytes, BytesMut};
diff --git a/core/common/src/commands/messages/flush_unsaved_buffer.rs b/core/common/src/commands/messages/flush_unsaved_buffer.rs
index f03c7e87..beb26e5e 100644
--- a/core/common/src/commands/messages/flush_unsaved_buffer.rs
+++ b/core/common/src/commands/messages/flush_unsaved_buffer.rs
@@ -17,8 +17,9 @@
*/
use crate::{
+ BytesSerializable, Identifier, Validatable,
error::IggyError,
- BytesSerializable, Identifier, Validatable, {Command, FLUSH_UNSAVED_BUFFER_CODE},
+ {Command, FLUSH_UNSAVED_BUFFER_CODE},
};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
@@ -39,11 +40,7 @@ pub struct FlushUnsavedBuffer {
impl FlushUnsavedBuffer {
fn fsync_stringified(&self) -> &'static str {
- if self.fsync {
- "f"
- } else {
- "n"
- }
+ if self.fsync { "f" } else { "n" }
}
}
diff --git a/core/common/src/commands/messages/poll_messages.rs b/core/common/src/commands/messages/poll_messages.rs
index 5ba6ae4e..3f4045bb 100644
--- a/core/common/src/commands/messages/poll_messages.rs
+++ b/core/common/src/commands/messages/poll_messages.rs
@@ -222,11 +222,7 @@ impl Display for PollMessages {
}
fn auto_commit_to_string(auto_commit: bool) -> &'static str {
- if auto_commit {
- "a"
- } else {
- "n"
- }
+ if auto_commit { "a" } else { "n" }
}
#[cfg(test)]
diff --git a/core/common/src/commands/messages/send_messages.rs b/core/common/src/commands/messages/send_messages.rs
index 5ff1dde3..c490a4da 100644
--- a/core/common/src/commands/messages/send_messages.rs
+++ b/core/common/src/commands/messages/send_messages.rs
@@ -16,17 +16,17 @@
* under the License.
*/
-use crate::error::IggyError;
-use crate::types::message::partitioning::Partitioning;
use crate::BytesSerializable;
use crate::Identifier;
use crate::IggyMessageView;
use crate::PartitioningKind;
use crate::Sizeable;
use crate::Validatable;
+use crate::error::IggyError;
+use crate::types::message::partitioning::Partitioning;
use crate::{Command, SEND_MESSAGES_CODE};
-use crate::{IggyMessage, IggyMessagesBatch, INDEX_SIZE};
-use base64::{engine::general_purpose::STANDARD as BASE64, Engine as _};
+use crate::{INDEX_SIZE, IggyMessage, IggyMessagesBatch};
+use base64::{Engine as _, engine::general_purpose::STANDARD as BASE64};
use bytes::{BufMut, Bytes, BytesMut};
use serde::de::{self, MapAccess, Visitor};
use serde::ser::SerializeStruct;
diff --git a/core/common/src/commands/partitions/create_partitions.rs b/core/common/src/commands/partitions/create_partitions.rs
index 5d805f7c..9aa862d5 100644
--- a/core/common/src/commands/partitions/create_partitions.rs
+++ b/core/common/src/commands/partitions/create_partitions.rs
@@ -17,12 +17,12 @@
*/
use super::MAX_PARTITIONS_COUNT;
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Identifier;
use crate::Sizeable;
use crate::Validatable;
-use crate::{Command, CREATE_PARTITIONS_CODE};
+use crate::error::IggyError;
+use crate::{CREATE_PARTITIONS_CODE, Command};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
use std::fmt::Display;
diff --git a/core/common/src/commands/partitions/delete_partitions.rs b/core/common/src/commands/partitions/delete_partitions.rs
index 314a0f38..068f502c 100644
--- a/core/common/src/commands/partitions/delete_partitions.rs
+++ b/core/common/src/commands/partitions/delete_partitions.rs
@@ -17,11 +17,11 @@
*/
use super::MAX_PARTITIONS_COUNT;
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Identifier;
use crate::Sizeable;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, DELETE_PARTITIONS_CODE};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/personal_access_tokens/create_personal_access_token.rs b/core/common/src/commands/personal_access_tokens/create_personal_access_token.rs
index 15f33229..6c0fbc54 100644
--- a/core/common/src/commands/personal_access_tokens/create_personal_access_token.rs
+++ b/core/common/src/commands/personal_access_tokens/create_personal_access_token.rs
@@ -16,12 +16,12 @@
* under the License.
*/
+use crate::BytesSerializable;
+use crate::Validatable;
use crate::defaults::*;
use crate::error::IggyError;
use crate::utils::expiry::IggyExpiry;
-use crate::BytesSerializable;
-use crate::Validatable;
-use crate::{Command, CREATE_PERSONAL_ACCESS_TOKEN_CODE};
+use crate::{CREATE_PERSONAL_ACCESS_TOKEN_CODE, Command};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
use std::fmt::{Display, Formatter};
diff --git a/core/common/src/commands/personal_access_tokens/delete_personal_access_token.rs b/core/common/src/commands/personal_access_tokens/delete_personal_access_token.rs
index 6c40df1a..f54803fa 100644
--- a/core/common/src/commands/personal_access_tokens/delete_personal_access_token.rs
+++ b/core/common/src/commands/personal_access_tokens/delete_personal_access_token.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::defaults::*;
-use crate::error::IggyError;
use crate::Command;
use crate::Validatable;
+use crate::defaults::*;
+use crate::error::IggyError;
use crate::{BytesSerializable, DELETE_PERSONAL_ACCESS_TOKEN_CODE};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/personal_access_tokens/get_personal_access_tokens.rs b/core/common/src/commands/personal_access_tokens/get_personal_access_tokens.rs
index b6376dab..c07551a6 100644
--- a/core/common/src/commands/personal_access_tokens/get_personal_access_tokens.rs
+++ b/core/common/src/commands/personal_access_tokens/get_personal_access_tokens.rs
@@ -16,9 +16,9 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, GET_PERSONAL_ACCESS_TOKENS_CODE};
use bytes::Bytes;
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/personal_access_tokens/login_with_personal_access_token.rs b/core/common/src/commands/personal_access_tokens/login_with_personal_access_token.rs
index 02d99bad..cdba04e3 100644
--- a/core/common/src/commands/personal_access_tokens/login_with_personal_access_token.rs
+++ b/core/common/src/commands/personal_access_tokens/login_with_personal_access_token.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::defaults::*;
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Validatable;
+use crate::defaults::*;
+use crate::error::IggyError;
use crate::{Command, LOGIN_WITH_PERSONAL_ACCESS_TOKEN_CODE};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/segments/delete_segments.rs b/core/common/src/commands/segments/delete_segments.rs
index 3376b011..221e5c66 100644
--- a/core/common/src/commands/segments/delete_segments.rs
+++ b/core/common/src/commands/segments/delete_segments.rs
@@ -15,11 +15,11 @@
* specific language governing permissions and limitations
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Identifier;
use crate::Sizeable;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, DELETE_SEGMENTS_CODE};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/streams/create_stream.rs b/core/common/src/commands/streams/create_stream.rs
index 37f53344..71f9f8fe 100644
--- a/core/common/src/commands/streams/create_stream.rs
+++ b/core/common/src/commands/streams/create_stream.rs
@@ -17,10 +17,10 @@
*/
use super::MAX_NAME_LENGTH;
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Validatable;
-use crate::{Command, CREATE_STREAM_CODE};
+use crate::error::IggyError;
+use crate::{CREATE_STREAM_CODE, Command};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
use std::fmt::Display;
diff --git a/core/common/src/commands/streams/delete_stream.rs b/core/common/src/commands/streams/delete_stream.rs
index 2d646010..ac8aa57f 100644
--- a/core/common/src/commands/streams/delete_stream.rs
+++ b/core/common/src/commands/streams/delete_stream.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Identifier;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, DELETE_STREAM_CODE};
use bytes::Bytes;
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/streams/get_stream.rs b/core/common/src/commands/streams/get_stream.rs
index b20af18a..0e3cae73 100644
--- a/core/common/src/commands/streams/get_stream.rs
+++ b/core/common/src/commands/streams/get_stream.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Identifier;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, GET_STREAM_CODE};
use bytes::Bytes;
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/streams/get_streams.rs b/core/common/src/commands/streams/get_streams.rs
index 7431f08e..08289437 100644
--- a/core/common/src/commands/streams/get_streams.rs
+++ b/core/common/src/commands/streams/get_streams.rs
@@ -16,9 +16,9 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, GET_STREAMS_CODE};
use bytes::Bytes;
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/streams/purge_stream.rs b/core/common/src/commands/streams/purge_stream.rs
index 91a6cd0b..805e7c94 100644
--- a/core/common/src/commands/streams/purge_stream.rs
+++ b/core/common/src/commands/streams/purge_stream.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Identifier;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, PURGE_STREAM_CODE};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/streams/update_stream.rs b/core/common/src/commands/streams/update_stream.rs
index 1e9e397e..ced247e7 100644
--- a/core/common/src/commands/streams/update_stream.rs
+++ b/core/common/src/commands/streams/update_stream.rs
@@ -17,11 +17,11 @@
*/
use super::MAX_NAME_LENGTH;
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Identifier;
use crate::Sizeable;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, UPDATE_STREAM_CODE};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/system/get_client.rs b/core/common/src/commands/system/get_client.rs
index 128c7edf..6307355b 100644
--- a/core/common/src/commands/system/get_client.rs
+++ b/core/common/src/commands/system/get_client.rs
@@ -16,9 +16,9 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, GET_CLIENT_CODE};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/system/get_clients.rs b/core/common/src/commands/system/get_clients.rs
index 314ae275..4fdbad67 100644
--- a/core/common/src/commands/system/get_clients.rs
+++ b/core/common/src/commands/system/get_clients.rs
@@ -16,9 +16,9 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, GET_CLIENTS_CODE};
use bytes::Bytes;
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/system/get_me.rs b/core/common/src/commands/system/get_me.rs
index 38d26e40..5b8d772c 100644
--- a/core/common/src/commands/system/get_me.rs
+++ b/core/common/src/commands/system/get_me.rs
@@ -16,9 +16,9 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, GET_ME_CODE};
use bytes::Bytes;
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/system/get_snapshot.rs b/core/common/src/commands/system/get_snapshot.rs
index ece74d2b..77004876 100644
--- a/core/common/src/commands/system/get_snapshot.rs
+++ b/core/common/src/commands/system/get_snapshot.rs
@@ -16,9 +16,9 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, GET_SNAPSHOT_FILE_CODE};
use crate::{SnapshotCompression, SystemSnapshotType};
use bytes::{BufMut, Bytes, BytesMut};
diff --git a/core/common/src/commands/system/get_stats.rs b/core/common/src/commands/system/get_stats.rs
index 49beb6ea..8d0fea06 100644
--- a/core/common/src/commands/system/get_stats.rs
+++ b/core/common/src/commands/system/get_stats.rs
@@ -16,9 +16,9 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, GET_STATS_CODE};
use bytes::Bytes;
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/system/ping.rs b/core/common/src/commands/system/ping.rs
index 193ca647..2a7e1b13 100644
--- a/core/common/src/commands/system/ping.rs
+++ b/core/common/src/commands/system/ping.rs
@@ -16,9 +16,9 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, PING_CODE};
use bytes::Bytes;
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/topics/create_topic.rs b/core/common/src/commands/topics/create_topic.rs
index 596d218a..09fbdedd 100644
--- a/core/common/src/commands/topics/create_topic.rs
+++ b/core/common/src/commands/topics/create_topic.rs
@@ -17,15 +17,15 @@
*/
use super::{MAX_NAME_LENGTH, MAX_PARTITIONS_COUNT};
-use crate::error::IggyError;
-use crate::utils::expiry::IggyExpiry;
-use crate::utils::topic_size::MaxTopicSize;
use crate::BytesSerializable;
use crate::CompressionAlgorithm;
use crate::Identifier;
use crate::Sizeable;
use crate::Validatable;
-use crate::{Command, CREATE_TOPIC_CODE};
+use crate::error::IggyError;
+use crate::utils::expiry::IggyExpiry;
+use crate::utils::topic_size::MaxTopicSize;
+use crate::{CREATE_TOPIC_CODE, Command};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
use std::fmt::Display;
diff --git a/core/common/src/commands/topics/delete_topic.rs b/core/common/src/commands/topics/delete_topic.rs
index c6a497bd..a41c0de0 100644
--- a/core/common/src/commands/topics/delete_topic.rs
+++ b/core/common/src/commands/topics/delete_topic.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Identifier;
use crate::Sizeable;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, DELETE_TOPIC_CODE};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/topics/get_topic.rs b/core/common/src/commands/topics/get_topic.rs
index cdab7368..d18d07b4 100644
--- a/core/common/src/commands/topics/get_topic.rs
+++ b/core/common/src/commands/topics/get_topic.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Identifier;
use crate::Sizeable;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, GET_TOPIC_CODE};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/topics/get_topics.rs b/core/common/src/commands/topics/get_topics.rs
index 61fb1fb1..fa49c570 100644
--- a/core/common/src/commands/topics/get_topics.rs
+++ b/core/common/src/commands/topics/get_topics.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Identifier;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, GET_TOPICS_CODE};
use bytes::Bytes;
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/topics/purge_topic.rs b/core/common/src/commands/topics/purge_topic.rs
index fd65d8c9..061e374f 100644
--- a/core/common/src/commands/topics/purge_topic.rs
+++ b/core/common/src/commands/topics/purge_topic.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Identifier;
use crate::Sizeable;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, PURGE_TOPIC_CODE};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/topics/update_topic.rs b/core/common/src/commands/topics/update_topic.rs
index 709060e7..5d10899b 100644
--- a/core/common/src/commands/topics/update_topic.rs
+++ b/core/common/src/commands/topics/update_topic.rs
@@ -17,14 +17,14 @@
*/
use super::MAX_NAME_LENGTH;
-use crate::error::IggyError;
-use crate::utils::expiry::IggyExpiry;
-use crate::utils::topic_size::MaxTopicSize;
use crate::BytesSerializable;
use crate::CompressionAlgorithm;
use crate::Identifier;
use crate::Sizeable;
use crate::Validatable;
+use crate::error::IggyError;
+use crate::utils::expiry::IggyExpiry;
+use crate::utils::topic_size::MaxTopicSize;
use crate::{Command, UPDATE_TOPIC_CODE};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/users/change_password.rs b/core/common/src/commands/users/change_password.rs
index 7360d2c7..27f1ea6b 100644
--- a/core/common/src/commands/users/change_password.rs
+++ b/core/common/src/commands/users/change_password.rs
@@ -17,12 +17,12 @@
*/
use super::defaults::*;
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Identifier;
use crate::Sizeable;
use crate::Validatable;
-use crate::{Command, CHANGE_PASSWORD_CODE};
+use crate::error::IggyError;
+use crate::{CHANGE_PASSWORD_CODE, Command};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
use std::fmt::Display;
diff --git a/core/common/src/commands/users/create_user.rs b/core/common/src/commands/users/create_user.rs
index ba4b953a..03e0cb16 100644
--- a/core/common/src/commands/users/create_user.rs
+++ b/core/common/src/commands/users/create_user.rs
@@ -17,12 +17,12 @@
*/
use super::defaults::*;
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Permissions;
use crate::UserStatus;
use crate::Validatable;
-use crate::{Command, CREATE_USER_CODE};
+use crate::error::IggyError;
+use crate::{CREATE_USER_CODE, Command};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
use std::fmt::Display;
diff --git a/core/common/src/commands/users/delete_user.rs b/core/common/src/commands/users/delete_user.rs
index 7d0524fd..c41a967f 100644
--- a/core/common/src/commands/users/delete_user.rs
+++ b/core/common/src/commands/users/delete_user.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Identifier;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, DELETE_USER_CODE};
use bytes::Bytes;
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/users/get_user.rs b/core/common/src/commands/users/get_user.rs
index afda4f38..b0082f3b 100644
--- a/core/common/src/commands/users/get_user.rs
+++ b/core/common/src/commands/users/get_user.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Identifier;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, GET_USER_CODE};
use bytes::Bytes;
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/users/get_users.rs b/core/common/src/commands/users/get_users.rs
index 3c4b0b33..dc40bd1c 100644
--- a/core/common/src/commands/users/get_users.rs
+++ b/core/common/src/commands/users/get_users.rs
@@ -16,9 +16,9 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, GET_USERS_CODE};
use bytes::Bytes;
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/users/login_user.rs b/core/common/src/commands/users/login_user.rs
index cf4c016e..edd1e842 100644
--- a/core/common/src/commands/users/login_user.rs
+++ b/core/common/src/commands/users/login_user.rs
@@ -17,9 +17,9 @@
*/
use super::defaults::*;
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, LOGIN_USER_CODE};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/users/logout_user.rs b/core/common/src/commands/users/logout_user.rs
index 289e2818..71443da2 100644
--- a/core/common/src/commands/users/logout_user.rs
+++ b/core/common/src/commands/users/logout_user.rs
@@ -16,9 +16,9 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, LOGOUT_USER_CODE};
use bytes::Bytes;
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/users/update_permissions.rs b/core/common/src/commands/users/update_permissions.rs
index ae12bb29..ab8e525f 100644
--- a/core/common/src/commands/users/update_permissions.rs
+++ b/core/common/src/commands/users/update_permissions.rs
@@ -16,12 +16,12 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Identifier;
use crate::Permissions;
use crate::Sizeable;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, UPDATE_PERMISSIONS_CODE};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/commands/users/update_user.rs b/core/common/src/commands/users/update_user.rs
index c88a2d08..28e2504d 100644
--- a/core/common/src/commands/users/update_user.rs
+++ b/core/common/src/commands/users/update_user.rs
@@ -17,12 +17,12 @@
*/
use super::defaults::*;
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Identifier;
use crate::Sizeable;
use crate::UserStatus;
use crate::Validatable;
+use crate::error::IggyError;
use crate::{Command, UPDATE_USER_CODE};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/error/iggy_error.rs b/core/common/src/error/iggy_error.rs
index eb955022..b8076e2e 100644
--- a/core/common/src/error/iggy_error.rs
+++ b/core/common/src/error/iggy_error.rs
@@ -203,13 +203,13 @@ pub enum IggyError {
InvalidStreamId = 1014,
#[error("Cannot read streams")]
CannotReadStreams = 1015,
- #[error("Max topic size cannot be lower than segment size. Max topic size: {0} < segment size: {1}.")]
+ #[error(
+ "Max topic size cannot be lower than segment size. Max topic size: {0} < segment size: {1}."
+ )]
InvalidTopicSize(MaxTopicSize, IggyByteSize) = 1019,
#[error("Cannot create topics directory for stream with ID: {0}, Path: {1}")]
CannotCreateTopicsDirectory(u32, String) = 2000,
- #[error(
- "Failed to create directory for topic with ID: {0} for stream with ID: {1}, Path: {2}"
- )]
+ #[error("Failed to create directory for topic with ID: {0} for stream with ID: {1}, Path: {2}")]
CannotCreateTopicDirectory(u32, u32, String) = 2001,
#[error("Failed to create topic info file for topic with ID: {0} for stream with ID: {1}.")]
CannotCreateTopicInfo(u32, u32) = 2002,
@@ -251,7 +251,9 @@ pub enum IggyError {
"Failed to create directory for partitions for stream with ID: {0} and topic with ID: {1}"
)]
CannotCreatePartitionsDirectory(u32, u32) = 3001,
- #[error("Failed to create directory for partition with ID: {0} for stream with ID: {1} and topic with ID: {2}")]
+ #[error(
+ "Failed to create directory for partition with ID: {0} for stream with ID: {1} and topic with ID: {2}"
+ )]
CannotCreatePartitionDirectory(u32, u32, u32) = 3002,
#[error("Cannot open partition log file")]
CannotOpenPartitionLogFile = 3003,
@@ -261,11 +263,11 @@ pub enum IggyError {
"Failed to delete partition with ID: {0} for stream with ID: {1} and topic with ID: {2}"
)]
CannotDeletePartition(u32, u32, u32) = 3005,
- #[error("Failed to delete partition directory with ID: {0} for stream with ID: {1} and topic with ID: {2}")]
- CannotDeletePartitionDirectory(u32, u32, u32) = 3006,
#[error(
- "Partition with ID: {0} for topic with ID: {1} for stream with ID: {2} was not found."
+ "Failed to delete partition directory with ID: {0} for stream with ID: {1} and topic with ID: {2}"
)]
+ CannotDeletePartitionDirectory(u32, u32, u32) = 3006,
+ #[error("Partition with ID: {0} for topic with ID: {1} for stream with ID: {2} was not found.")]
PartitionNotFound(u32, u32, u32) = 3007,
#[error("Topic with ID: {0} for stream with ID: {1} has no partitions.")]
NoPartitions(u32, u32) = 3008,
@@ -373,11 +375,17 @@ pub enum IggyError {
ConsumerGroupNameAlreadyExists(String, u32) = 5004,
#[error("Invalid consumer group name")]
InvalidConsumerGroupName = 5005,
- #[error("Consumer group member with ID: {0} for group with ID: {1} for topic with ID: {2} was not found.")]
+ #[error(
+ "Consumer group member with ID: {0} for group with ID: {1} for topic with ID: {2} was not found."
+ )]
ConsumerGroupMemberNotFound(u32, u32, u32) = 5006,
- #[error("Failed to create consumer group info file for ID: {0} for topic with ID: {1} for stream with ID: {2}.")]
+ #[error(
+ "Failed to create consumer group info file for ID: {0} for topic with ID: {1} for stream with ID: {2}."
+ )]
CannotCreateConsumerGroupInfo(u32, u32, u32) = 5007,
- #[error("Failed to delete consumer group info file for ID: {0} for topic with ID: {1} for stream with ID: {2}.")]
+ #[error(
+ "Failed to delete consumer group info file for ID: {0} for topic with ID: {1} for stream with ID: {2}."
+ )]
CannotDeleteConsumerGroupInfo(u32, u32, u32) = 5008,
#[error("Base offset is missing")]
MissingBaseOffsetRetainedMessageBatch = 6000,
diff --git a/core/common/src/traits/partitioner.rs b/core/common/src/traits/partitioner.rs
index 0aaf4e07..c9ebf878 100644
--- a/core/common/src/traits/partitioner.rs
+++ b/core/common/src/traits/partitioner.rs
@@ -16,9 +16,9 @@
* under the License.
*/
+use crate::Identifier;
use crate::error::IggyError;
use crate::types::message::IggyMessage;
-use crate::Identifier;
use std::fmt::Debug;
/// The trait represent the logic responsible for calculating the partition ID and is used by the `IggyClient`.
diff --git a/core/common/src/types/command/mod.rs b/core/common/src/types/command/mod.rs
index e05104a2..cc02362e 100644
--- a/core/common/src/types/command/mod.rs
+++ b/core/common/src/types/command/mod.rs
@@ -16,9 +16,9 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Validatable;
+use crate::error::IggyError;
use std::fmt::Display;
pub trait Command: BytesSerializable + Validatable<IggyError> + Send + Sync + Display {
diff --git a/core/common/src/types/compression/compression_algorithm.rs b/core/common/src/types/compression/compression_algorithm.rs
index f2755750..d232747e 100644
--- a/core/common/src/types/compression/compression_algorithm.rs
+++ b/core/common/src/types/compression/compression_algorithm.rs
@@ -17,8 +17,8 @@
*/
use serde::{
- de::{self, Deserializer, Visitor},
Deserialize, Serialize, Serializer,
+ de::{self, Deserializer, Visitor},
};
use std::{
fmt::{Display, Formatter},
diff --git a/core/common/src/types/consumer/consumer_kind.rs b/core/common/src/types/consumer/consumer_kind.rs
index 744ddfaf..17a0eb6d 100644
--- a/core/common/src/types/consumer/consumer_kind.rs
+++ b/core/common/src/types/consumer/consumer_kind.rs
@@ -16,13 +16,13 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Identifier;
use crate::Validatable;
+use crate::error::IggyError;
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
-use serde_with::{serde_as, DisplayFromStr};
+use serde_with::{DisplayFromStr, serde_as};
use std::fmt::Display;
/// `Consumer` represents the type of consumer that is consuming a message.
diff --git a/core/common/src/types/consumer/mod.rs b/core/common/src/types/consumer/mod.rs
index 9ba7cc73..0ed089fa 100644
--- a/core/common/src/types/consumer/mod.rs
+++ b/core/common/src/types/consumer/mod.rs
@@ -16,13 +16,13 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
use crate::Identifier;
use crate::Validatable;
+use crate::error::IggyError;
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
-use serde_with::{serde_as, DisplayFromStr};
+use serde_with::{DisplayFromStr, serde_as};
use std::fmt::Display;
pub(crate) mod consumer_group;
diff --git a/core/common/src/types/identifier/mod.rs b/core/common/src/types/identifier/mod.rs
index eb47ff0f..a6bfcfa8 100644
--- a/core/common/src/types/identifier/mod.rs
+++ b/core/common/src/types/identifier/mod.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::error::IggyError;
-use crate::utils::byte_size::IggyByteSize;
use crate::BytesSerializable;
use crate::Sizeable;
use crate::Validatable;
+use crate::error::IggyError;
+use crate::utils::byte_size::IggyByteSize;
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
use serde_with::base64::Base64;
diff --git a/core/common/src/types/message/iggy_message.rs b/core/common/src/types/message/iggy_message.rs
index 7349065e..54c3a841 100644
--- a/core/common/src/types/message/iggy_message.rs
+++ b/core/common/src/types/message/iggy_message.rs
@@ -16,13 +16,13 @@
* under the License.
*/
-use super::message_header::{IggyMessageHeader, IGGY_MESSAGE_HEADER_SIZE};
+use super::message_header::{IGGY_MESSAGE_HEADER_SIZE, IggyMessageHeader};
use super::user_headers::get_user_headers_size;
+use crate::BytesSerializable;
+use crate::Sizeable;
use crate::error::IggyError;
use crate::utils::byte_size::IggyByteSize;
use crate::utils::timestamp::IggyTimestamp;
-use crate::BytesSerializable;
-use crate::Sizeable;
use crate::{HeaderKey, HeaderValue};
use bon::bon;
use bytes::{BufMut, Bytes, BytesMut};
@@ -541,7 +541,7 @@ impl Serialize for IggyMessage {
where
S: Serializer,
{
- use base64::{engine::general_purpose::STANDARD, Engine as _};
+ use base64::{Engine as _, engine::general_purpose::STANDARD};
use serde::ser::SerializeStruct;
let field_count = 2 + self.user_headers.is_some() as usize;
@@ -594,7 +594,7 @@ impl<'de> Deserialize<'de> for IggyMessage {
}
"payload" => {
let payload_str: String = map.next_value()?;
- use base64::{engine::general_purpose::STANDARD, Engine as _};
+ use base64::{Engine as _, engine::general_purpose::STANDARD};
let decoded = STANDARD.decode(payload_str.as_bytes()).map_err(|e| {
de::Error::custom(format!("Failed to decode base64: {}", e))
})?;
diff --git a/core/common/src/types/message/indexes.rs b/core/common/src/types/message/indexes.rs
index fb924158..d7955a22 100644
--- a/core/common/src/types/message/indexes.rs
+++ b/core/common/src/types/message/indexes.rs
@@ -16,7 +16,7 @@
* under the License.
*/
-use crate::{IggyIndexView, INDEX_SIZE};
+use crate::{INDEX_SIZE, IggyIndexView};
use bytes::Bytes;
use serde::{Deserialize, Serialize};
use serde_with::base64::Base64;
diff --git a/core/common/src/types/message/message_header.rs b/core/common/src/types/message/message_header.rs
index 64a81d49..120f779e 100644
--- a/core/common/src/types/message/message_header.rs
+++ b/core/common/src/types/message/message_header.rs
@@ -16,7 +16,7 @@
* under the License.
*/
-use crate::{error::IggyError, utils::byte_size::IggyByteSize, BytesSerializable, Sizeable};
+use crate::{BytesSerializable, Sizeable, error::IggyError, utils::byte_size::IggyByteSize};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
use std::ops::Range;
diff --git a/core/common/src/types/message/message_header_view.rs b/core/common/src/types/message/message_header_view.rs
index 4503fa0e..d1107d8a 100644
--- a/core/common/src/types/message/message_header_view.rs
+++ b/core/common/src/types/message/message_header_view.rs
@@ -19,11 +19,11 @@
use bytes::{Bytes, BytesMut};
use crate::{
- error::IggyError, BytesSerializable, IggyMessageHeader, IGGY_MESSAGE_CHECKSUM_OFFSET_RANGE,
- IGGY_MESSAGE_HEADERS_LENGTH_OFFSET_RANGE, IGGY_MESSAGE_HEADER_SIZE,
- IGGY_MESSAGE_ID_OFFSET_RANGE, IGGY_MESSAGE_OFFSET_OFFSET_RANGE,
- IGGY_MESSAGE_ORIGIN_TIMESTAMP_OFFSET_RANGE, IGGY_MESSAGE_PAYLOAD_LENGTH_OFFSET_RANGE,
- IGGY_MESSAGE_TIMESTAMP_OFFSET_RANGE,
+ BytesSerializable, IGGY_MESSAGE_CHECKSUM_OFFSET_RANGE, IGGY_MESSAGE_HEADER_SIZE,
+ IGGY_MESSAGE_HEADERS_LENGTH_OFFSET_RANGE, IGGY_MESSAGE_ID_OFFSET_RANGE,
+ IGGY_MESSAGE_OFFSET_OFFSET_RANGE, IGGY_MESSAGE_ORIGIN_TIMESTAMP_OFFSET_RANGE,
+ IGGY_MESSAGE_PAYLOAD_LENGTH_OFFSET_RANGE, IGGY_MESSAGE_TIMESTAMP_OFFSET_RANGE,
+ IggyMessageHeader, error::IggyError,
};
/// A read-only, typed view into a message header in a raw buffer.
diff --git a/core/common/src/types/message/message_view.rs b/core/common/src/types/message/message_view.rs
index a8584d85..ecff2386 100644
--- a/core/common/src/types/message/message_view.rs
+++ b/core/common/src/types/message/message_view.rs
@@ -16,13 +16,13 @@
* under the License.
*/
-use super::message_header::*;
use super::HeaderValue;
-use crate::error::IggyError;
-use crate::utils::checksum;
+use super::message_header::*;
use crate::BytesSerializable;
use crate::IggyByteSize;
use crate::Sizeable;
+use crate::error::IggyError;
+use crate::utils::checksum;
use crate::{HeaderKey, IggyMessageHeaderView};
use bytes::{Bytes, BytesMut};
use std::{collections::HashMap, iter::Iterator};
diff --git a/core/common/src/types/message/messages_batch.rs b/core/common/src/types/message/messages_batch.rs
index 9cf46ac4..47d49d8c 100644
--- a/core/common/src/types/message/messages_batch.rs
+++ b/core/common/src/types/message/messages_batch.rs
@@ -17,8 +17,8 @@
*/
use crate::{
- error::IggyError, BytesSerializable, IggyByteSize, IggyIndexes, IggyMessage, IggyMessageView,
- IggyMessageViewIterator, Sizeable, Validatable, INDEX_SIZE, MAX_PAYLOAD_SIZE,
+ BytesSerializable, INDEX_SIZE, IggyByteSize, IggyIndexes, IggyMessage, IggyMessageView,
+ IggyMessageViewIterator, MAX_PAYLOAD_SIZE, Sizeable, Validatable, error::IggyError,
};
use bytes::{BufMut, Bytes, BytesMut};
use std::ops::{Deref, Index};
diff --git a/core/common/src/types/message/mod.rs b/core/common/src/types/message/mod.rs
index 1848a146..5ab0dbf3 100644
--- a/core/common/src/types/message/mod.rs
+++ b/core/common/src/types/message/mod.rs
@@ -41,11 +41,11 @@ pub use index::IggyIndex;
pub use index_view::IggyIndexView;
pub use indexes::IggyIndexes;
pub use message_header::{
- IggyMessageHeader, IGGY_MESSAGE_CHECKSUM_OFFSET_RANGE,
- IGGY_MESSAGE_HEADERS_LENGTH_OFFSET_RANGE, IGGY_MESSAGE_HEADER_RANGE, IGGY_MESSAGE_HEADER_SIZE,
- IGGY_MESSAGE_ID_OFFSET_RANGE, IGGY_MESSAGE_OFFSET_OFFSET_RANGE,
- IGGY_MESSAGE_ORIGIN_TIMESTAMP_OFFSET_RANGE, IGGY_MESSAGE_PAYLOAD_LENGTH_OFFSET_RANGE,
- IGGY_MESSAGE_TIMESTAMP_OFFSET_RANGE,
+ IGGY_MESSAGE_CHECKSUM_OFFSET_RANGE, IGGY_MESSAGE_HEADER_RANGE, IGGY_MESSAGE_HEADER_SIZE,
+ IGGY_MESSAGE_HEADERS_LENGTH_OFFSET_RANGE, IGGY_MESSAGE_ID_OFFSET_RANGE,
+ IGGY_MESSAGE_OFFSET_OFFSET_RANGE, IGGY_MESSAGE_ORIGIN_TIMESTAMP_OFFSET_RANGE,
+ IGGY_MESSAGE_PAYLOAD_LENGTH_OFFSET_RANGE, IGGY_MESSAGE_TIMESTAMP_OFFSET_RANGE,
+ IggyMessageHeader,
};
pub use message_header_view::IggyMessageHeaderView;
pub use message_view::{IggyMessageView, IggyMessageViewIterator};
diff --git a/core/common/src/types/message/partitioning.rs b/core/common/src/types/message/partitioning.rs
index 027f1fcd..78efab2c 100644
--- a/core/common/src/types/message/partitioning.rs
+++ b/core/common/src/types/message/partitioning.rs
@@ -17,7 +17,7 @@
*/
use super::PartitioningKind;
-use crate::{error::IggyError, BytesSerializable, IggyByteSize, Sizeable};
+use crate::{BytesSerializable, IggyByteSize, Sizeable, error::IggyError};
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
use serde_with::base64::Base64;
diff --git a/core/common/src/types/message/polled_messages.rs b/core/common/src/types/message/polled_messages.rs
index 756b709d..9e091437 100644
--- a/core/common/src/types/message/polled_messages.rs
+++ b/core/common/src/types/message/polled_messages.rs
@@ -17,7 +17,7 @@
*/
use crate::{
- error::IggyError, BytesSerializable, IggyMessage, IggyMessageHeader, IGGY_MESSAGE_HEADER_SIZE,
+ BytesSerializable, IGGY_MESSAGE_HEADER_SIZE, IggyMessage, IggyMessageHeader, error::IggyError,
};
use bytes::Bytes;
use serde::{Deserialize, Serialize};
diff --git a/core/common/src/types/message/polling_strategy.rs b/core/common/src/types/message/polling_strategy.rs
index bdaf2146..35052a18 100644
--- a/core/common/src/types/message/polling_strategy.rs
+++ b/core/common/src/types/message/polling_strategy.rs
@@ -16,13 +16,13 @@
* under the License.
*/
+use crate::BytesSerializable;
use crate::error::IggyError;
use crate::types::message::polling_kind::PollingKind;
use crate::utils::timestamp::IggyTimestamp;
-use crate::BytesSerializable;
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
-use serde_with::{serde_as, DisplayFromStr};
+use serde_with::{DisplayFromStr, serde_as};
use std::fmt::Display;
/// Default value for the polling strategy.
diff --git a/core/common/src/types/message/user_headers.rs b/core/common/src/types/message/user_headers.rs
index 001cb3aa..4efdc6b9 100644
--- a/core/common/src/types/message/user_headers.rs
+++ b/core/common/src/types/message/user_headers.rs
@@ -16,8 +16,8 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
+use crate::error::IggyError;
use bytes::{BufMut, Bytes, BytesMut};
use serde::{Deserialize, Serialize};
use serde_with::base64::Base64;
diff --git a/core/common/src/types/permissions/permissions_global.rs b/core/common/src/types/permissions/permissions_global.rs
index 6e839cc9..db47900e 100644
--- a/core/common/src/types/permissions/permissions_global.rs
+++ b/core/common/src/types/permissions/permissions_global.rs
@@ -16,12 +16,12 @@
* under the License.
*/
-use crate::error::IggyError;
use crate::BytesSerializable;
+use crate::error::IggyError;
use ahash::AHashMap;
use bytes::{Buf, BufMut, Bytes, BytesMut};
-use comfy_table::presets::ASCII_NO_BORDERS;
use comfy_table::Table;
+use comfy_table::presets::ASCII_NO_BORDERS;
use serde::{Deserialize, Serialize};
use std::fmt::Display;
diff --git a/core/common/src/types/topic/mod.rs b/core/common/src/types/topic/mod.rs
index 57cd8915..922f0029 100644
--- a/core/common/src/types/topic/mod.rs
+++ b/core/common/src/types/topic/mod.rs
@@ -16,12 +16,12 @@
* under the License.
*/
+use crate::CompressionAlgorithm;
+use crate::Partition;
use crate::utils::byte_size::IggyByteSize;
use crate::utils::expiry::IggyExpiry;
use crate::utils::timestamp::IggyTimestamp;
use crate::utils::topic_size::MaxTopicSize;
-use crate::CompressionAlgorithm;
-use crate::Partition;
use serde::{Deserialize, Serialize};
/// `Topic` represents the medium level of logical separation of data as it's a part of the stream.
diff --git a/core/common/src/types/user/user_info.rs b/core/common/src/types/user/user_info.rs
index c6f0ef21..9b2929c8 100644
--- a/core/common/src/types/user/user_info.rs
+++ b/core/common/src/types/user/user_info.rs
@@ -16,9 +16,9 @@
* under the License.
*/
+use crate::Permissions;
use crate::types::user::user_status::UserStatus;
use crate::utils::timestamp::IggyTimestamp;
-use crate::Permissions;
use serde::{Deserialize, Serialize};
use std::sync::atomic::AtomicU32;
diff --git a/core/common/src/utils/crypto.rs b/core/common/src/utils/crypto.rs
index 4c88e227..34cd72c7 100644
--- a/core/common/src/utils/crypto.rs
+++ b/core/common/src/utils/crypto.rs
@@ -16,8 +16,8 @@
* under the License.
*/
-use crate::text;
use crate::IggyError;
+use crate::text;
use aes_gcm::aead::generic_array::GenericArray;
use aes_gcm::aead::{Aead, OsRng};
use aes_gcm::{AeadCore, Aes256Gcm, KeyInit};
diff --git a/core/common/src/utils/duration.rs b/core/common/src/utils/duration.rs
index e72163fb..7af252c8 100644
--- a/core/common/src/utils/duration.rs
+++ b/core/common/src/utils/duration.rs
@@ -16,8 +16,8 @@
* under the License.
*/
-use humantime::format_duration;
use humantime::Duration as HumanDuration;
+use humantime::format_duration;
use serde::de::Visitor;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use std::{
diff --git a/core/common/src/utils/expiry.rs b/core/common/src/utils/expiry.rs
index e36df678..a32ddc4d 100644
--- a/core/common/src/utils/expiry.rs
+++ b/core/common/src/utils/expiry.rs
@@ -17,10 +17,10 @@
*/
use crate::utils::duration::IggyDuration;
-use humantime::format_duration;
use humantime::Duration as HumanDuration;
+use humantime::format_duration;
use serde::de::Visitor;
-use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
+use serde::{Deserialize, Deserializer, Serialize, Serializer, de};
use std::fmt;
use std::fmt::Display;
use std::iter::Sum;
diff --git a/core/common/src/utils/text.rs b/core/common/src/utils/text.rs
index cdcc3216..bad633fa 100644
--- a/core/common/src/utils/text.rs
+++ b/core/common/src/utils/text.rs
@@ -17,8 +17,8 @@
*/
use crate::IggyError;
-use base64::engine::general_purpose;
use base64::Engine;
+use base64::engine::general_purpose;
pub fn from_base64_as_bytes(value: &str) -> Result<Vec<u8>, IggyError> {
let result = general_purpose::STANDARD.decode(value);
diff --git a/core/common/src/utils/timestamp.rs b/core/common/src/utils/timestamp.rs
index 7fc8c51f..b67cca5d 100644
--- a/core/common/src/utils/timestamp.rs
+++ b/core/common/src/utils/timestamp.rs
@@ -19,8 +19,8 @@
use chrono::{DateTime, Local, Utc};
use core::fmt;
use serde::{
- de::{self, Visitor},
Deserialize, Deserializer, Serialize, Serializer,
+ de::{self, Visitor},
};
use std::{
ops::{Add, Sub},
diff --git a/core/common/src/utils/topic_size.rs b/core/common/src/utils/topic_size.rs
index cc82355a..7d6775c8 100644
--- a/core/common/src/utils/topic_size.rs
+++ b/core/common/src/utils/topic_size.rs
@@ -18,8 +18,8 @@
use core::fmt;
use serde::{
- de::{self, Visitor},
Deserialize, Deserializer, Serialize, Serializer,
+ de::{self, Visitor},
};
use std::str::FromStr;
diff --git a/core/examples/Cargo.toml b/core/examples/Cargo.toml
index 4077a844..1c32e2ad 100644
--- a/core/examples/Cargo.toml
+++ b/core/examples/Cargo.toml
@@ -18,7 +18,7 @@
[package]
name = "iggy_examples"
version = "0.0.5"
-edition = "2021"
+edition = "2024"
license = "Apache-2.0"
[dependencies]
diff --git a/core/examples/src/multi-tenant/consumer/main.rs b/core/examples/src/multi-tenant/consumer/main.rs
index ded20180..81b0c3eb 100644
--- a/core/examples/src/multi-tenant/consumer/main.rs
+++ b/core/examples/src/multi-tenant/consumer/main.rs
@@ -18,8 +18,8 @@
use ahash::AHashMap;
use clap::Parser;
-use futures_util::future::join_all;
use futures_util::StreamExt;
+use futures_util::future::join_all;
use iggy::prelude::*;
use iggy_examples::shared::args::Args;
use std::collections::HashMap;
@@ -100,7 +100,9 @@ async fn main() -> anyhow::Result<(), Box<dyn Error>> {
.parse::<bool>()
.expect("Invalid ensure stream access");
- print_info(&format!("Multi-tenant consumers has started, tenants: {tenants_count}, consumers: {consumers_count}"));
+ print_info(&format!(
+ "Multi-tenant consumers has started, tenants: {tenants_count}, consumers: {consumers_count}"
+ ));
let address = args.tcp_server_address;
print_info("Creating root client to manage streams and users");
@@ -246,14 +248,20 @@ fn start_consumers(tenant_id: u32, consumers: Vec<TenantConsumer>) -> Vec<JoinHa
let payload = std::str::from_utf8(&message.message.payload);
if payload.is_err() {
let error = payload.unwrap_err();
- error!("Error while decoding the message payload at offset: {offset}, partition ID: {partition_id}, perhaps it's encrypted? {error}");
+ error!(
+ "Error while decoding the message payload at offset: {offset}, partition ID: {partition_id}, perhaps it's encrypted? {error}"
+ );
continue;
}
let payload = payload.unwrap();
- info!("Tenant: {tenant_id} consumer: {consumer_id} received: {payload} from partition: {partition_id}, topic: {topic}, stream: {stream}, at offset: {offset}, current offset: {current_offset}");
+ info!(
+ "Tenant: {tenant_id} consumer: {consumer_id} received: {payload} from partition: {partition_id}, topic: {topic}, stream: {stream}, at offset: {offset}, current offset: {current_offset}"
+ );
} else if let Err(error) = message {
- error!("Error while handling message: {error} by tenant: {tenant_id} consumer: {consumer_id}, topic: {topic}, stream: {stream}");
+ error!(
+ "Error while handling message: {error} by tenant: {tenant_id} consumer: {consumer_id}, topic: {topic}, stream: {stream}"
+ );
continue;
}
}
diff --git a/core/examples/src/multi-tenant/producer/main.rs b/core/examples/src/multi-tenant/producer/main.rs
index faed4eea..b9683c64 100644
--- a/core/examples/src/multi-tenant/producer/main.rs
+++ b/core/examples/src/multi-tenant/producer/main.rs
@@ -103,7 +103,9 @@ async fn main() -> anyhow::Result<(), Box<dyn Error>> {
.parse::<bool>()
.expect("Invalid ensure stream access");
- print_info(&format!("Multi-tenant producer has started, tenants: {tenants_count}, producers: {producers_count}, partitions: {partitions_count}"));
+ print_info(&format!(
+ "Multi-tenant producer has started, tenants: {tenants_count}, producers: {producers_count}, partitions: {partitions_count}"
+ ));
let address = args.tcp_server_address;
print_info("Creating root client to manage streams and users");
@@ -228,7 +230,8 @@ fn start_producers(
if let Err(error) = producer.producer.send(messages).await {
error!(
- "Failed to send: {batch_size} message(s) to: {} -> {} by tenant: {tenant_id}, producer: {producer_id} with error: {error}", producer.stream, producer.topic,
+ "Failed to send: {batch_size} message(s) to: {} -> {} by tenant: {tenant_id}, producer: {producer_id} with error: {error}",
+ producer.stream, producer.topic,
);
continue;
}
diff --git a/core/examples/src/new-sdk/consumer/main.rs b/core/examples/src/new-sdk/consumer/main.rs
index 4556d930..cd20b9c7 100644
--- a/core/examples/src/new-sdk/consumer/main.rs
+++ b/core/examples/src/new-sdk/consumer/main.rs
@@ -21,8 +21,8 @@ use futures_util::StreamExt;
use iggy::prelude::*;
use iggy_examples::shared::args::Args;
use iggy_examples::shared::messages::{
- Envelope, OrderConfirmed, OrderCreated, OrderRejected, ORDER_CONFIRMED_TYPE,
- ORDER_CREATED_TYPE, ORDER_REJECTED_TYPE,
+ Envelope, ORDER_CONFIRMED_TYPE, ORDER_CREATED_TYPE, ORDER_REJECTED_TYPE, OrderConfirmed,
+ OrderCreated, OrderRejected,
};
use std::error::Error;
use std::str::FromStr;
@@ -78,8 +78,14 @@ pub async fn consume_messages(
let interval = args.get_interval();
let mut consumed_batches = 0;
- info!("Messages will be polled by consumer: {} from stream: {}, topic: {}, partition: {} with interval {}.",
- args.consumer_id, args.stream_id, args.topic_id, args.partition_id, interval.map_or("none".to_string(), |i| i.as_human_time_string()));
+ info!(
+ "Messages will be polled by consumer: {} from stream: {}, topic: {}, partition: {} with interval {}.",
+ args.consumer_id,
+ args.stream_id,
+ args.topic_id,
+ args.partition_id,
+ interval.map_or("none".to_string(), |i| i.as_human_time_string())
+ );
while let Some(message) = consumer.next().await {
if args.message_batches_limit > 0 && consumed_batches == args.message_batches_limit {
diff --git a/core/examples/src/shared/messages_generator.rs b/core/examples/src/shared/messages_generator.rs
index 826a156f..46cb25b8 100644
--- a/core/examples/src/shared/messages_generator.rs
+++ b/core/examples/src/shared/messages_generator.rs
@@ -18,8 +18,8 @@
use crate::shared::messages::{OrderConfirmed, OrderCreated, OrderRejected, SerializableMessage};
use iggy::prelude::IggyTimestamp;
-use rand::rngs::ThreadRng;
use rand::Rng;
+use rand::rngs::ThreadRng;
const CURRENCY_PAIRS: &[&str] = &["EUR/USD", "EUR/GBP", "USD/GBP", "EUR/PLN", "USD/PLN"];
diff --git a/core/examples/src/shared/system.rs b/core/examples/src/shared/system.rs
index 2ab34485..30aa382b 100644
--- a/core/examples/src/shared/system.rs
+++ b/core/examples/src/shared/system.rs
@@ -104,8 +104,14 @@ pub async fn consume_messages(
handle_message: &MessageHandler,
) -> Result<(), Box<dyn std::error::Error>> {
let interval = args.get_interval();
- info!("Messages will be polled by consumer: {} from stream: {}, topic: {}, partition: {} with interval {}.",
- args.consumer_id, args.stream_id, args.topic_id, args.partition_id, interval.map_or("none".to_string(), |i| i.as_human_time_string()));
+ info!(
+ "Messages will be polled by consumer: {} from stream: {}, topic: {}, partition: {} with interval {}.",
+ args.consumer_id,
+ args.stream_id,
+ args.topic_id,
+ args.partition_id,
+ interval.map_or("none".to_string(), |i| i.as_human_time_string())
+ );
let stream_id = args.stream_id.clone().try_into()?;
let topic_id = args.topic_id.clone().try_into()?;
diff --git a/core/integration/Cargo.toml b/core/integration/Cargo.toml
index eb2a1f48..46cc8847 100644
--- a/core/integration/Cargo.toml
+++ b/core/integration/Cargo.toml
@@ -18,7 +18,7 @@
[package]
name = "integration"
version = "0.0.1"
-edition = "2021"
+edition = "2024"
license = "Apache-2.0"
# Some tests are failing in CI due to lack of IPv6 interfaces
diff --git a/core/integration/src/test_server.rs b/core/integration/src/test_server.rs
index 8f5e75a1..30301310 100644
--- a/core/integration/src/test_server.rs
+++ b/core/integration/src/test_server.rs
@@ -34,7 +34,7 @@ use uuid::Uuid;
use iggy::prelude::UserStatus::Active;
use iggy::prelude::{
- Client, StreamClient, UserClient, DEFAULT_ROOT_PASSWORD, DEFAULT_ROOT_USERNAME,
+ Client, DEFAULT_ROOT_PASSWORD, DEFAULT_ROOT_USERNAME, StreamClient, UserClient,
};
use iggy::prelude::{GlobalPermissions, Identifier, IdentityInfo, IggyClient, Permissions};
use server::configs::config_provider::{ConfigProvider, FileConfigProvider};
@@ -216,8 +216,8 @@ impl TestServer {
if let Some(mut child_handle) = self.child_handle.take() {
#[cfg(unix)]
unsafe {
- use libc::kill;
use libc::SIGTERM;
+ use libc::kill;
kill(child_handle.id() as libc::pid_t, SIGTERM);
}
diff --git a/core/integration/tests/archiver/s3.rs b/core/integration/tests/archiver/s3.rs
index fabf3724..df2970f1 100644
--- a/core/integration/tests/archiver/s3.rs
+++ b/core/integration/tests/archiver/s3.rs
@@ -16,8 +16,8 @@
* under the License.
*/
-use server::archiver::s3::S3Archiver;
use server::archiver::Archiver;
+use server::archiver::s3::S3Archiver;
use server::configs::server::S3ArchiverConfig;
#[tokio::test]
diff --git a/core/integration/tests/bench/mod.rs b/core/integration/tests/bench/mod.rs
index 57481a18..97b0dcb1 100644
--- a/core/integration/tests/bench/mod.rs
+++ b/core/integration/tests/bench/mod.rs
@@ -22,7 +22,7 @@ mod tcp;
use assert_cmd::prelude::CommandCargoExt;
use iggy::prelude::IggyByteSize;
-use integration::test_server::{Transport, TEST_VERBOSITY_ENV_VAR};
+use integration::test_server::{TEST_VERBOSITY_ENV_VAR, Transport};
use std::{
fs::{self, File, OpenOptions},
io::Write,
diff --git a/core/integration/tests/cli/client/test_client_help_command.rs b/core/integration/tests/cli/client/test_client_help_command.rs
index 74d12274..262e800c 100644
--- a/core/integration/tests/cli/client/test_client_help_command.rs
+++ b/core/integration/tests/cli/client/test_client_help_command.rs
@@ -16,7 +16,7 @@
* under the License.
*/
-use crate::cli::common::{help::TestHelpCmd, IggyCmdTest, USAGE_PREFIX};
+use crate::cli::common::{IggyCmdTest, USAGE_PREFIX, help::TestHelpCmd};
use serial_test::parallel;
#[tokio::test]
diff --git a/core/integration/tests/cli/client/test_client_list_command.rs b/core/integration/tests/cli/client/test_client_list_command.rs
index f1c19f5d..2d407ff7 100644
--- a/core/integration/tests/cli/client/test_client_list_command.rs
+++ b/core/integration/tests/cli/client/test_client_list_command.rs
@@ -17,7 +17,7 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, OutputFormat, TestHelpCmd, CLAP_INDENT,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, OutputFormat, TestHelpCmd,
USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
diff --git a/core/integration/tests/cli/common/mod.rs b/core/integration/tests/cli/common/mod.rs
index 7b2d9b40..427df571 100644
--- a/core/integration/tests/cli/common/mod.rs
+++ b/core/integration/tests/cli/common/mod.rs
@@ -19,14 +19,14 @@
pub(crate) mod command;
pub(crate) mod help;
pub(crate) use crate::cli::common::command::IggyCmdCommand;
-pub(crate) use crate::cli::common::help::{TestHelpCmd, CLAP_INDENT, USAGE_PREFIX};
+pub(crate) use crate::cli::common::help::{CLAP_INDENT, TestHelpCmd, USAGE_PREFIX};
use assert_cmd::assert::{Assert, OutputAssertExt};
use assert_cmd::prelude::CommandCargoExt;
use async_trait::async_trait;
use iggy::clients::client::IggyClient;
-use iggy::prelude::defaults::*;
use iggy::prelude::TcpClient;
use iggy::prelude::TcpClientConfig;
+use iggy::prelude::defaults::*;
use iggy::prelude::{Client, SystemClient, UserClient};
use integration::test_server::TestServer;
use std::fmt::{Display, Formatter, Result};
diff --git a/core/integration/tests/cli/consumer_group/test_consumer_group_create_command.rs b/core/integration/tests/cli/consumer_group/test_consumer_group_create_command.rs
index 79db582b..35fc66d6 100644
--- a/core/integration/tests/cli/consumer_group/test_consumer_group_create_command.rs
+++ b/core/integration/tests/cli/consumer_group/test_consumer_group_create_command.rs
@@ -17,8 +17,8 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId, TestTopicId,
- CLAP_INDENT, USAGE_PREFIX,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId,
+ TestTopicId, USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
use async_trait::async_trait;
@@ -130,8 +130,17 @@ impl IggyCmdTestCase for TestConsumerGroupCreateCmd {
None => "ID auto incremented".to_string(),
};
- let message = format!("Executing create consumer group: {}, name: {} for topic with ID: {} and stream with ID: {}\nConsumer group: {}, name: {} created for topic with ID: {} and stream with ID: {}\n",
- group_id, self.group_name, topic_id, stream_id, group_id, self.group_name, topic_id, stream_id);
+ let message = format!(
+ "Executing create consumer group: {}, name: {} for topic with ID: {} and stream with ID: {}\nConsumer group: {}, name: {} created for topic with ID: {} and stream with ID: {}\n",
+ group_id,
+ self.group_name,
+ topic_id,
+ stream_id,
+ group_id,
+ self.group_name,
+ topic_id,
+ stream_id
+ );
command_state.success().stdout(diff(message));
}
diff --git a/core/integration/tests/cli/consumer_group/test_consumer_group_delete_command.rs b/core/integration/tests/cli/consumer_group/test_consumer_group_delete_command.rs
index 080ec0dd..958d3146 100644
--- a/core/integration/tests/cli/consumer_group/test_consumer_group_delete_command.rs
+++ b/core/integration/tests/cli/consumer_group/test_consumer_group_delete_command.rs
@@ -17,8 +17,8 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestConsumerGroupId, TestHelpCmd, TestStreamId,
- TestTopicId, CLAP_INDENT, USAGE_PREFIX,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestConsumerGroupId, TestHelpCmd,
+ TestStreamId, TestTopicId, USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
use async_trait::async_trait;
@@ -143,8 +143,10 @@ impl IggyCmdTestCase for TestConsumerGroupDeleteCmd {
TestConsumerGroupId::Named => self.group_name.clone(),
};
- let message = format!("Executing delete consumer group with ID: {} for topic with ID: {} and stream with ID: {}\nConsumer group with ID: {} deleted for topic with ID: {} and stream with ID: {}\n",
- group_id, topic_id, stream_id, group_id, topic_id, stream_id);
+ let message = format!(
+ "Executing delete consumer group with ID: {} for topic with ID: {} and stream with ID: {}\nConsumer group with ID: {} deleted for topic with ID: {} and stream with ID: {}\n",
+ group_id, topic_id, stream_id, group_id, topic_id, stream_id
+ );
command_state.success().stdout(diff(message));
}
diff --git a/core/integration/tests/cli/consumer_group/test_consumer_group_get_command.rs b/core/integration/tests/cli/consumer_group/test_consumer_group_get_command.rs
index d599e31b..11ca77c6 100644
--- a/core/integration/tests/cli/consumer_group/test_consumer_group_get_command.rs
+++ b/core/integration/tests/cli/consumer_group/test_consumer_group_get_command.rs
@@ -17,8 +17,8 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestConsumerGroupId, TestHelpCmd, TestStreamId,
- TestTopicId, CLAP_INDENT, USAGE_PREFIX,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestConsumerGroupId, TestHelpCmd,
+ TestStreamId, TestTopicId, USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
use async_trait::async_trait;
diff --git a/core/integration/tests/cli/consumer_group/test_consumer_group_help_command.rs b/core/integration/tests/cli/consumer_group/test_consumer_group_help_command.rs
index bc0703ed..42db6f3a 100644
--- a/core/integration/tests/cli/consumer_group/test_consumer_group_help_command.rs
+++ b/core/integration/tests/cli/consumer_group/test_consumer_group_help_command.rs
@@ -16,7 +16,7 @@
* under the License.
*/
-use crate::cli::common::{help::TestHelpCmd, IggyCmdTest, USAGE_PREFIX};
+use crate::cli::common::{IggyCmdTest, USAGE_PREFIX, help::TestHelpCmd};
use serial_test::parallel;
#[tokio::test]
diff --git a/core/integration/tests/cli/consumer_group/test_consumer_group_list_command.rs b/core/integration/tests/cli/consumer_group/test_consumer_group_list_command.rs
index 15d36ae2..88712d14 100644
--- a/core/integration/tests/cli/consumer_group/test_consumer_group_list_command.rs
+++ b/core/integration/tests/cli/consumer_group/test_consumer_group_list_command.rs
@@ -17,8 +17,8 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, OutputFormat, TestHelpCmd, TestStreamId,
- TestTopicId, CLAP_INDENT, USAGE_PREFIX,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, OutputFormat, TestHelpCmd,
+ TestStreamId, TestTopicId, USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
use async_trait::async_trait;
diff --git a/core/integration/tests/cli/consumer_offset/test_consumer_offset_get_command.rs b/core/integration/tests/cli/consumer_offset/test_consumer_offset_get_command.rs
index a1699236..e84b8f18 100644
--- a/core/integration/tests/cli/consumer_offset/test_consumer_offset_get_command.rs
+++ b/core/integration/tests/cli/consumer_offset/test_consumer_offset_get_command.rs
@@ -17,8 +17,8 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestConsumerId, TestHelpCmd, TestStreamId,
- TestTopicId, CLAP_INDENT, USAGE_PREFIX,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestConsumerId, TestHelpCmd,
+ TestStreamId, TestTopicId, USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
use async_trait::async_trait;
@@ -175,10 +175,7 @@ impl IggyCmdTestCase for TestConsumerOffsetGetCmd {
let message = format!(
"Executing get consumer offset for consumer with ID: {} for stream with ID: {} and topic with ID: {} and partition with ID: {}",
- consumer_id,
- stream_id,
- topic_id,
- self.partition_id,
+ consumer_id, stream_id, topic_id, self.partition_id,
);
command_state
diff --git a/core/integration/tests/cli/consumer_offset/test_consumer_offset_set_command.rs b/core/integration/tests/cli/consumer_offset/test_consumer_offset_set_command.rs
index 3ab26704..9a1377d9 100644
--- a/core/integration/tests/cli/consumer_offset/test_consumer_offset_set_command.rs
+++ b/core/integration/tests/cli/consumer_offset/test_consumer_offset_set_command.rs
@@ -17,8 +17,8 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestConsumerId, TestHelpCmd, TestStreamId,
- TestTopicId, CLAP_INDENT, USAGE_PREFIX,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestConsumerId, TestHelpCmd,
+ TestStreamId, TestTopicId, USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
use async_trait::async_trait;
diff --git a/core/integration/tests/cli/context/common.rs b/core/integration/tests/cli/context/common.rs
index 12799a7a..ec6e7dd2 100644
--- a/core/integration/tests/cli/context/common.rs
+++ b/core/integration/tests/cli/context/common.rs
@@ -19,7 +19,7 @@
use std::path::PathBuf;
use iggy_binary_protocol::cli::binary_context::common::{ContextReaderWriter, ContextsConfigMap};
-use tempfile::{tempdir, TempDir};
+use tempfile::{TempDir, tempdir};
pub struct TestIggyContext {
maybe_contexts: Option<ContextsConfigMap>,
diff --git a/core/integration/tests/cli/context/test_context_list_command.rs b/core/integration/tests/cli/context/test_context_list_command.rs
index 9eafb806..85047ff0 100644
--- a/core/integration/tests/cli/context/test_context_list_command.rs
+++ b/core/integration/tests/cli/context/test_context_list_command.rs
@@ -19,7 +19,7 @@
use std::collections::HashMap;
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, CLAP_INDENT, USAGE_PREFIX,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
use async_trait::async_trait;
diff --git a/core/integration/tests/cli/context/test_context_use_command.rs b/core/integration/tests/cli/context/test_context_use_command.rs
index 41c2d41f..cbdd68f6 100644
--- a/core/integration/tests/cli/context/test_context_use_command.rs
+++ b/core/integration/tests/cli/context/test_context_use_command.rs
@@ -19,7 +19,7 @@
use std::collections::HashMap;
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, CLAP_INDENT, USAGE_PREFIX,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
use async_trait::async_trait;
diff --git a/core/integration/tests/cli/general/test_help_command.rs b/core/integration/tests/cli/general/test_help_command.rs
index 3cb34a39..03e07825 100644
--- a/core/integration/tests/cli/general/test_help_command.rs
+++ b/core/integration/tests/cli/general/test_help_command.rs
@@ -16,7 +16,7 @@
* under the License.
*/
-use crate::cli::common::{help::TestHelpCmd, IggyCmdTest, CLAP_INDENT, USAGE_PREFIX};
+use crate::cli::common::{CLAP_INDENT, IggyCmdTest, USAGE_PREFIX, help::TestHelpCmd};
use serial_test::parallel;
#[tokio::test]
diff --git a/core/integration/tests/cli/general/test_overview_command.rs b/core/integration/tests/cli/general/test_overview_command.rs
index 1705f258..6f48c433 100644
--- a/core/integration/tests/cli/general/test_overview_command.rs
+++ b/core/integration/tests/cli/general/test_overview_command.rs
@@ -16,7 +16,7 @@
* under the License.
*/
-use crate::cli::common::{help::TestHelpCmd, IggyCmdTest};
+use crate::cli::common::{IggyCmdTest, help::TestHelpCmd};
use serial_test::parallel;
const FIGLET_INDENT: &str = " ";
diff --git a/core/integration/tests/cli/message/test_message_flush_command.rs b/core/integration/tests/cli/message/test_message_flush_command.rs
index 23831ec7..ce0c888c 100644
--- a/core/integration/tests/cli/message/test_message_flush_command.rs
+++ b/core/integration/tests/cli/message/test_message_flush_command.rs
@@ -17,8 +17,8 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId, TestTopicId,
- CLAP_INDENT, USAGE_PREFIX,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId,
+ TestTopicId, USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
use async_trait::async_trait;
@@ -145,7 +145,9 @@ impl IggyCmdTestCase for TestMessageFetchCmd {
}
);
- let message = format!("Executing flush messages {identification_part}\nFlushed messages {identification_part}\n");
+ let message = format!(
+ "Executing flush messages {identification_part}\nFlushed messages {identification_part}\n"
+ );
command_state.success().stdout(diff(message));
}
diff --git a/core/integration/tests/cli/message/test_message_help_command.rs b/core/integration/tests/cli/message/test_message_help_command.rs
index 2810f9b5..5e5348cc 100644
--- a/core/integration/tests/cli/message/test_message_help_command.rs
+++ b/core/integration/tests/cli/message/test_message_help_command.rs
@@ -16,7 +16,7 @@
* under the License.
*/
-use crate::cli::common::{help::TestHelpCmd, IggyCmdTest, USAGE_PREFIX};
+use crate::cli::common::{IggyCmdTest, USAGE_PREFIX, help::TestHelpCmd};
use serial_test::parallel;
#[tokio::test]
diff --git a/core/integration/tests/cli/message/test_message_poll_command.rs b/core/integration/tests/cli/message/test_message_poll_command.rs
index 8965ab53..aea54964 100644
--- a/core/integration/tests/cli/message/test_message_poll_command.rs
+++ b/core/integration/tests/cli/message/test_message_poll_command.rs
@@ -17,8 +17,8 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId, TestTopicId,
- CLAP_INDENT, USAGE_PREFIX,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId,
+ TestTopicId, USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
use async_trait::async_trait;
@@ -188,8 +188,10 @@ impl IggyCmdTestCase for TestMessagePollCmd {
_ => format!("Polled {} messages", self.message_count),
};
- let message = format!("Executing poll messages from topic ID: {} and stream with ID: {}\nPolled messages from topic with ID: {} and stream with ID: {} (from partition with ID: {})\n{polled_status}",
- topic_id, stream_id, topic_id, stream_id, self.partition_id);
+ let message = format!(
+ "Executing poll messages from topic ID: {} and stream with ID: {}\nPolled messages from topic with ID: {} and stream with ID: {} (from partition with ID: {})\n{polled_status}",
+ topic_id, stream_id, topic_id, stream_id, self.partition_id
+ );
let mut status = command_state.success().stdout(starts_with(message));
diff --git a/core/integration/tests/cli/message/test_message_poll_to_file_command.rs b/core/integration/tests/cli/message/test_message_poll_to_file_command.rs
index 7b9df2d2..733871c4 100644
--- a/core/integration/tests/cli/message/test_message_poll_to_file_command.rs
+++ b/core/integration/tests/cli/message/test_message_poll_to_file_command.rs
@@ -157,8 +157,10 @@ impl IggyCmdTestCase for TestMessagePollToFileCmd<'_> {
_ => format!("Polled {} messages", self.message_count),
};
- let message_prefix = format!("Executing poll messages from topic ID: {} and stream with ID: {}\nPolled messages from topic with ID: {} and stream with ID: {} (from partition with ID: 1)\n{polled_status}",
- self.topic_name, self.stream_name, self.topic_name, self.stream_name);
+ let message_prefix = format!(
+ "Executing poll messages from topic ID: {} and stream with ID: {}\nPolled messages from topic with ID: {} and stream with ID: {} (from partition with ID: 1)\n{polled_status}",
+ self.topic_name, self.stream_name, self.topic_name, self.stream_name
+ );
let message_file = format!("Storing messages to {} binary file", self.output_file);
let message_count = format!(
"Stored {} of total size [0-9.]+ K?B to {} binary file",
diff --git a/core/integration/tests/cli/message/test_message_send_command.rs b/core/integration/tests/cli/message/test_message_send_command.rs
index 74524335..6c9372d2 100644
--- a/core/integration/tests/cli/message/test_message_send_command.rs
+++ b/core/integration/tests/cli/message/test_message_send_command.rs
@@ -17,8 +17,8 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId, TestTopicId,
- CLAP_INDENT, USAGE_PREFIX,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId,
+ TestTopicId, USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
use async_trait::async_trait;
@@ -200,8 +200,10 @@ impl IggyCmdTestCase for TestMessageSendCmd {
TestTopicId::Named => self.topic_name.clone(),
};
- let message = format!("Executing send messages to topic with ID: {} and stream with ID: {}\nSent messages to topic with ID: {} and stream with ID: {}\n",
- topic_id, stream_id, topic_id, stream_id);
+ let message = format!(
+ "Executing send messages to topic with ID: {} and stream with ID: {}\nSent messages to topic with ID: {} and stream with ID: {}\n",
+ topic_id, stream_id, topic_id, stream_id
+ );
command_state.success().stdout(diff(message));
}
diff --git a/core/integration/tests/cli/partition/test_partition_create_command.rs b/core/integration/tests/cli/partition/test_partition_create_command.rs
index ebcb92a9..e1f0b191 100644
--- a/core/integration/tests/cli/partition/test_partition_create_command.rs
+++ b/core/integration/tests/cli/partition/test_partition_create_command.rs
@@ -17,8 +17,8 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId, TestTopicId,
- CLAP_INDENT, USAGE_PREFIX,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId,
+ TestTopicId, USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
use async_trait::async_trait;
@@ -131,8 +131,10 @@ impl IggyCmdTestCase for TestPartitionCreateCmd {
partitions.push('s');
};
- let message = format!("Executing create {} {partitions} for topic with ID: {} and stream with ID: {}\nCreated {} {partitions} for topic with ID: {} and stream with ID: {}\n",
- self.new_partitions, topic_id, stream_id, self.new_partitions, topic_id, stream_id);
+ let message = format!(
+ "Executing create {} {partitions} for topic with ID: {} and stream with ID: {}\nCreated {} {partitions} for topic with ID: {} and stream with ID: {}\n",
+ self.new_partitions, topic_id, stream_id, self.new_partitions, topic_id, stream_id
+ );
command_state.success().stdout(diff(message));
}
diff --git a/core/integration/tests/cli/partition/test_partition_delete_command.rs b/core/integration/tests/cli/partition/test_partition_delete_command.rs
index f207e42f..0b789aee 100644
--- a/core/integration/tests/cli/partition/test_partition_delete_command.rs
+++ b/core/integration/tests/cli/partition/test_partition_delete_command.rs
@@ -17,8 +17,8 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId, TestTopicId,
- CLAP_INDENT, USAGE_PREFIX,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId,
+ TestTopicId, USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
use async_trait::async_trait;
@@ -127,8 +127,10 @@ impl IggyCmdTestCase for TestPartitionDeleteCmd {
partitions.push('s');
};
- let message = format!("Executing delete {} {partitions} for topic with ID: {} and stream with ID: {}\nDeleted {} {partitions} for topic with ID: {} and stream with ID: {}\n",
- self.new_partitions, topic_id, stream_id, self.new_partitions, topic_id, stream_id);
+ let message = format!(
+ "Executing delete {} {partitions} for topic with ID: {} and stream with ID: {}\nDeleted {} {partitions} for topic with ID: {} and stream with ID: {}\n",
+ self.new_partitions, topic_id, stream_id, self.new_partitions, topic_id, stream_id
+ );
command_state.success().stdout(diff(message));
}
diff --git a/core/integration/tests/cli/partition/test_partition_help_command.rs b/core/integration/tests/cli/partition/test_partition_help_command.rs
index f7677a93..c04d2650 100644
--- a/core/integration/tests/cli/partition/test_partition_help_command.rs
+++ b/core/integration/tests/cli/partition/test_partition_help_command.rs
@@ -16,7 +16,7 @@
* under the License.
*/
-use crate::cli::common::{help::TestHelpCmd, IggyCmdTest, USAGE_PREFIX};
+use crate::cli::common::{IggyCmdTest, USAGE_PREFIX, help::TestHelpCmd};
use serial_test::parallel;
#[tokio::test]
diff --git a/core/integration/tests/cli/personal_access_token/test_pat_create_command.rs b/core/integration/tests/cli/personal_access_token/test_pat_create_command.rs
index 297e7098..00556c42 100644
--- a/core/integration/tests/cli/personal_access_token/test_pat_create_command.rs
+++ b/core/integration/tests/cli/personal_access_token/test_pat_create_command.rs
@@ -17,12 +17,12 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, CLAP_INDENT, USAGE_PREFIX,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
use async_trait::async_trait;
-use humantime::format_duration;
use humantime::Duration as HumanDuration;
+use humantime::format_duration;
use iggy::prelude::Client;
use predicates::str::starts_with;
use serial_test::parallel;
@@ -70,8 +70,10 @@ impl IggyCmdTestCase for TestPatCreateCmd {
None => String::from("without token expire time"),
};
- let message = format!("Executing create personal access token with name: {} and {}\nPersonal access token with name: {} and {} created\nToken: ",
- self.name, expiry, self.name, expiry);
+ let message = format!(
+ "Executing create personal access token with name: {} and {}\nPersonal access token with name: {} and {} created\nToken: ",
+ self.name, expiry, self.name, expiry
+ );
command_state.success().stdout(starts_with(message));
}
diff --git a/core/integration/tests/cli/personal_access_token/test_pat_delete_command.rs b/core/integration/tests/cli/personal_access_token/test_pat_delete_command.rs
index 694bcaa8..e811ce5f 100644
--- a/core/integration/tests/cli/personal_access_token/test_pat_delete_command.rs
+++ b/core/integration/tests/cli/personal_access_token/test_pat_delete_command.rs
@@ -56,8 +56,10 @@ impl IggyCmdTestCase for TestPatDeleteCmd {
}
fn verify_command(&self, command_state: Assert) {
- let message = format!("Executing delete personal access tokens with name: {}\nPersonal access token with name: {} deleted\n",
- self.name, self.name);
+ let message = format!(
+ "Executing delete personal access tokens with name: {}\nPersonal access token with name: {} deleted\n",
+ self.name, self.name
+ );
command_state.success().stdout(diff(message));
}
diff --git a/core/integration/tests/cli/personal_access_token/test_pat_help_command.rs b/core/integration/tests/cli/personal_access_token/test_pat_help_command.rs
index 2856f24b..91de8266 100644
--- a/core/integration/tests/cli/personal_access_token/test_pat_help_command.rs
+++ b/core/integration/tests/cli/personal_access_token/test_pat_help_command.rs
@@ -16,7 +16,7 @@
* under the License.
*/
-use crate::cli::common::{help::TestHelpCmd, IggyCmdTest, USAGE_PREFIX};
+use crate::cli::common::{IggyCmdTest, USAGE_PREFIX, help::TestHelpCmd};
use serial_test::parallel;
#[tokio::test]
diff --git a/core/integration/tests/cli/personal_access_token/test_pat_list_command.rs b/core/integration/tests/cli/personal_access_token/test_pat_list_command.rs
index d1e168c7..b02f0ef6 100644
--- a/core/integration/tests/cli/personal_access_token/test_pat_list_command.rs
+++ b/core/integration/tests/cli/personal_access_token/test_pat_list_command.rs
@@ -17,7 +17,7 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, OutputFormat, TestHelpCmd, CLAP_INDENT,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, OutputFormat, TestHelpCmd,
USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
diff --git a/core/integration/tests/cli/stream/test_stream_delete_command.rs b/core/integration/tests/cli/stream/test_stream_delete_command.rs
index aceda01b..fa0fe6a6 100644
--- a/core/integration/tests/cli/stream/test_stream_delete_command.rs
+++ b/core/integration/tests/cli/stream/test_stream_delete_command.rs
@@ -17,7 +17,7 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId, CLAP_INDENT,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId,
USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
diff --git a/core/integration/tests/cli/stream/test_stream_get_command.rs b/core/integration/tests/cli/stream/test_stream_get_command.rs
index 8d50b761..9b8c9511 100644
--- a/core/integration/tests/cli/stream/test_stream_get_command.rs
+++ b/core/integration/tests/cli/stream/test_stream_get_command.rs
@@ -17,7 +17,7 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId, CLAP_INDENT,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId,
USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
diff --git a/core/integration/tests/cli/stream/test_stream_help_command.rs b/core/integration/tests/cli/stream/test_stream_help_command.rs
index 6b4f1a4f..8b79e6c6 100644
--- a/core/integration/tests/cli/stream/test_stream_help_command.rs
+++ b/core/integration/tests/cli/stream/test_stream_help_command.rs
@@ -16,7 +16,7 @@
* under the License.
*/
-use crate::cli::common::{help::TestHelpCmd, IggyCmdTest, USAGE_PREFIX};
+use crate::cli::common::{IggyCmdTest, USAGE_PREFIX, help::TestHelpCmd};
use serial_test::parallel;
#[tokio::test]
diff --git a/core/integration/tests/cli/stream/test_stream_list_command.rs b/core/integration/tests/cli/stream/test_stream_list_command.rs
index a9a4995f..3c4d4db5 100644
--- a/core/integration/tests/cli/stream/test_stream_list_command.rs
+++ b/core/integration/tests/cli/stream/test_stream_list_command.rs
@@ -17,7 +17,7 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, OutputFormat, TestHelpCmd, CLAP_INDENT,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, OutputFormat, TestHelpCmd,
USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
diff --git a/core/integration/tests/cli/stream/test_stream_purge_command.rs b/core/integration/tests/cli/stream/test_stream_purge_command.rs
index f8ce290b..121ce753 100644
--- a/core/integration/tests/cli/stream/test_stream_purge_command.rs
+++ b/core/integration/tests/cli/stream/test_stream_purge_command.rs
@@ -17,7 +17,7 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId, CLAP_INDENT,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId,
USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
diff --git a/core/integration/tests/cli/stream/test_stream_update_command.rs b/core/integration/tests/cli/stream/test_stream_update_command.rs
index bc3e6aee..d7fd95fe 100644
--- a/core/integration/tests/cli/stream/test_stream_update_command.rs
+++ b/core/integration/tests/cli/stream/test_stream_update_command.rs
@@ -17,7 +17,7 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId, CLAP_INDENT,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId,
USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
@@ -70,8 +70,14 @@ impl IggyCmdTestCase for TestStreamUpdateCmd {
fn verify_command(&self, command_state: Assert) {
let message = match self.using_identifier {
- TestStreamId::Named => format!("Executing update stream with ID: {} and name: {}\nStream with ID: {} updated name: {}\n", self.name, self.new_name, self.name, self.new_name),
- TestStreamId::Numeric => format!("Executing update stream with ID: {} and name: {}\nStream with ID: {} updated name: {}\n", self.stream_id, self.new_name, self.stream_id, self.new_name),
+ TestStreamId::Named => format!(
+ "Executing update stream with ID: {} and name: {}\nStream with ID: {} updated name: {}\n",
+ self.name, self.new_name, self.name, self.new_name
+ ),
+ TestStreamId::Numeric => format!(
+ "Executing update stream with ID: {} and name: {}\nStream with ID: {} updated name: {}\n",
+ self.stream_id, self.new_name, self.stream_id, self.new_name
+ ),
};
command_state.success().stdout(diff(message));
diff --git a/core/integration/tests/cli/system/test_ping_command.rs b/core/integration/tests/cli/system/test_ping_command.rs
index d081f306..870e5c15 100644
--- a/core/integration/tests/cli/system/test_ping_command.rs
+++ b/core/integration/tests/cli/system/test_ping_command.rs
@@ -17,7 +17,7 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, CLAP_INDENT, USAGE_PREFIX,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
use async_trait::async_trait;
diff --git a/core/integration/tests/cli/system/test_stats_command.rs b/core/integration/tests/cli/system/test_stats_command.rs
index d57ef654..6af7e43c 100644
--- a/core/integration/tests/cli/system/test_stats_command.rs
+++ b/core/integration/tests/cli/system/test_stats_command.rs
@@ -17,7 +17,7 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, CLAP_INDENT, USAGE_PREFIX,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
use async_trait::async_trait;
diff --git a/core/integration/tests/cli/topic/test_topic_create_command.rs b/core/integration/tests/cli/topic/test_topic_create_command.rs
index 3f721fbd..5b5b3a6d 100644
--- a/core/integration/tests/cli/topic/test_topic_create_command.rs
+++ b/core/integration/tests/cli/topic/test_topic_create_command.rs
@@ -17,7 +17,7 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId, CLAP_INDENT,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId,
USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
diff --git a/core/integration/tests/cli/topic/test_topic_delete_command.rs b/core/integration/tests/cli/topic/test_topic_delete_command.rs
index 8f494d17..8028905a 100644
--- a/core/integration/tests/cli/topic/test_topic_delete_command.rs
+++ b/core/integration/tests/cli/topic/test_topic_delete_command.rs
@@ -17,8 +17,8 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId, TestTopicId,
- CLAP_INDENT, USAGE_PREFIX,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId,
+ TestTopicId, USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
use async_trait::async_trait;
@@ -116,8 +116,10 @@ impl IggyCmdTestCase for TestTopicDeleteCmd {
// Executing delete topic with ID: 4 in stream with ID: 1
// Topic with ID: 4 in stream with ID: 1 deleted
- let message = format!("Executing delete topic with ID: {} in stream with ID: {}\nTopic with ID: {} in stream with ID: {} deleted\n",
- topic_id, stream_id, topic_id, stream_id);
+ let message = format!(
+ "Executing delete topic with ID: {} in stream with ID: {}\nTopic with ID: {} in stream with ID: {} deleted\n",
+ topic_id, stream_id, topic_id, stream_id
+ );
command_state.success().stdout(diff(message));
}
diff --git a/core/integration/tests/cli/topic/test_topic_get_command.rs b/core/integration/tests/cli/topic/test_topic_get_command.rs
index c21f10e9..d7ae2698 100644
--- a/core/integration/tests/cli/topic/test_topic_get_command.rs
+++ b/core/integration/tests/cli/topic/test_topic_get_command.rs
@@ -17,8 +17,8 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId, TestTopicId,
- CLAP_INDENT, USAGE_PREFIX,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId,
+ TestTopicId, USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
use async_trait::async_trait;
diff --git a/core/integration/tests/cli/topic/test_topic_help_command.rs b/core/integration/tests/cli/topic/test_topic_help_command.rs
index 40ac5ffc..0f2bd92f 100644
--- a/core/integration/tests/cli/topic/test_topic_help_command.rs
+++ b/core/integration/tests/cli/topic/test_topic_help_command.rs
@@ -16,7 +16,7 @@
* under the License.
*/
-use crate::cli::common::{help::TestHelpCmd, IggyCmdTest, USAGE_PREFIX};
+use crate::cli::common::{IggyCmdTest, USAGE_PREFIX, help::TestHelpCmd};
use serial_test::parallel;
#[tokio::test]
diff --git a/core/integration/tests/cli/topic/test_topic_list_command.rs b/core/integration/tests/cli/topic/test_topic_list_command.rs
index 2099af66..51669517 100644
--- a/core/integration/tests/cli/topic/test_topic_list_command.rs
+++ b/core/integration/tests/cli/topic/test_topic_list_command.rs
@@ -17,8 +17,8 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, OutputFormat, TestHelpCmd, TestStreamId,
- CLAP_INDENT, USAGE_PREFIX,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, OutputFormat, TestHelpCmd,
+ TestStreamId, USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
use async_trait::async_trait;
diff --git a/core/integration/tests/cli/topic/test_topic_purge_command.rs b/core/integration/tests/cli/topic/test_topic_purge_command.rs
index d25b7f20..df52e6ec 100644
--- a/core/integration/tests/cli/topic/test_topic_purge_command.rs
+++ b/core/integration/tests/cli/topic/test_topic_purge_command.rs
@@ -17,8 +17,8 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId, TestTopicId,
- CLAP_INDENT, USAGE_PREFIX,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId,
+ TestTopicId, USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
use async_trait::async_trait;
@@ -137,8 +137,10 @@ impl IggyCmdTestCase for TestTopicPurgeCmd {
TestTopicId::Named => self.topic_name.clone(),
};
- let message = format!("Executing purge topic with ID: {} in stream with ID: {}\nTopic with ID: {} in stream with ID: {} purged\n",
- topic_id, stream_id, topic_id, stream_id);
+ let message = format!(
+ "Executing purge topic with ID: {} in stream with ID: {}\nTopic with ID: {} in stream with ID: {} purged\n",
+ topic_id, stream_id, topic_id, stream_id
+ );
command_state.success().stdout(diff(message));
}
diff --git a/core/integration/tests/cli/topic/test_topic_update_command.rs b/core/integration/tests/cli/topic/test_topic_update_command.rs
index ff94eff2..d250f404 100644
--- a/core/integration/tests/cli/topic/test_topic_update_command.rs
+++ b/core/integration/tests/cli/topic/test_topic_update_command.rs
@@ -17,8 +17,8 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId, TestTopicId,
- CLAP_INDENT, USAGE_PREFIX,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestStreamId,
+ TestTopicId, USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
use async_trait::async_trait;
@@ -183,12 +183,14 @@ impl IggyCmdTestCase for TestTopicUpdateCmd {
let new_topic_name = &self.topic_new_name;
let new_max_topic_size = self.topic_new_max_size.to_string();
- let expected_message = format!("Executing update topic with ID: {topic_id}, name: {new_topic_name}, \
+ let expected_message = format!(
+ "Executing update topic with ID: {topic_id}, name: {new_topic_name}, \
message expiry: {message_expiry}, compression algorithm: {compression_algorithm}, max topic size: {new_max_topic_size}, \
replication factor: {replication_factor}, in stream with ID: {stream_id}\n\
Topic with ID: {topic_id} updated name: {new_topic_name}, updated message expiry: {message_expiry}, \
updated compression algorithm: {compression_algorithm}, updated max topic size: {new_max_topic_size}, \
- updated replication factor: {replication_factor} in stream with ID: {stream_id}\n");
+ updated replication factor: {replication_factor} in stream with ID: {stream_id}\n"
+ );
command_state.success().stdout(diff(expected_message));
}
diff --git a/core/integration/tests/cli/user/test_login_options.rs b/core/integration/tests/cli/user/test_login_options.rs
index d5ca49e6..33eb481f 100644
--- a/core/integration/tests/cli/user/test_login_options.rs
+++ b/core/integration/tests/cli/user/test_login_options.rs
@@ -19,8 +19,8 @@
use crate::cli::common::{IggyCmdCommand, IggyCmdTest, IggyCmdTestCase};
use assert_cmd::assert::Assert;
use async_trait::async_trait;
-use iggy::prelude::defaults::{DEFAULT_ROOT_PASSWORD, DEFAULT_ROOT_USERNAME};
use iggy::prelude::Client;
+use iggy::prelude::defaults::{DEFAULT_ROOT_PASSWORD, DEFAULT_ROOT_USERNAME};
use predicates::str::{contains, starts_with};
use serial_test::parallel;
diff --git a/core/integration/tests/cli/user/test_user_create_command.rs b/core/integration/tests/cli/user/test_user_create_command.rs
index b1492b60..edc07df3 100644
--- a/core/integration/tests/cli/user/test_user_create_command.rs
+++ b/core/integration/tests/cli/user/test_user_create_command.rs
@@ -17,7 +17,7 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, CLAP_INDENT, USAGE_PREFIX,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, USAGE_PREFIX,
};
use crate::cli::user::common::PermissionsTestArgs;
use ahash::AHashMap;
diff --git a/core/integration/tests/cli/user/test_user_delete_command.rs b/core/integration/tests/cli/user/test_user_delete_command.rs
index 0eb6367d..dd501eb7 100644
--- a/core/integration/tests/cli/user/test_user_delete_command.rs
+++ b/core/integration/tests/cli/user/test_user_delete_command.rs
@@ -17,7 +17,7 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestUserId, CLAP_INDENT,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestUserId,
USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
diff --git a/core/integration/tests/cli/user/test_user_get_command.rs b/core/integration/tests/cli/user/test_user_get_command.rs
index 03db0d8d..0d623a24 100644
--- a/core/integration/tests/cli/user/test_user_get_command.rs
+++ b/core/integration/tests/cli/user/test_user_get_command.rs
@@ -17,7 +17,7 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestUserId, CLAP_INDENT,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestUserId,
USAGE_PREFIX,
};
use ahash::AHashMap;
diff --git a/core/integration/tests/cli/user/test_user_help_command.rs b/core/integration/tests/cli/user/test_user_help_command.rs
index 0db910e7..ff25560b 100644
--- a/core/integration/tests/cli/user/test_user_help_command.rs
+++ b/core/integration/tests/cli/user/test_user_help_command.rs
@@ -16,7 +16,7 @@
* under the License.
*/
-use crate::cli::common::{help::TestHelpCmd, IggyCmdTest, USAGE_PREFIX};
+use crate::cli::common::{IggyCmdTest, USAGE_PREFIX, help::TestHelpCmd};
use serial_test::parallel;
#[tokio::test]
diff --git a/core/integration/tests/cli/user/test_user_list_command.rs b/core/integration/tests/cli/user/test_user_list_command.rs
index b7308c37..695a41e5 100644
--- a/core/integration/tests/cli/user/test_user_list_command.rs
+++ b/core/integration/tests/cli/user/test_user_list_command.rs
@@ -17,7 +17,7 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, OutputFormat, TestHelpCmd, CLAP_INDENT,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, OutputFormat, TestHelpCmd,
USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
diff --git a/core/integration/tests/cli/user/test_user_name_command.rs b/core/integration/tests/cli/user/test_user_name_command.rs
index 0c54df46..ebe4572d 100644
--- a/core/integration/tests/cli/user/test_user_name_command.rs
+++ b/core/integration/tests/cli/user/test_user_name_command.rs
@@ -17,7 +17,7 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestUserId, CLAP_INDENT,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestUserId,
USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
@@ -88,8 +88,10 @@ impl IggyCmdTestCase for TestUserNameCmd {
TestUserId::Numeric => &numeric_id,
};
- let message = format!("Executing update user with ID: {} with username: {}\nUser with ID: {} updated with username: {}\n",
- identifier, self.new_username, identifier, self.new_username);
+ let message = format!(
+ "Executing update user with ID: {} with username: {}\nUser with ID: {} updated with username: {}\n",
+ identifier, self.new_username, identifier, self.new_username
+ );
command_state.success().stdout(diff(message));
}
diff --git a/core/integration/tests/cli/user/test_user_password_command.rs b/core/integration/tests/cli/user/test_user_password_command.rs
index 59a2fac7..821419c8 100644
--- a/core/integration/tests/cli/user/test_user_password_command.rs
+++ b/core/integration/tests/cli/user/test_user_password_command.rs
@@ -17,7 +17,7 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestUserId, CLAP_INDENT,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestUserId,
USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
@@ -122,7 +122,8 @@ impl IggyCmdTestCase for TestUserPasswordCmd {
),
TestUserId::Numeric => format!(
"Executing change password for user with ID: {}\nPassword for user with ID: {} changed\n",
- self.user_id.unwrap(), self.user_id.unwrap()
+ self.user_id.unwrap(),
+ self.user_id.unwrap()
),
};
diff --git a/core/integration/tests/cli/user/test_user_permissions_command.rs b/core/integration/tests/cli/user/test_user_permissions_command.rs
index b4333788..47da2a5d 100644
--- a/core/integration/tests/cli/user/test_user_permissions_command.rs
+++ b/core/integration/tests/cli/user/test_user_permissions_command.rs
@@ -17,7 +17,7 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestUserId, CLAP_INDENT,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestUserId,
USAGE_PREFIX,
};
use crate::cli::user::common::PermissionsTestArgs;
@@ -98,7 +98,8 @@ impl IggyCmdTestCase for TestUserPermissionsCmd {
),
TestUserId::Numeric => format!(
"Executing update permissions for user with ID: {}\nPermissions for user with ID: {} updated\n",
- self.user_id.unwrap(), self.user_id.unwrap()
+ self.user_id.unwrap(),
+ self.user_id.unwrap()
),
};
diff --git a/core/integration/tests/cli/user/test_user_status_command.rs b/core/integration/tests/cli/user/test_user_status_command.rs
index 25caddf9..ae3df89d 100644
--- a/core/integration/tests/cli/user/test_user_status_command.rs
+++ b/core/integration/tests/cli/user/test_user_status_command.rs
@@ -17,7 +17,7 @@
*/
use crate::cli::common::{
- IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestUserId, CLAP_INDENT,
+ CLAP_INDENT, IggyCmdCommand, IggyCmdTest, IggyCmdTestCase, TestHelpCmd, TestUserId,
USAGE_PREFIX,
};
use assert_cmd::assert::Assert;
@@ -93,8 +93,17 @@ impl IggyCmdTestCase for TestUserStatusCmd {
fn verify_command(&self, command_state: Assert) {
let message = match self.using_identifier {
- TestUserId::Named => format!("Executing update user with ID: {} with status: {}\nUser with ID: {} updated with status: {}\n", self.username, self.new_status, self.username, self.new_status),
- TestUserId::Numeric => format!("Executing update user with ID: {} with status: {}\nUser with ID: {} updated with status: {}\n", self.user_id.unwrap(), self.new_status, self.user_id.unwrap(), self.new_status),
+ TestUserId::Named => format!(
+ "Executing update user with ID: {} with status: {}\nUser with ID: {} updated with status: {}\n",
+ self.username, self.new_status, self.username, self.new_status
+ ),
+ TestUserId::Numeric => format!(
+ "Executing update user with ID: {} with status: {}\nUser with ID: {} updated with status: {}\n",
+ self.user_id.unwrap(),
+ self.new_status,
+ self.user_id.unwrap(),
+ self.new_status
+ ),
};
command_state.success().stdout(diff(message));
diff --git a/core/integration/tests/config_provider/mod.rs b/core/integration/tests/config_provider/mod.rs
index 96bf9c67..9e6793c0 100644
--- a/core/integration/tests/config_provider/mod.rs
+++ b/core/integration/tests/config_provider/mod.rs
@@ -55,21 +55,23 @@ async fn validate_custom_env_provider() {
let expected_message_saver_enabled = false;
let expected_message_expiry = "10s";
- env::set_var(
- "IGGY_QUIC_DATAGRAM_SEND_BUFFER_SIZE",
- expected_datagram_send_buffer_size,
- );
- env::set_var(
- "IGGY_QUIC_CERTIFICATE_SELF_SIGNED",
- expected_quic_certificate_self_signed.to_string(),
- );
- env::set_var("IGGY_HTTP_ENABLED", expected_http_enabled.to_string());
- env::set_var("IGGY_TCP_ENABLED", expected_tcp_enabled);
- env::set_var(
- "IGGY_MESSAGE_SAVER_ENABLED",
- expected_message_saver_enabled.to_string(),
- );
- env::set_var("IGGY_SYSTEM_SEGMENT_MESSAGE_EXPIRY", "10s");
+ unsafe {
+ env::set_var(
+ "IGGY_QUIC_DATAGRAM_SEND_BUFFER_SIZE",
+ expected_datagram_send_buffer_size,
+ );
+ env::set_var(
+ "IGGY_QUIC_CERTIFICATE_SELF_SIGNED",
+ expected_quic_certificate_self_signed.to_string(),
+ );
+ env::set_var("IGGY_HTTP_ENABLED", expected_http_enabled.to_string());
+ env::set_var("IGGY_TCP_ENABLED", expected_tcp_enabled);
+ env::set_var(
+ "IGGY_MESSAGE_SAVER_ENABLED",
+ expected_message_saver_enabled.to_string(),
+ );
+ env::set_var("IGGY_SYSTEM_SEGMENT_MESSAGE_EXPIRY", "10s");
+ }
let config_path = get_root_path().join("../configs/server.toml");
let file_config_provider = FileConfigProvider::new(config_path.as_path().display().to_string());
@@ -94,10 +96,12 @@ async fn validate_custom_env_provider() {
expected_message_expiry
);
- env::remove_var("IGGY_QUIC_DATAGRAM_SEND_BUFFER_SIZE");
- env::remove_var("IGGY_QUIC_CERTIFICATE_SELF_SIGNED");
- env::remove_var("IGGY_HTTP_ENABLED");
- env::remove_var("IGGY_TCP_ENABLED");
- env::remove_var("IGGY_MESSAGE_SAVER_ENABLED");
- env::remove_var("IGGY_SYSTEM_RETENTION_POLICY_MESSAGE_EXPIRY");
+ unsafe {
+ env::remove_var("IGGY_QUIC_DATAGRAM_SEND_BUFFER_SIZE");
+ env::remove_var("IGGY_QUIC_CERTIFICATE_SELF_SIGNED");
+ env::remove_var("IGGY_HTTP_ENABLED");
+ env::remove_var("IGGY_TCP_ENABLED");
+ env::remove_var("IGGY_MESSAGE_SAVER_ENABLED");
+ env::remove_var("IGGY_SYSTEM_RETENTION_POLICY_MESSAGE_EXPIRY");
+ }
}
diff --git a/core/integration/tests/data_integrity/verify_after_server_restart.rs b/core/integration/tests/data_integrity/verify_after_server_restart.rs
index 94e4639f..becb53c3 100644
--- a/core/integration/tests/data_integrity/verify_after_server_restart.rs
+++ b/core/integration/tests/data_integrity/verify_after_server_restart.rs
@@ -24,7 +24,7 @@ use iggy::prelude::{MessageClient, SystemClient};
use integration::{
tcp_client::TcpClientFactory,
test_server::{
- login_root, ClientFactory, IpAddrKind, TestServer, Transport, SYSTEM_PATH_ENV_VAR,
+ ClientFactory, IpAddrKind, SYSTEM_PATH_ENV_VAR, TestServer, Transport, login_root,
},
};
use serial_test::parallel;
diff --git a/core/integration/tests/examples/mod.rs b/core/integration/tests/examples/mod.rs
index 64d542b2..10fb01c3 100644
--- a/core/integration/tests/examples/mod.rs
+++ b/core/integration/tests/examples/mod.rs
@@ -23,12 +23,12 @@ mod test_message_headers;
use assert_cmd::Command;
use iggy::clients::client::IggyClient;
-use iggy::prelude::defaults::*;
use iggy::prelude::CompressionAlgorithm;
use iggy::prelude::IggyExpiry;
use iggy::prelude::MaxTopicSize;
use iggy::prelude::TcpClient;
use iggy::prelude::TcpClientConfig;
+use iggy::prelude::defaults::*;
use iggy::prelude::{Client, StreamClient, SystemClient, TopicClient, UserClient};
use integration::test_server::{IpAddrKind, TestServer};
use regex::Regex;
diff --git a/core/integration/tests/mod.rs b/core/integration/tests/mod.rs
index 557fa10a..32c49b8d 100644
--- a/core/integration/tests/mod.rs
+++ b/core/integration/tests/mod.rs
@@ -20,8 +20,8 @@ use ctor::{ctor, dtor};
use lazy_static::lazy_static;
use std::collections::{HashMap, HashSet};
use std::io::Write;
-use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::RwLock;
+use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::{Arc, Once};
use std::{panic, thread};
diff --git a/core/integration/tests/server/scenarios/consumer_group_join_scenario.rs b/core/integration/tests/server/scenarios/consumer_group_join_scenario.rs
index fbf58d98..9a79bb3c 100644
--- a/core/integration/tests/server/scenarios/consumer_group_join_scenario.rs
+++ b/core/integration/tests/server/scenarios/consumer_group_join_scenario.rs
@@ -17,9 +17,8 @@
*/
use crate::server::scenarios::{
- cleanup, create_client, join_consumer_group, CONSUMER_GROUP_ID, CONSUMER_GROUP_NAME,
- PARTITIONS_COUNT, STREAM_ID, STREAM_NAME, TOPIC_ID, TOPIC_NAME, USERNAME_1, USERNAME_2,
- USERNAME_3,
+ CONSUMER_GROUP_ID, CONSUMER_GROUP_NAME, PARTITIONS_COUNT, STREAM_ID, STREAM_NAME, TOPIC_ID,
+ TOPIC_NAME, USERNAME_1, USERNAME_2, USERNAME_3, cleanup, create_client, join_consumer_group,
};
use iggy::clients::client::IggyClient;
use iggy::prelude::ClientInfoDetails;
@@ -30,7 +29,7 @@ use iggy::prelude::IggyExpiry;
use iggy::prelude::MaxTopicSize;
use iggy::prelude::{ConsumerGroupClient, StreamClient, SystemClient, TopicClient};
use integration::test_server::{
- assert_clean_system, create_user, login_root, login_user, ClientFactory,
+ ClientFactory, assert_clean_system, create_user, login_root, login_user,
};
pub async fn run(client_factory: &dyn ClientFactory) {
diff --git a/core/integration/tests/server/scenarios/consumer_group_with_multiple_clients_polling_messages_scenario.rs b/core/integration/tests/server/scenarios/consumer_group_with_multiple_clients_polling_messages_scenario.rs
index b0a4a004..4e79ce29 100644
--- a/core/integration/tests/server/scenarios/consumer_group_with_multiple_clients_polling_messages_scenario.rs
+++ b/core/integration/tests/server/scenarios/consumer_group_with_multiple_clients_polling_messages_scenario.rs
@@ -17,15 +17,15 @@
*/
use crate::server::scenarios::{
- cleanup, create_client, get_consumer_group, join_consumer_group, CONSUMER_GROUP_ID,
- CONSUMER_GROUP_NAME, MESSAGES_COUNT, PARTITIONS_COUNT, STREAM_ID, STREAM_NAME, TOPIC_ID,
- TOPIC_NAME,
+ CONSUMER_GROUP_ID, CONSUMER_GROUP_NAME, MESSAGES_COUNT, PARTITIONS_COUNT, STREAM_ID,
+ STREAM_NAME, TOPIC_ID, TOPIC_NAME, cleanup, create_client, get_consumer_group,
+ join_consumer_group,
};
use iggy::prelude::*;
use integration::test_server::{
- assert_clean_system, create_user, login_root, login_user, ClientFactory,
+ ClientFactory, assert_clean_system, create_user, login_root, login_user,
};
-use std::str::{from_utf8, FromStr};
+use std::str::{FromStr, from_utf8};
pub async fn run(client_factory: &dyn ClientFactory) {
let system_client = create_client(client_factory).await;
diff --git a/core/integration/tests/server/scenarios/consumer_group_with_single_client_polling_messages_scenario.rs b/core/integration/tests/server/scenarios/consumer_group_with_single_client_polling_messages_scenario.rs
index 55688839..3334e1ac 100644
--- a/core/integration/tests/server/scenarios/consumer_group_with_single_client_polling_messages_scenario.rs
+++ b/core/integration/tests/server/scenarios/consumer_group_with_single_client_polling_messages_scenario.rs
@@ -17,13 +17,13 @@
*/
use crate::server::scenarios::{
- cleanup, create_client, get_consumer_group, join_consumer_group, CONSUMER_GROUP_ID,
- CONSUMER_GROUP_NAME, MESSAGES_COUNT, PARTITIONS_COUNT, STREAM_ID, STREAM_NAME, TOPIC_ID,
- TOPIC_NAME,
+ CONSUMER_GROUP_ID, CONSUMER_GROUP_NAME, MESSAGES_COUNT, PARTITIONS_COUNT, STREAM_ID,
+ STREAM_NAME, TOPIC_ID, TOPIC_NAME, cleanup, create_client, get_consumer_group,
+ join_consumer_group,
};
use iggy::prelude::*;
-use integration::test_server::{assert_clean_system, login_root, ClientFactory};
-use std::str::{from_utf8, FromStr};
+use integration::test_server::{ClientFactory, assert_clean_system, login_root};
+use std::str::{FromStr, from_utf8};
pub async fn run(client_factory: &dyn ClientFactory) {
let client = create_client(client_factory).await;
diff --git a/core/integration/tests/server/scenarios/create_message_payload.rs b/core/integration/tests/server/scenarios/create_message_payload.rs
index 629a9575..1771afcb 100644
--- a/core/integration/tests/server/scenarios/create_message_payload.rs
+++ b/core/integration/tests/server/scenarios/create_message_payload.rs
@@ -18,7 +18,7 @@
use bytes::Bytes;
use iggy::prelude::*;
-use integration::test_server::{assert_clean_system, login_root, ClientFactory};
+use integration::test_server::{ClientFactory, assert_clean_system, login_root};
use std::collections::HashMap;
use std::str::FromStr;
@@ -90,11 +90,13 @@ pub async fn run(client_factory: &dyn ClientFactory) {
.unwrap(),
"Value 1"
);
- assert!(headers
- .get(&HeaderKey::new("key 2").unwrap())
- .unwrap()
- .as_bool()
- .unwrap(),);
+ assert!(
+ headers
+ .get(&HeaderKey::new("key 2").unwrap())
+ .unwrap()
+ .as_bool()
+ .unwrap(),
+ );
assert_eq!(
headers
.get(&HeaderKey::new("key-3").unwrap())
diff --git a/core/integration/tests/server/scenarios/message_headers_scenario.rs b/core/integration/tests/server/scenarios/message_headers_scenario.rs
index cf207d72..04f34d72 100644
--- a/core/integration/tests/server/scenarios/message_headers_scenario.rs
+++ b/core/integration/tests/server/scenarios/message_headers_scenario.rs
@@ -17,12 +17,12 @@
*/
use crate::server::scenarios::{
- cleanup, create_client, MESSAGES_COUNT, PARTITIONS_COUNT, PARTITION_ID, STREAM_ID, STREAM_NAME,
- TOPIC_ID, TOPIC_NAME,
+ MESSAGES_COUNT, PARTITION_ID, PARTITIONS_COUNT, STREAM_ID, STREAM_NAME, TOPIC_ID, TOPIC_NAME,
+ cleanup, create_client,
};
use bytes::Bytes;
use iggy::prelude::*;
-use integration::test_server::{assert_clean_system, login_root, ClientFactory};
+use integration::test_server::{ClientFactory, assert_clean_system, login_root};
use std::collections::HashMap;
use std::str::FromStr;
@@ -86,11 +86,13 @@ pub async fn run(client_factory: &dyn ClientFactory) {
.unwrap(),
"Value 1"
);
- assert!(headers
- .get(&HeaderKey::new("key 2").unwrap())
- .unwrap()
- .as_bool()
- .unwrap(),);
+ assert!(
+ headers
+ .get(&HeaderKey::new("key 2").unwrap())
+ .unwrap()
+ .as_bool()
+ .unwrap(),
+ );
assert_eq!(
headers
.get(&HeaderKey::new("key-3").unwrap())
diff --git a/core/integration/tests/server/scenarios/message_size_scenario.rs b/core/integration/tests/server/scenarios/message_size_scenario.rs
index 13214b3b..e1e320d1 100644
--- a/core/integration/tests/server/scenarios/message_size_scenario.rs
+++ b/core/integration/tests/server/scenarios/message_size_scenario.rs
@@ -18,7 +18,7 @@
use bytes::Bytes;
use iggy::prelude::*;
-use integration::test_server::{assert_clean_system, login_root, ClientFactory};
+use integration::test_server::{ClientFactory, assert_clean_system, login_root};
use std::collections::HashMap;
use std::str::FromStr;
@@ -155,7 +155,9 @@ async fn send_message_and_check_result(
}
}
MessageToSend::OfSizeWithHeaders(header_size, payload_size) => {
- println!("Sending message with header size = {header_size} and payload size = {payload_size}");
+ println!(
+ "Sending message with header size = {header_size} and payload size = {payload_size}"
+ );
match create_message(Some(header_size), payload_size) {
Ok(msg) => Ok(vec![msg]),
Err(e) => Err(e),
@@ -170,7 +172,9 @@ async fn send_message_and_check_result(
return;
}
_ => {
- panic!("Expected {expected_result:?} but message creation failed with {creation_error:?}");
+ panic!(
+ "Expected {expected_result:?} but message creation failed with {creation_error:?}"
+ );
}
}
}
diff --git a/core/integration/tests/server/scenarios/mod.rs b/core/integration/tests/server/scenarios/mod.rs
index dd773fdb..6341e39d 100644
--- a/core/integration/tests/server/scenarios/mod.rs
+++ b/core/integration/tests/server/scenarios/mod.rs
@@ -21,7 +21,7 @@ use iggy::prelude::ConsumerGroupDetails;
use iggy::prelude::ConsumerKind;
use iggy::prelude::Identifier;
use iggy::prelude::{ConsumerGroupClient, StreamClient};
-use integration::test_server::{delete_user, ClientFactory};
+use integration::test_server::{ClientFactory, delete_user};
pub mod consumer_group_join_scenario;
pub mod consumer_group_with_multiple_clients_polling_messages_scenario;
diff --git a/core/integration/tests/server/scenarios/stream_size_validation_scenario.rs b/core/integration/tests/server/scenarios/stream_size_validation_scenario.rs
index 1e8808c3..fcfcffd5 100644
--- a/core/integration/tests/server/scenarios/stream_size_validation_scenario.rs
+++ b/core/integration/tests/server/scenarios/stream_size_validation_scenario.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::server::scenarios::{create_client, PARTITIONS_COUNT, PARTITION_ID};
+use crate::server::scenarios::{PARTITION_ID, PARTITIONS_COUNT, create_client};
use bytes::Bytes;
use iggy::prelude::*;
-use integration::test_server::{assert_clean_system, login_root, ClientFactory};
+use integration::test_server::{ClientFactory, assert_clean_system, login_root};
use std::str::FromStr;
use tracing_subscriber::layer::SubscriberExt;
use tracing_subscriber::util::SubscriberInitExt;
diff --git a/core/integration/tests/server/scenarios/system_scenario.rs b/core/integration/tests/server/scenarios/system_scenario.rs
index 075e7160..1ae40637 100644
--- a/core/integration/tests/server/scenarios/system_scenario.rs
+++ b/core/integration/tests/server/scenarios/system_scenario.rs
@@ -17,13 +17,13 @@
*/
use crate::server::scenarios::{
- get_consumer_group, leave_consumer_group, CONSUMER_GROUP_ID, CONSUMER_GROUP_NAME, CONSUMER_ID,
- CONSUMER_KIND, MESSAGES_COUNT, PARTITIONS_COUNT, PARTITION_ID, STREAM_ID, STREAM_NAME,
- TOPIC_ID, TOPIC_NAME,
+ CONSUMER_GROUP_ID, CONSUMER_GROUP_NAME, CONSUMER_ID, CONSUMER_KIND, MESSAGES_COUNT,
+ PARTITION_ID, PARTITIONS_COUNT, STREAM_ID, STREAM_NAME, TOPIC_ID, TOPIC_NAME,
+ get_consumer_group, leave_consumer_group,
};
use bytes::Bytes;
use iggy::prelude::*;
-use integration::test_server::{assert_clean_system, ClientFactory};
+use integration::test_server::{ClientFactory, assert_clean_system};
use std::str::FromStr;
pub async fn run(client_factory: &dyn ClientFactory) {
diff --git a/core/integration/tests/server/scenarios/user_scenario.rs b/core/integration/tests/server/scenarios/user_scenario.rs
index d9e12f00..1903c932 100644
--- a/core/integration/tests/server/scenarios/user_scenario.rs
+++ b/core/integration/tests/server/scenarios/user_scenario.rs
@@ -17,13 +17,13 @@
*/
use crate::server::scenarios::create_client;
-use iggy::prelude::defaults::DEFAULT_ROOT_USERNAME;
use iggy::prelude::Identifier;
use iggy::prelude::PersonalAccessTokenExpiry;
use iggy::prelude::UserStatus;
+use iggy::prelude::defaults::DEFAULT_ROOT_USERNAME;
use iggy::prelude::{GlobalPermissions, Permissions};
-use iggy::prelude::{PersonalAccessTokenClient, SystemClient, UserClient, SEC_IN_MICRO};
-use integration::test_server::{assert_clean_system, login_root, ClientFactory};
+use iggy::prelude::{PersonalAccessTokenClient, SEC_IN_MICRO, SystemClient, UserClient};
+use integration::test_server::{ClientFactory, assert_clean_system, login_root};
pub async fn run(client_factory: &dyn ClientFactory) {
let client = create_client(client_factory).await;
diff --git a/core/integration/tests/state/file.rs b/core/integration/tests/state/file.rs
index 513067b4..02c6a38b 100644
--- a/core/integration/tests/state/file.rs
+++ b/core/integration/tests/state/file.rs
@@ -21,10 +21,10 @@ use bytes::Bytes;
use iggy::prelude::BytesSerializable;
use iggy_common::create_stream::CreateStream;
use iggy_common::create_user::CreateUser;
+use server::state::State;
use server::state::command::EntryCommand;
use server::state::entry::StateEntry;
use server::state::models::{CreateStreamWithId, CreateUserWithId};
-use server::state::State;
#[tokio::test]
async fn should_be_empty_given_initialized_state() {
diff --git a/core/integration/tests/state/system.rs b/core/integration/tests/state/system.rs
index 5529d059..6fc47b9d 100644
--- a/core/integration/tests/state/system.rs
+++ b/core/integration/tests/state/system.rs
@@ -25,13 +25,13 @@ use iggy_common::create_stream::CreateStream;
use iggy_common::create_topic::CreateTopic;
use iggy_common::create_user::CreateUser;
use iggy_common::delete_stream::DeleteStream;
+use server::state::State;
use server::state::command::EntryCommand;
use server::state::models::{
CreateConsumerGroupWithId, CreatePersonalAccessTokenWithHash, CreateStreamWithId,
CreateTopicWithId, CreateUserWithId,
};
use server::state::system::SystemState;
-use server::state::State;
#[tokio::test]
async fn should_be_initialized_based_on_state_entries() {
diff --git a/core/integration/tests/streaming/get_by_offset.rs b/core/integration/tests/streaming/get_by_offset.rs
index a1da4f19..5652391f 100644
--- a/core/integration/tests/streaming/get_by_offset.rs
+++ b/core/integration/tests/streaming/get_by_offset.rs
@@ -25,8 +25,8 @@ use server::streaming::partitions::partition::Partition;
use server::streaming::segments::IggyMessagesBatchMut;
use std::collections::HashMap;
use std::str::FromStr;
-use std::sync::atomic::{AtomicU32, AtomicU64};
use std::sync::Arc;
+use std::sync::atomic::{AtomicU32, AtomicU64};
use test_case::test_matrix;
/*
@@ -89,11 +89,7 @@ async fn test_get_messages_by_offset(
) {
println!(
"Running test with message_size: {}, batches: {:?}, messages_required_to_save: {}, segment_size: {}, cache_indexes: {}",
- message_size,
- batch_sizes,
- messages_required_to_save,
- segment_size,
- cache_indexes
+ message_size, batch_sizes, messages_required_to_save, segment_size, cache_indexes
);
let setup = TestSetup::init().await;
diff --git a/core/integration/tests/streaming/get_by_timestamp.rs b/core/integration/tests/streaming/get_by_timestamp.rs
index 665064f3..d68e4811 100644
--- a/core/integration/tests/streaming/get_by_timestamp.rs
+++ b/core/integration/tests/streaming/get_by_timestamp.rs
@@ -26,8 +26,8 @@ use server::streaming::partitions::partition::Partition;
use server::streaming::segments::IggyMessagesBatchMut;
use std::collections::HashMap;
use std::str::FromStr;
-use std::sync::atomic::{AtomicU32, AtomicU64};
use std::sync::Arc;
+use std::sync::atomic::{AtomicU32, AtomicU64};
use std::thread::sleep;
use test_case::test_matrix;
@@ -91,11 +91,7 @@ async fn test_get_messages_by_timestamp(
) {
println!(
"Running test with message_size: {}, batches: {:?}, messages_required_to_save: {}, segment_size: {}, cache_indexes: {}",
- message_size,
- batch_sizes,
- messages_required_to_save,
- segment_size,
- cache_indexes
+ message_size, batch_sizes, messages_required_to_save, segment_size, cache_indexes
);
let setup = TestSetup::init().await;
diff --git a/core/integration/tests/streaming/messages.rs b/core/integration/tests/streaming/messages.rs
index 0ad88bde..96e4c10a 100644
--- a/core/integration/tests/streaming/messages.rs
+++ b/core/integration/tests/streaming/messages.rs
@@ -25,8 +25,8 @@ use server::streaming::partitions::partition::Partition;
use server::streaming::segments::IggyMessagesBatchMut;
use std::collections::HashMap;
use std::str::FromStr;
-use std::sync::atomic::{AtomicU32, AtomicU64};
use std::sync::Arc;
+use std::sync::atomic::{AtomicU32, AtomicU64};
#[tokio::test]
async fn should_persist_messages_and_then_load_them_by_timestamp() {
diff --git a/core/integration/tests/streaming/partition.rs b/core/integration/tests/streaming/partition.rs
index cf2086fa..0a6c4a34 100644
--- a/core/integration/tests/streaming/partition.rs
+++ b/core/integration/tests/streaming/partition.rs
@@ -24,8 +24,8 @@ use iggy::prelude::Sizeable;
use server::state::system::PartitionState;
use server::streaming::partitions::partition::Partition;
use server::streaming::segments::*;
-use std::sync::atomic::{AtomicU32, AtomicU64};
use std::sync::Arc;
+use std::sync::atomic::{AtomicU32, AtomicU64};
use tokio::fs;
#[tokio::test]
diff --git a/core/integration/tests/streaming/segment.rs b/core/integration/tests/streaming/segment.rs
index 6ddbf549..3a6390a7 100644
--- a/core/integration/tests/streaming/segment.rs
+++ b/core/integration/tests/streaming/segment.rs
@@ -19,12 +19,12 @@
use crate::streaming::common::test_setup::TestSetup;
use crate::streaming::create_message;
use bytes::Bytes;
-use iggy::prelude::locking::IggySharedMutFn;
use iggy::prelude::CompressionAlgorithm;
use iggy::prelude::Confirmation;
use iggy::prelude::Identifier;
use iggy::prelude::IggyError;
use iggy::prelude::MaxTopicSize;
+use iggy::prelude::locking::IggySharedMutFn;
use iggy::prelude::*;
use server::configs::server::{DataMaintenanceConfig, PersonalAccessTokenConfig};
use server::configs::system::{PartitionConfig, SegmentConfig, SystemConfig};
@@ -34,8 +34,8 @@ use server::streaming::systems::system::System;
use std::fs::DirEntry;
use std::net::{Ipv4Addr, SocketAddr};
use std::str::FromStr;
-use std::sync::atomic::AtomicU64;
use std::sync::Arc;
+use std::sync::atomic::AtomicU64;
use std::time::Duration;
use tokio::fs;
use tokio::time::sleep;
@@ -423,10 +423,12 @@ async fn given_at_least_one_not_expired_message_segment_should_not_be_expired()
let nothing_expired_ts = IggyTimestamp::now();
- let first_message = vec![IggyMessage::builder()
- .payload(Bytes::from("expired"))
- .build()
- .expect("Failed to create message")];
+ let first_message = vec![
+ IggyMessage::builder()
+ .payload(Bytes::from("expired"))
+ .build()
+ .expect("Failed to create message"),
+ ];
let first_message_size = first_message[0].get_size_bytes().as_bytes_u32();
let first_batch = IggyMessagesBatchMut::from_messages(&first_message, first_message_size);
segment.append_batch(0, first_batch, None).await.unwrap();
@@ -434,10 +436,12 @@ async fn given_at_least_one_not_expired_message_segment_should_not_be_expired()
sleep(Duration::from_micros(message_expiry_us / 2)).await;
let first_message_expired_ts = IggyTimestamp::now();
- let second_message = vec![IggyMessage::builder()
- .payload(Bytes::from("not-expired"))
- .build()
- .expect("Failed to create message")];
+ let second_message = vec![
+ IggyMessage::builder()
+ .payload(Bytes::from("not-expired"))
+ .build()
+ .expect("Failed to create message"),
+ ];
let second_message_size = second_message[0].get_size_bytes().as_bytes_u32();
let second_batch = IggyMessagesBatchMut::from_messages(&second_message, second_message_size);
segment.append_batch(1, second_batch, None).await.unwrap();
diff --git a/core/integration/tests/streaming/topic.rs b/core/integration/tests/streaming/topic.rs
index e848964b..aea6f735 100644
--- a/core/integration/tests/streaming/topic.rs
+++ b/core/integration/tests/streaming/topic.rs
@@ -25,8 +25,8 @@ use server::streaming::polling_consumer::PollingConsumer;
use server::streaming::segments::IggyMessagesBatchMut;
use server::streaming::topics::topic::Topic;
use std::default::Default;
-use std::sync::atomic::{AtomicU32, AtomicU64};
use std::sync::Arc;
+use std::sync::atomic::{AtomicU32, AtomicU64};
use tokio::fs;
#[tokio::test]
diff --git a/core/integration/tests/streaming/topic_messages.rs b/core/integration/tests/streaming/topic_messages.rs
index 2956f18a..1247c82c 100644
--- a/core/integration/tests/streaming/topic_messages.rs
+++ b/core/integration/tests/streaming/topic_messages.rs
@@ -26,8 +26,8 @@ use server::streaming::topics::topic::Topic;
use server::streaming::utils::hash;
use std::collections::HashMap;
use std::str::from_utf8;
-use std::sync::atomic::{AtomicU32, AtomicU64};
use std::sync::Arc;
+use std::sync::atomic::{AtomicU32, AtomicU64};
#[tokio::test]
async fn assert_polling_messages() {
diff --git a/core/sdk/Cargo.toml b/core/sdk/Cargo.toml
index b8f22d06..c763af12 100644
--- a/core/sdk/Cargo.toml
+++ b/core/sdk/Cargo.toml
@@ -19,7 +19,7 @@
name = "iggy"
version = "0.7.0"
description = "Iggy is the persistent message streaming platform written in Rust, supporting QUIC, TCP and HTTP transport protocols, capable of processing millions of messages per second."
-edition = "2021"
+edition = "2024"
license = "Apache-2.0"
keywords = ["iggy", "messaging", "streaming"]
categories = ["command-line-utilities", "database", "network-programming"]
diff --git a/core/sdk/src/clients/consumer.rs b/core/sdk/src/clients/consumer.rs
index 4da73275..795f4edc 100644
--- a/core/sdk/src/clients/consumer.rs
+++ b/core/sdk/src/clients/consumer.rs
@@ -29,8 +29,8 @@ use iggy_common::{
use std::collections::VecDeque;
use std::future::Future;
use std::pin::Pin;
-use std::sync::atomic::{AtomicBool, AtomicU32, AtomicU64};
use std::sync::Arc;
+use std::sync::atomic::{AtomicBool, AtomicU32, AtomicU64};
use std::task::{Context, Poll};
use std::time::Duration;
use tokio::time;
@@ -294,7 +294,9 @@ impl IggyConsumer {
loop {
if stream_exists && topic_exists {
- info!("Stream: {stream_id} and topic: {topic_id} were found. Initializing consumer...",);
+ info!(
+ "Stream: {stream_id} and topic: {topic_id} were found. Initializing consumer...",
+ );
break;
}
@@ -304,7 +306,9 @@ impl IggyConsumer {
retries += 1;
if !stream_exists {
- warn!("Stream: {stream_id} does not exist. Retrying ({retries}/{init_retries}) in {interval}...",);
+ warn!(
+ "Stream: {stream_id} does not exist. Retrying ({retries}/{init_retries}) in {interval}...",
+ );
timer.tick().await;
stream_exists = client.get_stream(&stream_id).await?.is_some();
}
@@ -318,7 +322,9 @@ impl IggyConsumer {
break;
}
- warn!("Topic: {topic_id} does not exist in stream: {stream_id}. Retrying ({retries}/{init_retries}) in {interval}...",);
+ warn!(
+ "Topic: {topic_id} does not exist in stream: {stream_id}. Retrying ({retries}/{init_retries}) in {interval}...",
+ );
timer.tick().await;
}
@@ -358,7 +364,9 @@ impl IggyConsumer {
tokio::spawn(async move {
while let Ok((partition_id, offset)) = store_offset_receiver.recv_async().await {
- trace!("Received offset to store: {offset}, partition ID: {partition_id}, stream: {stream_id}, topic: {topic_id}");
+ trace!(
+ "Received offset to store: {offset}, partition ID: {partition_id}, stream: {stream_id}, topic: {topic_id}"
+ );
_ = Self::store_consumer_offset(
&client,
&consumer,
@@ -392,7 +400,9 @@ impl IggyConsumer {
last_stored_offsets: &DashMap<u32, AtomicU64>,
allow_replay: bool,
) -> Result<(), IggyError> {
- trace!("Storing offset: {offset} for consumer: {consumer}, partition ID: {partition_id}, topic: {topic_id}, stream: {stream_id}...");
+ trace!(
+ "Storing offset: {offset} for consumer: {consumer}, partition ID: {partition_id}, topic: {topic_id}, stream: {stream_id}..."
+ );
let stored_offset;
if let Some(offset_entry) = last_stored_offsets.get(&partition_id) {
stored_offset = offset_entry.load(ORDERING);
@@ -402,7 +412,9 @@ impl IggyConsumer {
}
if !allow_replay && (offset <= stored_offset && offset >= 1) {
- trace!("Offset: {offset} is less than or equal to the last stored offset: {stored_offset} for consumer: {consumer}, partition ID: {partition_id}, topic: {topic_id}, stream: {stream_id}. Skipping storing the offset.");
+ trace!(
+ "Offset: {offset} is less than or equal to the last stored offset: {stored_offset} for consumer: {consumer}, partition ID: {partition_id}, topic: {topic_id}, stream: {stream_id}. Skipping storing the offset."
+ );
return Ok(());
}
@@ -411,10 +423,14 @@ impl IggyConsumer {
.store_consumer_offset(consumer, stream_id, topic_id, Some(partition_id), offset)
.await
{
- error!("Failed to store offset: {offset} for consumer: {consumer}, partition ID: {partition_id}, topic: {topic_id}, stream: {stream_id}. {error}");
+ error!(
+ "Failed to store offset: {offset} for consumer: {consumer}, partition ID: {partition_id}, topic: {topic_id}, stream: {stream_id}. {error}"
+ );
return Err(error);
}
- trace!("Stored offset: {offset} for consumer: {consumer}, partition ID: {partition_id}, topic: {topic_id}, stream: {stream_id}.");
+ trace!(
+ "Stored offset: {offset} for consumer: {consumer}, partition ID: {partition_id}, topic: {topic_id}, stream: {stream_id}."
+ );
if let Some(last_offset_entry) = last_stored_offsets.get(&partition_id) {
last_offset_entry.store(offset, ORDERING);
} else {
@@ -454,7 +470,9 @@ impl IggyConsumer {
pub(crate) fn send_store_offset(&self, partition_id: u32, offset: u64) {
if let Err(error) = self.store_offset_sender.send((partition_id, offset)) {
- error!("Failed to send offset to store: {error}, please verify if `init()` on IggyConsumer object has been called.");
+ error!(
+ "Failed to send offset to store: {error}, please verify if `init()` on IggyConsumer object has been called."
+ );
}
}
@@ -549,7 +567,9 @@ impl IggyConsumer {
continue;
}
- info!("Rejoining consumer group: {consumer_name} for stream: {stream_id}, topic: {topic_id}...");
+ info!(
+ "Rejoining consumer group: {consumer_name} for stream: {stream_id}, topic: {topic_id}..."
+ );
if let Err(error) = Self::initialize_consumer_group(
client.clone(),
create_consumer_group_if_not_exists,
@@ -561,10 +581,14 @@ impl IggyConsumer {
)
.await
{
- error!("Failed to join consumer group: {consumer_name} for stream: {stream_id}, topic: {topic_id}. {error}");
+ error!(
+ "Failed to join consumer group: {consumer_name} for stream: {stream_id}, topic: {topic_id}. {error}"
+ );
continue;
}
- info!("Rejoined consumer group: {consumer_name} for stream: {stream_id}, topic: {topic_id}");
+ info!(
+ "Rejoined consumer group: {consumer_name} for stream: {stream_id}, topic: {topic_id}"
+ );
can_poll.store(true, ORDERING);
}
DiagnosticEvent::SignedOut => {
@@ -578,7 +602,7 @@ impl IggyConsumer {
fn create_poll_messages_future(
&self,
- ) -> impl Future<Output = Result<PolledMessages, IggyError>> {
+ ) -> impl Future<Output = Result<PolledMessages, IggyError>> + use<> {
let stream_id = self.stream_id.clone();
let topic_id = self.topic_id.clone();
let partition_id = self.partition_id;
@@ -673,9 +697,13 @@ impl IggyConsumer {
if !allow_replay
&& (has_consumed_offset && polled_messages.current_offset == consumed_offset)
{
- trace!("No new messages to consume in partition ID: {partition_id}, topic: {topic_id}, stream: {stream_id}, consumer: {consumer}");
+ trace!(
+ "No new messages to consume in partition ID: {partition_id}, topic: {topic_id}, stream: {stream_id}, consumer: {consumer}"
+ );
if auto_commit_enabled && stored_offset < consumed_offset {
- trace!("Auto-committing the offset: {consumed_offset} in partition ID: {partition_id}, topic: {topic_id}, stream: {stream_id}, consumer: {consumer}");
+ trace!(
+ "Auto-committing the offset: {consumed_offset} in partition ID: {partition_id}, topic: {topic_id}, stream: {stream_id}, consumer: {consumer}"
+ );
client
.read()
.await
@@ -732,7 +760,9 @@ impl IggyConsumer {
}
let remaining = interval - elapsed;
- trace!("Waiting for {remaining} microseconds before polling messages... {interval} - {elapsed} = {remaining}");
+ trace!(
+ "Waiting for {remaining} microseconds before polling messages... {interval} - {elapsed} = {remaining}"
+ );
sleep(Duration::from_micros(remaining)).await;
}
@@ -756,7 +786,9 @@ impl IggyConsumer {
};
let consumer_group_id = name.to_owned().try_into()?;
- trace!("Validating consumer group: {consumer_group_id} for topic: {topic_id}, stream: {stream_id}");
+ trace!(
+ "Validating consumer group: {consumer_group_id} for topic: {topic_id}, stream: {stream_id}"
+ );
if client
.get_consumer_group(&stream_id, &topic_id, &consumer_group_id)
.await?
@@ -770,19 +802,25 @@ impl IggyConsumer {
));
}
- info!("Creating consumer group: {consumer_group_id} for topic: {topic_id}, stream: {stream_id}");
+ info!(
+ "Creating consumer group: {consumer_group_id} for topic: {topic_id}, stream: {stream_id}"
+ );
client
.create_consumer_group(&stream_id, &topic_id, &name, id)
.await?;
}
- info!("Joining consumer group: {consumer_group_id} for topic: {topic_id}, stream: {stream_id}",);
+ info!(
+ "Joining consumer group: {consumer_group_id} for topic: {topic_id}, stream: {stream_id}",
+ );
if let Err(error) = client
.join_consumer_group(&stream_id, &topic_id, &consumer_group_id)
.await
{
joined_consumer_group.store(false, ORDERING);
- error!("Failed to join consumer group: {consumer_group_id} for topic: {topic_id}, stream: {stream_id}: {error}");
+ error!(
+ "Failed to join consumer group: {consumer_group_id} for topic: {topic_id}, stream: {stream_id}: {error}"
+ );
return Err(error);
}
@@ -876,7 +914,10 @@ impl Stream for IggyConsumer {
let payload = encryptor.decrypt(&message.payload);
if payload.is_err() {
self.poll_future = None;
- error!("Failed to decrypt the message payload at offset: {}, partition ID: {}", message.header.offset, partition_id);
+ error!(
+ "Failed to decrypt the message payload at offset: {}, partition ID: {}",
+ message.header.offset, partition_id
+ );
let error = payload.unwrap_err();
return Poll::Ready(Some(Err(error)));
}
diff --git a/core/sdk/src/clients/producer.rs b/core/sdk/src/clients/producer.rs
index 9ffb01a6..7e9443c7 100644
--- a/core/sdk/src/clients/producer.rs
+++ b/core/sdk/src/clients/producer.rs
@@ -25,10 +25,10 @@ use iggy_common::{
CompressionAlgorithm, DiagnosticEvent, EncryptorKind, IdKind, Identifier, IggyDuration,
IggyError, IggyExpiry, IggyMessage, IggyTimestamp, MaxTopicSize, Partitioner, Partitioning,
};
-use std::sync::atomic::{AtomicBool, AtomicU64};
use std::sync::Arc;
+use std::sync::atomic::{AtomicBool, AtomicU64};
use std::time::Duration;
-use tokio::time::{sleep, Interval};
+use tokio::time::{Interval, sleep};
use tracing::{error, info, trace, warn};
unsafe impl Send for IggyProducer {}
@@ -370,7 +370,9 @@ impl IggyProducer {
}
let remaining = interval - elapsed;
- trace!("Waiting for {remaining} microseconds before sending messages... {interval} - {elapsed} = {remaining}");
+ trace!(
+ "Waiting for {remaining} microseconds before sending messages... {interval} - {elapsed} = {remaining}"
+ );
sleep(Duration::from_micros(remaining)).await;
}
diff --git a/core/sdk/src/http/binary_consumer_groups.rs b/core/sdk/src/http/binary_consumer_groups.rs
index ab7ad58f..f27b96c2 100644
--- a/core/sdk/src/http/binary_consumer_groups.rs
+++ b/core/sdk/src/http/binary_consumer_groups.rs
@@ -21,8 +21,8 @@ use crate::http::http_transport::HttpTransport;
use crate::prelude::IggyError;
use async_trait::async_trait;
use iggy_binary_protocol::ConsumerGroupClient;
-use iggy_common::create_consumer_group::CreateConsumerGroup;
use iggy_common::Identifier;
+use iggy_common::create_consumer_group::CreateConsumerGroup;
use iggy_common::{ConsumerGroup, ConsumerGroupDetails};
#[async_trait]
diff --git a/core/sdk/src/http/binary_personal_access_tokens.rs b/core/sdk/src/http/binary_personal_access_tokens.rs
index cd3b402d..7c2fb3f9 100644
--- a/core/sdk/src/http/binary_personal_access_tokens.rs
+++ b/core/sdk/src/http/binary_personal_access_tokens.rs
@@ -21,10 +21,10 @@ use crate::http::http_transport::HttpTransport;
use crate::prelude::IggyError;
use async_trait::async_trait;
use iggy_binary_protocol::PersonalAccessTokenClient;
-use iggy_common::create_personal_access_token::CreatePersonalAccessToken;
-use iggy_common::login_with_personal_access_token::LoginWithPersonalAccessToken;
use iggy_common::IdentityInfo;
use iggy_common::PersonalAccessTokenExpiry;
+use iggy_common::create_personal_access_token::CreatePersonalAccessToken;
+use iggy_common::login_with_personal_access_token::LoginWithPersonalAccessToken;
use iggy_common::{PersonalAccessTokenInfo, RawPersonalAccessToken};
const PATH: &str = "/personal-access-tokens";
diff --git a/core/sdk/src/http/binary_system.rs b/core/sdk/src/http/binary_system.rs
index e08ac7f6..fe537ca8 100644
--- a/core/sdk/src/http/binary_system.rs
+++ b/core/sdk/src/http/binary_system.rs
@@ -21,9 +21,9 @@ use crate::http::http_transport::HttpTransport;
use crate::prelude::{IggyDuration, IggyError};
use async_trait::async_trait;
use iggy_binary_protocol::SystemClient;
-use iggy_common::get_snapshot::GetSnapshot;
use iggy_common::Snapshot;
use iggy_common::Stats;
+use iggy_common::get_snapshot::GetSnapshot;
use iggy_common::{ClientInfo, ClientInfoDetails};
use iggy_common::{SnapshotCompression, SystemSnapshotType};
diff --git a/core/sdk/src/http/http_client.rs b/core/sdk/src/http/http_client.rs
index 4d83607b..8ff9ec25 100644
--- a/core/sdk/src/http/http_client.rs
+++ b/core/sdk/src/http/http_client.rs
@@ -21,14 +21,14 @@ use crate::http::http_transport::HttpTransport;
use crate::prelude::Client;
use crate::prelude::IggyDuration;
use crate::prelude::IggyError;
-use async_broadcast::{broadcast, Receiver, Sender};
+use async_broadcast::{Receiver, Sender, broadcast};
use async_trait::async_trait;
-use iggy_common::locking::{IggySharedMut, IggySharedMutFn};
use iggy_common::DiagnosticEvent;
use iggy_common::IdentityInfo;
+use iggy_common::locking::{IggySharedMut, IggySharedMutFn};
use reqwest::{Response, StatusCode, Url};
use reqwest_middleware::{ClientBuilder, ClientWithMiddleware};
-use reqwest_retry::{policies::ExponentialBackoff, RetryTransientMiddleware};
+use reqwest_retry::{RetryTransientMiddleware, policies::ExponentialBackoff};
use serde::Serialize;
use std::ops::Deref;
use std::str::FromStr;
diff --git a/core/sdk/src/prelude.rs b/core/sdk/src/prelude.rs
index ea92bb7f..3d87cc82 100644
--- a/core/sdk/src/prelude.rs
+++ b/core/sdk/src/prelude.rs
@@ -50,22 +50,23 @@ pub use iggy_binary_protocol::{
};
//
pub use iggy_common::{
- defaults, locking, Aes256GcmEncryptor, Args, ArgsOptional, AutoLogin, BytesSerializable,
- CacheMetrics, CacheMetricsKey, ClientError, ClientInfoDetails, CompressionAlgorithm,
- Confirmation, Consumer, ConsumerGroupDetails, ConsumerKind, EncryptorKind, FlushUnsavedBuffer,
- GlobalPermissions, HeaderKey, HeaderValue, IdKind, Identifier, IdentityInfo, IggyByteSize,
- IggyDuration, IggyError, IggyExpiry, IggyIndexView, IggyMessage, IggyMessageHeader,
- IggyMessageHeaderView, IggyMessageView, IggyMessageViewIterator, IggyTimestamp, MaxTopicSize,
- Partition, Partitioner, Partitioning, Permissions, PersonalAccessTokenExpiry, PollMessages,
- PolledMessages, PollingKind, PollingStrategy, SendMessages, Sizeable, SnapshotCompression,
- Stats, Stream, StreamPermissions, SystemSnapshotType, TcpClientConfig, TcpClientConfigBuilder,
+ Aes256GcmEncryptor, Args, ArgsOptional, AutoLogin, BytesSerializable, CacheMetrics,
+ CacheMetricsKey, ClientError, ClientInfoDetails, CompressionAlgorithm, Confirmation, Consumer,
+ ConsumerGroupDetails, ConsumerKind, EncryptorKind, FlushUnsavedBuffer, GlobalPermissions,
+ HeaderKey, HeaderValue, IdKind, Identifier, IdentityInfo, IggyByteSize, IggyDuration,
+ IggyError, IggyExpiry, IggyIndexView, IggyMessage, IggyMessageHeader, IggyMessageHeaderView,
+ IggyMessageView, IggyMessageViewIterator, IggyTimestamp, MaxTopicSize, Partition, Partitioner,
+ Partitioning, Permissions, PersonalAccessTokenExpiry, PollMessages, PolledMessages,
+ PollingKind, PollingStrategy, SendMessages, Sizeable, SnapshotCompression, Stats, Stream,
+ StreamPermissions, SystemSnapshotType, TcpClientConfig, TcpClientConfigBuilder,
TcpClientReconnectionConfig, Topic, TopicPermissions, UserId, UserStatus, Validatable,
+ defaults, locking,
};
pub use iggy_common::{
- defaults::{DEFAULT_ROOT_PASSWORD, DEFAULT_ROOT_USERNAME, DEFAULT_ROOT_USER_ID},
- IGGY_MESSAGE_CHECKSUM_OFFSET_RANGE, IGGY_MESSAGE_HEADERS_LENGTH_OFFSET_RANGE,
- IGGY_MESSAGE_HEADER_SIZE, IGGY_MESSAGE_ID_OFFSET_RANGE, IGGY_MESSAGE_OFFSET_OFFSET_RANGE,
- IGGY_MESSAGE_ORIGIN_TIMESTAMP_OFFSET_RANGE, IGGY_MESSAGE_PAYLOAD_LENGTH_OFFSET_RANGE,
- IGGY_MESSAGE_TIMESTAMP_OFFSET_RANGE, INDEX_SIZE, MAX_PAYLOAD_SIZE, MAX_USER_HEADERS_SIZE,
- SEC_IN_MICRO,
+ IGGY_MESSAGE_CHECKSUM_OFFSET_RANGE, IGGY_MESSAGE_HEADER_SIZE,
+ IGGY_MESSAGE_HEADERS_LENGTH_OFFSET_RANGE, IGGY_MESSAGE_ID_OFFSET_RANGE,
+ IGGY_MESSAGE_OFFSET_OFFSET_RANGE, IGGY_MESSAGE_ORIGIN_TIMESTAMP_OFFSET_RANGE,
+ IGGY_MESSAGE_PAYLOAD_LENGTH_OFFSET_RANGE, IGGY_MESSAGE_TIMESTAMP_OFFSET_RANGE, INDEX_SIZE,
+ MAX_PAYLOAD_SIZE, MAX_USER_HEADERS_SIZE, SEC_IN_MICRO,
+ defaults::{DEFAULT_ROOT_PASSWORD, DEFAULT_ROOT_USER_ID, DEFAULT_ROOT_USERNAME},
};
diff --git a/core/sdk/src/quic/quick_client.rs b/core/sdk/src/quic/quick_client.rs
index ab0663dc..2977c0a2 100644
--- a/core/sdk/src/quic/quick_client.rs
+++ b/core/sdk/src/quic/quick_client.rs
@@ -26,7 +26,7 @@ use crate::prelude::IggyError;
use crate::prelude::IggyTimestamp;
use crate::quic::quick_config::QuicClientConfig;
use crate::quic::skip_server_verification::SkipServerVerification;
-use async_broadcast::{broadcast, Receiver, Sender};
+use async_broadcast::{Receiver, Sender, broadcast};
use async_trait::async_trait;
use bytes::Bytes;
use iggy_common::{ClientState, Command, Credentials, DiagnosticEvent};
@@ -356,7 +356,10 @@ impl QuicClient {
Credentials::UsernamePassword(username, password) => {
self.login_user(username, password).await?;
self.publish_event(DiagnosticEvent::SignedIn).await;
- info!("{NAME} client: {} has signed in with the user credentials, username: {username}", self.config.client_address);
+ info!(
+ "{NAME} client: {} has signed in with the user credentials, username: {username}",
+ self.config.client_address
+ );
Ok(())
}
Credentials::PersonalAccessToken(token) => {
@@ -507,7 +510,10 @@ fn configure(config: &QuicClientConfig) -> Result<ClientConfig, IggyError> {
if CryptoProvider::get_default().is_none() {
if let Err(e) = rustls::crypto::ring::default_provider().install_default() {
- warn!("Failed to install rustls crypto provider. Error: {:?}. This may be normal if another thread installed it first.", e);
+ warn!(
+ "Failed to install rustls crypto provider. Error: {:?}. This may be normal if another thread installed it first.",
+ e
+ );
}
}
let mut client_config = match config.validate_certificate {
diff --git a/core/sdk/src/stream_builder/build/build_stream_topic.rs b/core/sdk/src/stream_builder/build/build_stream_topic.rs
index a5442870..2a8e0e73 100644
--- a/core/sdk/src/stream_builder/build/build_stream_topic.rs
+++ b/core/sdk/src/stream_builder/build/build_stream_topic.rs
@@ -73,8 +73,10 @@ pub(crate) async fn build_iggy_stream_topic_if_not_exists(
{
trace!("Check if topic should be created.");
if !config.create_topic_if_not_exists() {
- warn!("Topic {topic_name} for stream {stream_name} does not exists and create topic is disabled.\
- If you want to create the topic automatically, please set create_topic_if_not_exists to true.");
+ warn!(
+ "Topic {topic_name} for stream {stream_name} does not exists and create topic is disabled.\
+ If you want to create the topic automatically, please set create_topic_if_not_exists to true."
+ );
return Ok(());
}
diff --git a/core/sdk/src/stream_builder/iggy_stream.rs b/core/sdk/src/stream_builder/iggy_stream.rs
index e552836e..df759824 100644
--- a/core/sdk/src/stream_builder/iggy_stream.rs
+++ b/core/sdk/src/stream_builder/iggy_stream.rs
@@ -20,7 +20,7 @@ use crate::clients::client::IggyClient;
use crate::clients::consumer::IggyConsumer;
use crate::clients::producer::IggyProducer;
use crate::prelude::{IggyError, SystemClient};
-use crate::stream_builder::{build, IggyStreamConfig};
+use crate::stream_builder::{IggyStreamConfig, build};
use tracing::trace;
#[derive(Debug, Default, Clone, Eq, PartialEq)]
diff --git a/core/sdk/src/stream_builder/iggy_stream_consumer.rs b/core/sdk/src/stream_builder/iggy_stream_consumer.rs
index 6772a632..1b972a6f 100644
--- a/core/sdk/src/stream_builder/iggy_stream_consumer.rs
+++ b/core/sdk/src/stream_builder/iggy_stream_consumer.rs
@@ -19,7 +19,7 @@
use crate::clients::client::IggyClient;
use crate::clients::consumer::IggyConsumer;
use crate::prelude::{IggyError, SystemClient};
-use crate::stream_builder::{build, IggyConsumerConfig};
+use crate::stream_builder::{IggyConsumerConfig, build};
use tracing::trace;
#[derive(Debug, Default, Clone, Eq, PartialEq)]
diff --git a/core/sdk/src/stream_builder/iggy_stream_producer.rs b/core/sdk/src/stream_builder/iggy_stream_producer.rs
index 2d4a81a7..31669518 100644
--- a/core/sdk/src/stream_builder/iggy_stream_producer.rs
+++ b/core/sdk/src/stream_builder/iggy_stream_producer.rs
@@ -19,7 +19,7 @@
use crate::clients::client::IggyClient;
use crate::clients::producer::IggyProducer;
use crate::prelude::{IggyError, SystemClient};
-use crate::stream_builder::{build, IggyProducerConfig};
+use crate::stream_builder::{IggyProducerConfig, build};
use tracing::trace;
#[derive(Debug, Default, Clone, Eq, PartialEq)]
diff --git a/core/sdk/src/tcp/tcp_client.rs b/core/sdk/src/tcp/tcp_client.rs
index fd7aa093..8d0d556a 100644
--- a/core/sdk/src/tcp/tcp_client.rs
+++ b/core/sdk/src/tcp/tcp_client.rs
@@ -21,7 +21,7 @@ use crate::prelude::TcpClientConfig;
use crate::tcp::tcp_connection_stream::TcpConnectionStream;
use crate::tcp::tcp_connection_stream_kind::ConnectionStreamKind;
use crate::tcp::tcp_tls_connection_stream::TcpTlsConnectionStream;
-use async_broadcast::{broadcast, Receiver, Sender};
+use async_broadcast::{Receiver, Sender, broadcast};
use async_trait::async_trait;
use bytes::{BufMut, Bytes, BytesMut};
use iggy_binary_protocol::{BinaryClient, BinaryTransport, PersonalAccessTokenClient, UserClient};
@@ -29,7 +29,7 @@ use iggy_common::{
AutoLogin, ClientState, Command, ConnectionString, Credentials, DiagnosticEvent, IggyDuration,
IggyError, IggyErrorDiscriminants, IggyTimestamp,
};
-use rustls::pki_types::{pem::PemObject, CertificateDer, ServerName};
+use rustls::pki_types::{CertificateDer, ServerName, pem::PemObject};
use std::net::SocketAddr;
use std::str::FromStr;
use std::sync::Arc;
@@ -410,12 +410,16 @@ impl TcpClient {
match credentials {
Credentials::UsernamePassword(username, password) => {
self.login_user(username, password).await?;
- info!("{NAME} client: {client_address} has signed in with the user credentials, username: {username}",);
+ info!(
+ "{NAME} client: {client_address} has signed in with the user credentials, username: {username}",
+ );
Ok(())
}
Credentials::PersonalAccessToken(token) => {
self.login_with_personal_access_token(token).await?;
- info!("{NAME} client: {client_address} has signed in with a personal access token.",);
+ info!(
+ "{NAME} client: {client_address} has signed in with a personal access token.",
+ );
Ok(())
}
}
diff --git a/core/sdk/src/tcp/tcp_connection_stream.rs b/core/sdk/src/tcp/tcp_connection_stream.rs
index 4c30ca57..8cdb3b54 100644
--- a/core/sdk/src/tcp/tcp_connection_stream.rs
+++ b/core/sdk/src/tcp/tcp_connection_stream.rs
@@ -21,8 +21,8 @@ use async_trait::async_trait;
use iggy_common::IggyError;
use std::net::SocketAddr;
use tokio::io::{AsyncReadExt, AsyncWriteExt, BufReader, BufWriter};
-use tokio::net::tcp::{OwnedReadHalf, OwnedWriteHalf};
use tokio::net::TcpStream;
+use tokio::net::tcp::{OwnedReadHalf, OwnedWriteHalf};
use tracing::error;
#[derive(Debug)]
diff --git a/core/server/Cargo.toml b/core/server/Cargo.toml
index e3ba0235..e507ed47 100644
--- a/core/server/Cargo.toml
+++ b/core/server/Cargo.toml
@@ -18,7 +18,7 @@
[package]
name = "server"
version = "0.5.0"
-edition = "2021"
+edition = "2024"
build = "src/build.rs"
license = "Apache-2.0"
diff --git a/core/server/src/binary/handlers/consumer_groups/create_consumer_group_handler.rs b/core/server/src/binary/handlers/consumer_groups/create_consumer_group_handler.rs
index dfd14fb5..f4ce0c0e 100644
--- a/core/server/src/binary/handlers/consumer_groups/create_consumer_group_handler.rs
+++ b/core/server/src/binary/handlers/consumer_groups/create_consumer_group_handler.rs
@@ -26,8 +26,8 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::create_consumer_group::CreateConsumerGroup;
use iggy_common::IggyError;
+use iggy_common::create_consumer_group::CreateConsumerGroup;
use tracing::{debug, instrument};
impl ServerCommandHandler for CreateConsumerGroup {
diff --git a/core/server/src/binary/handlers/consumer_groups/delete_consumer_group_handler.rs b/core/server/src/binary/handlers/consumer_groups/delete_consumer_group_handler.rs
index 17f817d2..8e86777d 100644
--- a/core/server/src/binary/handlers/consumer_groups/delete_consumer_group_handler.rs
+++ b/core/server/src/binary/handlers/consumer_groups/delete_consumer_group_handler.rs
@@ -24,8 +24,8 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::delete_consumer_group::DeleteConsumerGroup;
use iggy_common::IggyError;
+use iggy_common::delete_consumer_group::DeleteConsumerGroup;
use tracing::{debug, instrument};
impl ServerCommandHandler for DeleteConsumerGroup {
diff --git a/core/server/src/binary/handlers/consumer_groups/get_consumer_group_handler.rs b/core/server/src/binary/handlers/consumer_groups/get_consumer_group_handler.rs
index 2c865138..694ac38c 100644
--- a/core/server/src/binary/handlers/consumer_groups/get_consumer_group_handler.rs
+++ b/core/server/src/binary/handlers/consumer_groups/get_consumer_group_handler.rs
@@ -23,8 +23,8 @@ use crate::binary::sender::SenderKind;
use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
-use iggy_common::get_consumer_group::GetConsumerGroup;
use iggy_common::IggyError;
+use iggy_common::get_consumer_group::GetConsumerGroup;
use tracing::debug;
impl ServerCommandHandler for GetConsumerGroup {
diff --git a/core/server/src/binary/handlers/consumer_groups/get_consumer_groups_handler.rs b/core/server/src/binary/handlers/consumer_groups/get_consumer_groups_handler.rs
index 56d9c11d..7ff6389f 100644
--- a/core/server/src/binary/handlers/consumer_groups/get_consumer_groups_handler.rs
+++ b/core/server/src/binary/handlers/consumer_groups/get_consumer_groups_handler.rs
@@ -25,8 +25,8 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::get_consumer_groups::GetConsumerGroups;
use iggy_common::IggyError;
+use iggy_common::get_consumer_groups::GetConsumerGroups;
use tracing::debug;
impl ServerCommandHandler for GetConsumerGroups {
diff --git a/core/server/src/binary/handlers/consumer_groups/join_consumer_group_handler.rs b/core/server/src/binary/handlers/consumer_groups/join_consumer_group_handler.rs
index 4052cfc8..3d01d41a 100644
--- a/core/server/src/binary/handlers/consumer_groups/join_consumer_group_handler.rs
+++ b/core/server/src/binary/handlers/consumer_groups/join_consumer_group_handler.rs
@@ -23,8 +23,8 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::join_consumer_group::JoinConsumerGroup;
use iggy_common::IggyError;
+use iggy_common::join_consumer_group::JoinConsumerGroup;
use tracing::{debug, instrument};
impl ServerCommandHandler for JoinConsumerGroup {
diff --git a/core/server/src/binary/handlers/consumer_groups/leave_consumer_group_handler.rs b/core/server/src/binary/handlers/consumer_groups/leave_consumer_group_handler.rs
index d041ae85..e094531d 100644
--- a/core/server/src/binary/handlers/consumer_groups/leave_consumer_group_handler.rs
+++ b/core/server/src/binary/handlers/consumer_groups/leave_consumer_group_handler.rs
@@ -23,8 +23,8 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::leave_consumer_group::LeaveConsumerGroup;
use iggy_common::IggyError;
+use iggy_common::leave_consumer_group::LeaveConsumerGroup;
use tracing::{debug, instrument};
impl ServerCommandHandler for LeaveConsumerGroup {
diff --git a/core/server/src/binary/handlers/consumer_offsets/delete_consumer_offset_handler.rs b/core/server/src/binary/handlers/consumer_offsets/delete_consumer_offset_handler.rs
index 43032dad..f639223d 100644
--- a/core/server/src/binary/handlers/consumer_offsets/delete_consumer_offset_handler.rs
+++ b/core/server/src/binary/handlers/consumer_offsets/delete_consumer_offset_handler.rs
@@ -24,8 +24,8 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::delete_consumer_offset::DeleteConsumerOffset;
use iggy_common::IggyError;
+use iggy_common::delete_consumer_offset::DeleteConsumerOffset;
use tracing::debug;
impl ServerCommandHandler for DeleteConsumerOffset {
diff --git a/core/server/src/binary/handlers/consumer_offsets/get_consumer_offset_handler.rs b/core/server/src/binary/handlers/consumer_offsets/get_consumer_offset_handler.rs
index 7a7afa7b..dbe119ff 100644
--- a/core/server/src/binary/handlers/consumer_offsets/get_consumer_offset_handler.rs
+++ b/core/server/src/binary/handlers/consumer_offsets/get_consumer_offset_handler.rs
@@ -23,8 +23,8 @@ use crate::binary::sender::SenderKind;
use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
-use iggy_common::get_consumer_offset::GetConsumerOffset;
use iggy_common::IggyError;
+use iggy_common::get_consumer_offset::GetConsumerOffset;
use tracing::debug;
impl ServerCommandHandler for GetConsumerOffset {
diff --git a/core/server/src/binary/handlers/consumer_offsets/store_consumer_offset_handler.rs b/core/server/src/binary/handlers/consumer_offsets/store_consumer_offset_handler.rs
index 2718054b..c0343bcb 100644
--- a/core/server/src/binary/handlers/consumer_offsets/store_consumer_offset_handler.rs
+++ b/core/server/src/binary/handlers/consumer_offsets/store_consumer_offset_handler.rs
@@ -24,8 +24,8 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::store_consumer_offset::StoreConsumerOffset;
use iggy_common::IggyError;
+use iggy_common::store_consumer_offset::StoreConsumerOffset;
use tracing::debug;
impl ServerCommandHandler for StoreConsumerOffset {
diff --git a/core/server/src/binary/handlers/messages/send_messages_handler.rs b/core/server/src/binary/handlers/messages/send_messages_handler.rs
index 03396a49..17821a16 100644
--- a/core/server/src/binary/handlers/messages/send_messages_handler.rs
+++ b/core/server/src/binary/handlers/messages/send_messages_handler.rs
@@ -23,9 +23,9 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use crate::streaming::utils::PooledBuffer;
use anyhow::Result;
+use iggy_common::INDEX_SIZE;
use iggy_common::Identifier;
use iggy_common::Sizeable;
-use iggy_common::INDEX_SIZE;
use iggy_common::{IggyError, Partitioning, SendMessages, Validatable};
use tracing::instrument;
diff --git a/core/server/src/binary/handlers/partitions/create_partitions_handler.rs b/core/server/src/binary/handlers/partitions/create_partitions_handler.rs
index bdf9fea8..87d1782e 100644
--- a/core/server/src/binary/handlers/partitions/create_partitions_handler.rs
+++ b/core/server/src/binary/handlers/partitions/create_partitions_handler.rs
@@ -24,8 +24,8 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::create_partitions::CreatePartitions;
use iggy_common::IggyError;
+use iggy_common::create_partitions::CreatePartitions;
use tracing::{debug, instrument};
impl ServerCommandHandler for CreatePartitions {
diff --git a/core/server/src/binary/handlers/partitions/delete_partitions_handler.rs b/core/server/src/binary/handlers/partitions/delete_partitions_handler.rs
index ff5c2558..4063eaec 100644
--- a/core/server/src/binary/handlers/partitions/delete_partitions_handler.rs
+++ b/core/server/src/binary/handlers/partitions/delete_partitions_handler.rs
@@ -24,8 +24,8 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::delete_partitions::DeletePartitions;
use iggy_common::IggyError;
+use iggy_common::delete_partitions::DeletePartitions;
use tracing::{debug, instrument};
impl ServerCommandHandler for DeletePartitions {
diff --git a/core/server/src/binary/handlers/personal_access_tokens/create_personal_access_token_handler.rs b/core/server/src/binary/handlers/personal_access_tokens/create_personal_access_token_handler.rs
index 47824817..b43103f3 100644
--- a/core/server/src/binary/handlers/personal_access_tokens/create_personal_access_token_handler.rs
+++ b/core/server/src/binary/handlers/personal_access_tokens/create_personal_access_token_handler.rs
@@ -27,8 +27,8 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::create_personal_access_token::CreatePersonalAccessToken;
use iggy_common::IggyError;
+use iggy_common::create_personal_access_token::CreatePersonalAccessToken;
use tracing::{debug, instrument};
impl ServerCommandHandler for CreatePersonalAccessToken {
diff --git a/core/server/src/binary/handlers/personal_access_tokens/delete_personal_access_token_handler.rs b/core/server/src/binary/handlers/personal_access_tokens/delete_personal_access_token_handler.rs
index eb3f9dc7..4ba2de04 100644
--- a/core/server/src/binary/handlers/personal_access_tokens/delete_personal_access_token_handler.rs
+++ b/core/server/src/binary/handlers/personal_access_tokens/delete_personal_access_token_handler.rs
@@ -24,8 +24,8 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::delete_personal_access_token::DeletePersonalAccessToken;
use iggy_common::IggyError;
+use iggy_common::delete_personal_access_token::DeletePersonalAccessToken;
use tracing::{debug, instrument};
impl ServerCommandHandler for DeletePersonalAccessToken {
diff --git a/core/server/src/binary/handlers/personal_access_tokens/get_personal_access_tokens_handler.rs b/core/server/src/binary/handlers/personal_access_tokens/get_personal_access_tokens_handler.rs
index 6819343d..08d7c6e6 100644
--- a/core/server/src/binary/handlers/personal_access_tokens/get_personal_access_tokens_handler.rs
+++ b/core/server/src/binary/handlers/personal_access_tokens/get_personal_access_tokens_handler.rs
@@ -24,8 +24,8 @@ use crate::binary::sender::SenderKind;
use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use error_set::ErrContext;
-use iggy_common::get_personal_access_tokens::GetPersonalAccessTokens;
use iggy_common::IggyError;
+use iggy_common::get_personal_access_tokens::GetPersonalAccessTokens;
use tracing::debug;
impl ServerCommandHandler for GetPersonalAccessTokens {
diff --git a/core/server/src/binary/handlers/personal_access_tokens/login_with_personal_access_token_handler.rs b/core/server/src/binary/handlers/personal_access_tokens/login_with_personal_access_token_handler.rs
index 270c762e..33a4dee2 100644
--- a/core/server/src/binary/handlers/personal_access_tokens/login_with_personal_access_token_handler.rs
+++ b/core/server/src/binary/handlers/personal_access_tokens/login_with_personal_access_token_handler.rs
@@ -24,8 +24,8 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::login_with_personal_access_token::LoginWithPersonalAccessToken;
use iggy_common::IggyError;
+use iggy_common::login_with_personal_access_token::LoginWithPersonalAccessToken;
use tracing::{debug, instrument};
impl ServerCommandHandler for LoginWithPersonalAccessToken {
diff --git a/core/server/src/binary/handlers/segments/delete_segments_handler.rs b/core/server/src/binary/handlers/segments/delete_segments_handler.rs
index 71f76b1a..b0c03090 100644
--- a/core/server/src/binary/handlers/segments/delete_segments_handler.rs
+++ b/core/server/src/binary/handlers/segments/delete_segments_handler.rs
@@ -21,8 +21,8 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::delete_segments::DeleteSegments;
use iggy_common::IggyError;
+use iggy_common::delete_segments::DeleteSegments;
use tracing::{debug, instrument};
#[instrument(skip_all, name = "trace_delete_segments", fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string(), iggy_topic_id = command.topic_id.as_string()))]
diff --git a/core/server/src/binary/handlers/streams/create_stream_handler.rs b/core/server/src/binary/handlers/streams/create_stream_handler.rs
index f919de40..9b139f4d 100644
--- a/core/server/src/binary/handlers/streams/create_stream_handler.rs
+++ b/core/server/src/binary/handlers/streams/create_stream_handler.rs
@@ -26,8 +26,8 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::create_stream::CreateStream;
use iggy_common::IggyError;
+use iggy_common::create_stream::CreateStream;
use tracing::{debug, instrument};
impl ServerCommandHandler for CreateStream {
diff --git a/core/server/src/binary/handlers/streams/delete_stream_handler.rs b/core/server/src/binary/handlers/streams/delete_stream_handler.rs
index 464f5e2f..f480c0ea 100644
--- a/core/server/src/binary/handlers/streams/delete_stream_handler.rs
+++ b/core/server/src/binary/handlers/streams/delete_stream_handler.rs
@@ -24,8 +24,8 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::delete_stream::DeleteStream;
use iggy_common::IggyError;
+use iggy_common::delete_stream::DeleteStream;
use tracing::{debug, instrument};
impl ServerCommandHandler for DeleteStream {
diff --git a/core/server/src/binary/handlers/streams/get_stream_handler.rs b/core/server/src/binary/handlers/streams/get_stream_handler.rs
index af4c26f4..12e015af 100644
--- a/core/server/src/binary/handlers/streams/get_stream_handler.rs
+++ b/core/server/src/binary/handlers/streams/get_stream_handler.rs
@@ -23,8 +23,8 @@ use crate::binary::sender::SenderKind;
use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
-use iggy_common::get_stream::GetStream;
use iggy_common::IggyError;
+use iggy_common::get_stream::GetStream;
use tracing::debug;
impl ServerCommandHandler for GetStream {
diff --git a/core/server/src/binary/handlers/streams/get_streams_handler.rs b/core/server/src/binary/handlers/streams/get_streams_handler.rs
index 5511212e..fa08bc13 100644
--- a/core/server/src/binary/handlers/streams/get_streams_handler.rs
+++ b/core/server/src/binary/handlers/streams/get_streams_handler.rs
@@ -25,8 +25,8 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::get_streams::GetStreams;
use iggy_common::IggyError;
+use iggy_common::get_streams::GetStreams;
use tracing::debug;
impl ServerCommandHandler for GetStreams {
diff --git a/core/server/src/binary/handlers/streams/purge_stream_handler.rs b/core/server/src/binary/handlers/streams/purge_stream_handler.rs
index 103f0044..dd37e155 100644
--- a/core/server/src/binary/handlers/streams/purge_stream_handler.rs
+++ b/core/server/src/binary/handlers/streams/purge_stream_handler.rs
@@ -24,8 +24,8 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::purge_stream::PurgeStream;
use iggy_common::IggyError;
+use iggy_common::purge_stream::PurgeStream;
use tracing::{debug, instrument};
impl ServerCommandHandler for PurgeStream {
diff --git a/core/server/src/binary/handlers/streams/update_stream_handler.rs b/core/server/src/binary/handlers/streams/update_stream_handler.rs
index 640a45eb..cdb02c91 100644
--- a/core/server/src/binary/handlers/streams/update_stream_handler.rs
+++ b/core/server/src/binary/handlers/streams/update_stream_handler.rs
@@ -24,8 +24,8 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::update_stream::UpdateStream;
use iggy_common::IggyError;
+use iggy_common::update_stream::UpdateStream;
use tracing::{debug, instrument};
impl ServerCommandHandler for UpdateStream {
diff --git a/core/server/src/binary/handlers/system/get_client_handler.rs b/core/server/src/binary/handlers/system/get_client_handler.rs
index c561c963..532eddf4 100644
--- a/core/server/src/binary/handlers/system/get_client_handler.rs
+++ b/core/server/src/binary/handlers/system/get_client_handler.rs
@@ -22,9 +22,9 @@ use crate::binary::mapper;
use crate::binary::sender::SenderKind;
use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
+use iggy_common::IggyError;
use iggy_common::get_client::GetClient;
use iggy_common::locking::IggySharedMutFn;
-use iggy_common::IggyError;
use tracing::debug;
impl ServerCommandHandler for GetClient {
diff --git a/core/server/src/binary/handlers/system/get_clients_handler.rs b/core/server/src/binary/handlers/system/get_clients_handler.rs
index e4cd3907..bf05f7f1 100644
--- a/core/server/src/binary/handlers/system/get_clients_handler.rs
+++ b/core/server/src/binary/handlers/system/get_clients_handler.rs
@@ -24,8 +24,8 @@ use crate::binary::sender::SenderKind;
use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use error_set::ErrContext;
-use iggy_common::get_clients::GetClients;
use iggy_common::IggyError;
+use iggy_common::get_clients::GetClients;
use tracing::debug;
impl ServerCommandHandler for GetClients {
diff --git a/core/server/src/binary/handlers/system/get_me_handler.rs b/core/server/src/binary/handlers/system/get_me_handler.rs
index e4aa730a..b29972a9 100644
--- a/core/server/src/binary/handlers/system/get_me_handler.rs
+++ b/core/server/src/binary/handlers/system/get_me_handler.rs
@@ -24,9 +24,9 @@ use crate::binary::sender::SenderKind;
use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use error_set::ErrContext;
+use iggy_common::IggyError;
use iggy_common::get_me::GetMe;
use iggy_common::locking::IggySharedMutFn;
-use iggy_common::IggyError;
impl ServerCommandHandler for GetMe {
fn code(&self) -> u32 {
diff --git a/core/server/src/binary/handlers/system/get_snapshot.rs b/core/server/src/binary/handlers/system/get_snapshot.rs
index eb4dde64..ff850388 100644
--- a/core/server/src/binary/handlers/system/get_snapshot.rs
+++ b/core/server/src/binary/handlers/system/get_snapshot.rs
@@ -22,8 +22,8 @@ use crate::binary::sender::SenderKind;
use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use bytes::Bytes;
-use iggy_common::get_snapshot::GetSnapshot;
use iggy_common::IggyError;
+use iggy_common::get_snapshot::GetSnapshot;
use tracing::debug;
impl ServerCommandHandler for GetSnapshot {
diff --git a/core/server/src/binary/handlers/system/get_stats_handler.rs b/core/server/src/binary/handlers/system/get_stats_handler.rs
index 2bb40a8b..098ace33 100644
--- a/core/server/src/binary/handlers/system/get_stats_handler.rs
+++ b/core/server/src/binary/handlers/system/get_stats_handler.rs
@@ -24,8 +24,8 @@ use crate::binary::sender::SenderKind;
use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use error_set::ErrContext;
-use iggy_common::get_stats::GetStats;
use iggy_common::IggyError;
+use iggy_common::get_stats::GetStats;
use tracing::debug;
impl ServerCommandHandler for GetStats {
diff --git a/core/server/src/binary/handlers/system/ping_handler.rs b/core/server/src/binary/handlers/system/ping_handler.rs
index c9c4ebb5..396719c5 100644
--- a/core/server/src/binary/handlers/system/ping_handler.rs
+++ b/core/server/src/binary/handlers/system/ping_handler.rs
@@ -21,10 +21,10 @@ use crate::binary::sender::SenderKind;
use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
-use iggy_common::locking::IggySharedMutFn;
-use iggy_common::ping::Ping;
use iggy_common::IggyError;
use iggy_common::IggyTimestamp;
+use iggy_common::locking::IggySharedMutFn;
+use iggy_common::ping::Ping;
use tracing::debug;
impl ServerCommandHandler for Ping {
diff --git a/core/server/src/binary/handlers/topics/create_topic_handler.rs b/core/server/src/binary/handlers/topics/create_topic_handler.rs
index d7b73c0e..f81b7e43 100644
--- a/core/server/src/binary/handlers/topics/create_topic_handler.rs
+++ b/core/server/src/binary/handlers/topics/create_topic_handler.rs
@@ -26,8 +26,8 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::create_topic::CreateTopic;
use iggy_common::IggyError;
+use iggy_common::create_topic::CreateTopic;
use tracing::{debug, instrument};
impl ServerCommandHandler for CreateTopic {
diff --git a/core/server/src/binary/handlers/topics/delete_topic_handler.rs b/core/server/src/binary/handlers/topics/delete_topic_handler.rs
index cdbbb8ae..e83115f4 100644
--- a/core/server/src/binary/handlers/topics/delete_topic_handler.rs
+++ b/core/server/src/binary/handlers/topics/delete_topic_handler.rs
@@ -24,8 +24,8 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::delete_topic::DeleteTopic;
use iggy_common::IggyError;
+use iggy_common::delete_topic::DeleteTopic;
use tracing::{debug, instrument};
impl ServerCommandHandler for DeleteTopic {
diff --git a/core/server/src/binary/handlers/topics/get_topic_handler.rs b/core/server/src/binary/handlers/topics/get_topic_handler.rs
index 6fcdb204..8c652eb3 100644
--- a/core/server/src/binary/handlers/topics/get_topic_handler.rs
+++ b/core/server/src/binary/handlers/topics/get_topic_handler.rs
@@ -23,8 +23,8 @@ use crate::binary::sender::SenderKind;
use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
-use iggy_common::get_topic::GetTopic;
use iggy_common::IggyError;
+use iggy_common::get_topic::GetTopic;
use tracing::debug;
impl ServerCommandHandler for GetTopic {
diff --git a/core/server/src/binary/handlers/topics/get_topics_handler.rs b/core/server/src/binary/handlers/topics/get_topics_handler.rs
index be5d364d..8d5c61b1 100644
--- a/core/server/src/binary/handlers/topics/get_topics_handler.rs
+++ b/core/server/src/binary/handlers/topics/get_topics_handler.rs
@@ -25,8 +25,8 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::get_topics::GetTopics;
use iggy_common::IggyError;
+use iggy_common::get_topics::GetTopics;
use tracing::debug;
impl ServerCommandHandler for GetTopics {
diff --git a/core/server/src/binary/handlers/topics/purge_topic_handler.rs b/core/server/src/binary/handlers/topics/purge_topic_handler.rs
index 4ca36b2f..d9c91470 100644
--- a/core/server/src/binary/handlers/topics/purge_topic_handler.rs
+++ b/core/server/src/binary/handlers/topics/purge_topic_handler.rs
@@ -24,8 +24,8 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::purge_topic::PurgeTopic;
use iggy_common::IggyError;
+use iggy_common::purge_topic::PurgeTopic;
use tracing::{debug, instrument};
impl ServerCommandHandler for PurgeTopic {
diff --git a/core/server/src/binary/handlers/topics/update_topic_handler.rs b/core/server/src/binary/handlers/topics/update_topic_handler.rs
index e900f96c..5f323c61 100644
--- a/core/server/src/binary/handlers/topics/update_topic_handler.rs
+++ b/core/server/src/binary/handlers/topics/update_topic_handler.rs
@@ -24,8 +24,8 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::update_topic::UpdateTopic;
use iggy_common::IggyError;
+use iggy_common::update_topic::UpdateTopic;
use tracing::{debug, instrument};
impl ServerCommandHandler for UpdateTopic {
diff --git a/core/server/src/binary/handlers/users/change_password_handler.rs b/core/server/src/binary/handlers/users/change_password_handler.rs
index 971c1fab..935e8f87 100644
--- a/core/server/src/binary/handlers/users/change_password_handler.rs
+++ b/core/server/src/binary/handlers/users/change_password_handler.rs
@@ -25,8 +25,8 @@ use crate::streaming::systems::system::SharedSystem;
use crate::streaming::utils::crypto;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::change_password::ChangePassword;
use iggy_common::IggyError;
+use iggy_common::change_password::ChangePassword;
use tracing::{debug, instrument};
impl ServerCommandHandler for ChangePassword {
diff --git a/core/server/src/binary/handlers/users/create_user_handler.rs b/core/server/src/binary/handlers/users/create_user_handler.rs
index ee11818e..17d17fdf 100644
--- a/core/server/src/binary/handlers/users/create_user_handler.rs
+++ b/core/server/src/binary/handlers/users/create_user_handler.rs
@@ -27,8 +27,8 @@ use crate::streaming::systems::system::SharedSystem;
use crate::streaming::utils::crypto;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::create_user::CreateUser;
use iggy_common::IggyError;
+use iggy_common::create_user::CreateUser;
use tracing::{debug, instrument};
impl ServerCommandHandler for CreateUser {
diff --git a/core/server/src/binary/handlers/users/delete_user_handler.rs b/core/server/src/binary/handlers/users/delete_user_handler.rs
index 2aa3c1fa..b9fddfd7 100644
--- a/core/server/src/binary/handlers/users/delete_user_handler.rs
+++ b/core/server/src/binary/handlers/users/delete_user_handler.rs
@@ -24,8 +24,8 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::delete_user::DeleteUser;
use iggy_common::IggyError;
+use iggy_common::delete_user::DeleteUser;
use tracing::{debug, instrument};
impl ServerCommandHandler for DeleteUser {
diff --git a/core/server/src/binary/handlers/users/get_user_handler.rs b/core/server/src/binary/handlers/users/get_user_handler.rs
index 9819fda5..5523c4cc 100644
--- a/core/server/src/binary/handlers/users/get_user_handler.rs
+++ b/core/server/src/binary/handlers/users/get_user_handler.rs
@@ -22,8 +22,8 @@ use crate::binary::mapper;
use crate::binary::sender::SenderKind;
use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
-use iggy_common::get_user::GetUser;
use iggy_common::IggyError;
+use iggy_common::get_user::GetUser;
use tracing::debug;
impl ServerCommandHandler for GetUser {
diff --git a/core/server/src/binary/handlers/users/get_users_handler.rs b/core/server/src/binary/handlers/users/get_users_handler.rs
index c05d45b2..7471c591 100644
--- a/core/server/src/binary/handlers/users/get_users_handler.rs
+++ b/core/server/src/binary/handlers/users/get_users_handler.rs
@@ -24,8 +24,8 @@ use crate::binary::sender::SenderKind;
use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use error_set::ErrContext;
-use iggy_common::get_users::GetUsers;
use iggy_common::IggyError;
+use iggy_common::get_users::GetUsers;
use tracing::debug;
impl ServerCommandHandler for GetUsers {
diff --git a/core/server/src/binary/handlers/users/login_user_handler.rs b/core/server/src/binary/handlers/users/login_user_handler.rs
index 5dcf69a1..7fa67be7 100644
--- a/core/server/src/binary/handlers/users/login_user_handler.rs
+++ b/core/server/src/binary/handlers/users/login_user_handler.rs
@@ -24,8 +24,8 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::login_user::LoginUser;
use iggy_common::IggyError;
+use iggy_common::login_user::LoginUser;
use tracing::{debug, instrument};
impl ServerCommandHandler for LoginUser {
diff --git a/core/server/src/binary/handlers/users/logout_user_handler.rs b/core/server/src/binary/handlers/users/logout_user_handler.rs
index 93baf1ce..77fa33f4 100644
--- a/core/server/src/binary/handlers/users/logout_user_handler.rs
+++ b/core/server/src/binary/handlers/users/logout_user_handler.rs
@@ -23,8 +23,8 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::logout_user::LogoutUser;
use iggy_common::IggyError;
+use iggy_common::logout_user::LogoutUser;
use tracing::{debug, instrument};
impl ServerCommandHandler for LogoutUser {
diff --git a/core/server/src/binary/handlers/users/update_permissions_handler.rs b/core/server/src/binary/handlers/users/update_permissions_handler.rs
index 5a99133f..3606c308 100644
--- a/core/server/src/binary/handlers/users/update_permissions_handler.rs
+++ b/core/server/src/binary/handlers/users/update_permissions_handler.rs
@@ -24,8 +24,8 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::update_permissions::UpdatePermissions;
use iggy_common::IggyError;
+use iggy_common::update_permissions::UpdatePermissions;
use tracing::{debug, instrument};
impl ServerCommandHandler for UpdatePermissions {
diff --git a/core/server/src/binary/handlers/users/update_user_handler.rs b/core/server/src/binary/handlers/users/update_user_handler.rs
index caf2fde3..97caa4c9 100644
--- a/core/server/src/binary/handlers/users/update_user_handler.rs
+++ b/core/server/src/binary/handlers/users/update_user_handler.rs
@@ -24,8 +24,8 @@ use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use error_set::ErrContext;
-use iggy_common::update_user::UpdateUser;
use iggy_common::IggyError;
+use iggy_common::update_user::UpdateUser;
use tracing::{debug, instrument};
impl ServerCommandHandler for UpdateUser {
diff --git a/core/server/src/build.rs b/core/server/src/build.rs
index 919a63ec..a3b07277 100644
--- a/core/server/src/build.rs
+++ b/core/server/src/build.rs
@@ -41,7 +41,9 @@ fn main() -> Result<(), Box<dyn error::Error>> {
.display()
);
} else {
- println!("cargo:info=Skipping build script because CI environment variable IGGY_CI_BUILD is not set to 'true'");
+ println!(
+ "cargo:info=Skipping build script because CI environment variable IGGY_CI_BUILD is not set to 'true'"
+ );
}
Ok(())
diff --git a/core/server/src/channels/commands/clean_personal_access_tokens.rs b/core/server/src/channels/commands/clean_personal_access_tokens.rs
index a4ddba0b..c815a18f 100644
--- a/core/server/src/channels/commands/clean_personal_access_tokens.rs
+++ b/core/server/src/channels/commands/clean_personal_access_tokens.rs
@@ -57,7 +57,9 @@ impl PersonalAccessTokenCleaner {
let interval = self.interval;
let sender = self.sender.clone();
- info!("Personal access token cleaner is enabled, expired tokens will be deleted every: {interval}.");
+ info!(
+ "Personal access token cleaner is enabled, expired tokens will be deleted every: {interval}."
+ );
tokio::spawn(async move {
let mut interval_timer = time::interval(interval.get_duration());
loop {
diff --git a/core/server/src/channels/commands/maintain_messages.rs b/core/server/src/channels/commands/maintain_messages.rs
index e133a2e4..16ef3647 100644
--- a/core/server/src/channels/commands/maintain_messages.rs
+++ b/core/server/src/channels/commands/maintain_messages.rs
@@ -24,10 +24,10 @@ use crate::streaming::systems::system::SharedSystem;
use crate::streaming::topics::topic::Topic;
use error_set::ErrContext;
use flume::Sender;
-use iggy_common::locking::IggySharedMutFn;
use iggy_common::IggyDuration;
use iggy_common::IggyError;
use iggy_common::IggyTimestamp;
+use iggy_common::locking::IggySharedMutFn;
use std::sync::Arc;
use tokio::time;
use tracing::{debug, error, info, instrument, trace};
@@ -147,8 +147,7 @@ impl BackgroundServerCommand<MaintainMessagesCommand> for MaintainMessagesExecut
if deleted_segments.segments_count == 0 {
trace!(
"No segments were deleted for stream ID: {}, topic ID: {}",
- topic.stream_id,
- topic.topic_id
+ topic.stream_id, topic.topic_id
);
continue;
}
@@ -303,7 +302,11 @@ async fn handle_oldest_segments(
if is_archived.is_err() {
error!(
"Failed to check if segment with start offset: {} is archived for stream ID: {}, topic ID: {}, partition ID: {}. Error: {}",
- segment.start_offset(), topic.stream_id, topic.topic_id, partition.partition_id, is_archived.err().unwrap()
+ segment.start_offset(),
+ topic.stream_id,
+ topic.topic_id,
+ partition.partition_id,
+ is_archived.err().unwrap()
);
continue;
}
@@ -311,7 +314,10 @@ async fn handle_oldest_segments(
if !is_archived.unwrap() {
debug!(
"Segment with start offset: {} is not archived for stream ID: {}, topic ID: {}, partition ID: {}",
- segment.start_offset(), topic.stream_id, topic.topic_id, partition.partition_id
+ segment.start_offset(),
+ topic.stream_id,
+ topic.topic_id,
+ partition.partition_id
);
start_offsets.push(segment.start_offset());
}
@@ -470,7 +476,11 @@ async fn archive_segments(
if let Err(error) = archiver.archive(&files, None).await {
error!(
"Failed to archive segment with start offset: {} for stream ID: {}, topic ID: {}, partition ID: {}. Error: {}",
- start_offset, topic.stream_id, topic.topic_id, partition.partition_id, error
+ start_offset,
+ topic.stream_id,
+ topic.topic_id,
+ partition.partition_id,
+ error
);
continue;
}
diff --git a/core/server/src/channels/commands/print_sysinfo.rs b/core/server/src/channels/commands/print_sysinfo.rs
index aff3373b..c130b58c 100644
--- a/core/server/src/channels/commands/print_sysinfo.rs
+++ b/core/server/src/channels/commands/print_sysinfo.rs
@@ -78,18 +78,20 @@ impl BackgroundServerCommand<SysInfoPrintCommand> for SysInfoPrintExecutor {
/ stats.total_memory.as_bytes_u64() as f64)
* 100f64;
- info!("CPU: {:.2}%/{:.2}% (IggyUsage/Total), Mem: {:.2}%/{}/{}/{} (Free/IggyUsage/TotalUsed/Total), Clients: {}, Messages processed: {}, Read: {}, Written: {}, Uptime: {}",
- stats.cpu_usage,
- stats.total_cpu_usage,
- free_memory_percent,
- stats.memory_usage,
- stats.total_memory - stats.available_memory,
- stats.total_memory,
- stats.clients_count,
- stats.messages_count.human_count_bare(),
- stats.read_bytes,
- stats.written_bytes,
- stats.run_time);
+ info!(
+ "CPU: {:.2}%/{:.2}% (IggyUsage/Total), Mem: {:.2}%/{}/{}/{} (Free/IggyUsage/TotalUsed/Total), Clients: {}, Messages processed: {}, Read: {}, Written: {}, Uptime: {}",
+ stats.cpu_usage,
+ stats.total_cpu_usage,
+ free_memory_percent,
+ stats.memory_usage,
+ stats.total_memory - stats.available_memory,
+ stats.total_memory,
+ stats.clients_count,
+ stats.messages_count.human_count_bare(),
+ stats.read_bytes,
+ stats.written_bytes,
+ stats.run_time
+ );
memory_pool().log_stats();
}
diff --git a/core/server/src/channels/commands/save_messages.rs b/core/server/src/channels/commands/save_messages.rs
index 2ebc9cb2..586fb8b0 100644
--- a/core/server/src/channels/commands/save_messages.rs
+++ b/core/server/src/channels/commands/save_messages.rs
@@ -59,7 +59,9 @@ impl MessagesSaver {
let enforce_fsync = self.enforce_fsync;
let interval = self.interval;
let sender = self.sender.clone();
- info!("Message saver is enabled, buffered messages will be automatically saved every: {interval}, enforce fsync: {enforce_fsync}.");
+ info!(
+ "Message saver is enabled, buffered messages will be automatically saved every: {interval}, enforce fsync: {enforce_fsync}."
+ );
tokio::spawn(async move {
let mut interval_timer = time::interval(interval.get_duration());
loop {
diff --git a/core/server/src/channels/commands/verify_heartbeats.rs b/core/server/src/channels/commands/verify_heartbeats.rs
index 1fe0c10b..ba48c69e 100644
--- a/core/server/src/channels/commands/verify_heartbeats.rs
+++ b/core/server/src/channels/commands/verify_heartbeats.rs
@@ -20,9 +20,9 @@ use crate::channels::server_command::BackgroundServerCommand;
use crate::configs::server::HeartbeatConfig;
use crate::streaming::systems::system::SharedSystem;
use flume::Sender;
-use iggy_common::locking::IggySharedMutFn;
use iggy_common::IggyDuration;
use iggy_common::IggyTimestamp;
+use iggy_common::locking::IggySharedMutFn;
use tokio::time;
use tracing::{debug, error, info, instrument, warn};
@@ -99,16 +99,14 @@ impl BackgroundServerCommand<VerifyHeartbeatsCommand> for VerifyHeartbeatsExecut
if client.last_heartbeat.as_micros() < heartbeat_to.as_micros() {
warn!(
"Stale client session: {}, last heartbeat at: {}, max allowed timestamp: {heartbeat_to}",
- client.session,
- client.last_heartbeat,
+ client.session, client.last_heartbeat,
);
client.session.set_stale();
stale_clients.push(client.session.client_id);
} else {
debug!(
"Valid heartbeat at: {} for client session: {}, max allowed timestamp: {heartbeat_to}",
- client.last_heartbeat,
- client.session,
+ client.last_heartbeat, client.session,
);
}
}
diff --git a/core/server/src/compat/index_rebuilding/index_rebuilder.rs b/core/server/src/compat/index_rebuilding/index_rebuilder.rs
index 3c55f809..542620ee 100644
--- a/core/server/src/compat/index_rebuilding/index_rebuilder.rs
+++ b/core/server/src/compat/index_rebuilding/index_rebuilder.rs
@@ -18,7 +18,7 @@
use crate::server_error::CompatError;
use crate::streaming::utils::file;
-use iggy_common::{IggyMessageHeader, IGGY_MESSAGE_HEADER_SIZE};
+use iggy_common::{IGGY_MESSAGE_HEADER_SIZE, IggyMessageHeader};
use std::io::SeekFrom;
use tokio::io::{AsyncReadExt, AsyncSeekExt, AsyncWriteExt, BufReader, BufWriter};
diff --git a/core/server/src/configs/config_provider.rs b/core/server/src/configs/config_provider.rs
index 2cc102a8..45ace87a 100644
--- a/core/server/src/configs/config_provider.rs
+++ b/core/server/src/configs/config_provider.rs
@@ -16,16 +16,16 @@
* under the License.
*/
+use crate::IGGY_ROOT_PASSWORD_ENV;
use crate::configs::server::ServerConfig;
use crate::server_error::ConfigError;
-use crate::IGGY_ROOT_PASSWORD_ENV;
use figment::{
+ Error, Figment, Metadata, Profile, Provider,
providers::{Format, Toml},
value::{Dict, Map as FigmentMap, Tag, Value as FigmentValue},
- Error, Figment, Metadata, Profile, Provider,
};
use std::{env, future::Future, path::Path};
-use toml::{map::Map, Value as TomlValue};
+use toml::{Value as TomlValue, map::Map};
use tracing::debug;
const DEFAULT_CONFIG_PROVIDER: &str = "file";
@@ -131,7 +131,7 @@ impl CustomEnvProvider {
);
}
- if let Some(FigmentValue::Dict(_, ref mut actual_inner_target_dict)) =
+ if let Some(FigmentValue::Dict(_, actual_inner_target_dict)) =
current_target.get_mut(&key_to_check)
{
current_source = inner_source_dict;
diff --git a/core/server/src/configs/displays.rs b/core/server/src/configs/displays.rs
index 745579c2..3cfec83a 100644
--- a/core/server/src/configs/displays.rs
+++ b/core/server/src/configs/displays.rs
@@ -39,7 +39,13 @@ impl Display for HttpConfig {
write!(
f,
"{{ enabled: {}, address: {}, max_request_size: {}, cors: {}, jwt: {}, metrics: {}, tls: {} }}",
- self.enabled, self.address, self.max_request_size, self.cors, self.jwt, self.metrics, self.tls
+ self.enabled,
+ self.address,
+ self.max_request_size,
+ self.cors,
+ self.jwt,
+ self.metrics,
+ self.tls
)
}
}
@@ -47,10 +53,16 @@ impl Display for HttpConfig {
impl Display for HttpCorsConfig {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(
- f,
- "{{ enabled: {}, allowed_methods: {:?}, allowed_origins: {:?}, allowed_headers: {:?}, exposed_headers: {:?}, allow_credentials: {}, allow_private_network: {} }}",
- self.enabled, self.allowed_methods, self.allowed_origins, self.allowed_headers, self.exposed_headers, self.allow_credentials, self.allow_private_network
- )
+ f,
+ "{{ enabled: {}, allowed_methods: {:?}, allowed_origins: {:?}, allowed_headers: {:?}, exposed_headers: {:?}, allow_credentials: {}, allow_private_network: {} }}",
+ self.enabled,
+ self.allowed_methods,
+ self.allowed_origins,
+ self.allowed_headers,
+ self.exposed_headers,
+ self.allow_credentials,
+ self.allow_private_network
+ )
}
}
@@ -87,19 +99,19 @@ impl Display for HttpTlsConfig {
impl Display for QuicConfig {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(
- f,
- "{{ enabled: {}, address: {}, max_concurrent_bidi_streams: {}, datagram_send_buffer_size: {}, initial_mtu: {}, send_window: {}, receive_window: {}, keep_alive_interval: {}, max_idle_timeout: {}, certificate: {} }}",
- self.enabled,
- self.address,
- self.max_concurrent_bidi_streams,
- self.datagram_send_buffer_size,
- self.initial_mtu,
- self.send_window,
- self.receive_window,
- self.keep_alive_interval,
- self.max_idle_timeout,
- self.certificate
- )
+ f,
+ "{{ enabled: {}, address: {}, max_concurrent_bidi_streams: {}, datagram_send_buffer_size: {}, initial_mtu: {}, send_window: {}, receive_window: {}, keep_alive_interval: {}, max_idle_timeout: {}, certificate: {} }}",
+ self.enabled,
+ self.address,
+ self.max_concurrent_bidi_streams,
+ self.datagram_send_buffer_size,
+ self.initial_mtu,
+ self.send_window,
+ self.receive_window,
+ self.keep_alive_interval,
+ self.max_idle_timeout,
+ self.certificate
+ )
}
}
@@ -195,7 +207,14 @@ impl Display for ServerConfig {
write!(
f,
"{{ data_maintenance: {}, message_saver: {}, heartbeat: {}, system: {}, quic: {}, tcp: {}, http: {}, telemetry: {} }}",
- self.data_maintenance, self.message_saver, self.heartbeat, self.system, self.quic, self.tcp, self.http, self.telemetry
+ self.data_maintenance,
+ self.message_saver,
+ self.heartbeat,
+ self.system,
+ self.quic,
+ self.tcp,
+ self.http,
+ self.telemetry
)
}
}
@@ -245,14 +264,14 @@ impl Display for TopicConfig {
impl Display for PartitionConfig {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(
- f,
- "{{ path: {}, messages_required_to_save: {}, size_of_messages_required_to_save: {}, enforce_fsync: {}, validate_checksum: {} }}",
- self.path,
- self.messages_required_to_save,
- self.size_of_messages_required_to_save,
- self.enforce_fsync,
- self.validate_checksum
- )
+ f,
+ "{{ path: {}, messages_required_to_save: {}, size_of_messages_required_to_save: {}, enforce_fsync: {}, validate_checksum: {} }}",
+ self.path,
+ self.messages_required_to_save,
+ self.size_of_messages_required_to_save,
+ self.enforce_fsync,
+ self.validate_checksum
+ )
}
}
@@ -271,7 +290,11 @@ impl Display for SegmentConfig {
write!(
f,
"{{ size_bytes: {}, cache_indexes: {}, message_expiry: {}, archive_expired: {}, server_confirmation: {} }}",
- self.size, self.cache_indexes, self.message_expiry, self.archive_expired, self.server_confirmation,
+ self.size,
+ self.cache_indexes,
+ self.message_expiry,
+ self.archive_expired,
+ self.server_confirmation,
)
}
}
@@ -314,7 +337,12 @@ impl Display for TcpSocketConfig {
write!(
f,
"{{ override defaults: {}, recv buffer size: {}, send buffer size {}, keepalive: {}, nodelay: {}, linger: {} }}",
- self.override_defaults, self.recv_buffer_size, self.send_buffer_size, self.keepalive, self.nodelay, self.linger,
+ self.override_defaults,
+ self.recv_buffer_size,
+ self.send_buffer_size,
+ self.keepalive,
+ self.nodelay,
+ self.linger,
)
}
}
@@ -362,16 +390,16 @@ impl Display for TelemetryTracesConfig {
impl Display for SystemConfig {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(
- f,
- "{{ path: {}, logging: {}, stream: {}, topic: {}, partition: {}, segment: {}, encryption: {}, state: {} }}",
- self.path,
- self.logging,
- self.stream,
- self.topic,
- self.partition,
- self.segment,
- self.encryption,
- self.state,
- )
+ f,
+ "{{ path: {}, logging: {}, stream: {}, topic: {}, partition: {}, segment: {}, encryption: {}, state: {} }}",
+ self.path,
+ self.logging,
+ self.stream,
+ self.topic,
+ self.partition,
+ self.segment,
+ self.encryption,
+ self.state,
+ )
}
}
diff --git a/core/server/src/configs/http.rs b/core/server/src/configs/http.rs
index cb2907b0..83552da4 100644
--- a/core/server/src/configs/http.rs
+++ b/core/server/src/configs/http.rs
@@ -22,8 +22,8 @@ use iggy_common::IggyError;
use iggy_common::IggyExpiry;
use jsonwebtoken::{Algorithm, DecodingKey, EncodingKey};
use serde::{Deserialize, Serialize};
-use serde_with::serde_as;
use serde_with::DisplayFromStr;
+use serde_with::serde_as;
#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct HttpConfig {
diff --git a/core/server/src/configs/quic.rs b/core/server/src/configs/quic.rs
index 442b2d62..55a5920b 100644
--- a/core/server/src/configs/quic.rs
+++ b/core/server/src/configs/quic.rs
@@ -19,8 +19,8 @@
use iggy_common::IggyByteSize;
use iggy_common::IggyDuration;
use serde::{Deserialize, Serialize};
-use serde_with::serde_as;
use serde_with::DisplayFromStr;
+use serde_with::serde_as;
#[serde_as]
#[derive(Debug, Deserialize, Serialize, Clone)]
diff --git a/core/server/src/configs/server.rs b/core/server/src/configs/server.rs
index f39d1392..252df9a7 100644
--- a/core/server/src/configs/server.rs
+++ b/core/server/src/configs/server.rs
@@ -17,20 +17,20 @@
*/
use crate::archiver::ArchiverKindType;
+use crate::configs::COMPONENT;
use crate::configs::config_provider::ConfigProviderKind;
use crate::configs::http::HttpConfig;
use crate::configs::quic::QuicConfig;
use crate::configs::system::SystemConfig;
use crate::configs::tcp::TcpConfig;
-use crate::configs::COMPONENT;
use crate::server_error::ConfigError;
use derive_more::Display;
use error_set::ErrContext;
use iggy_common::IggyDuration;
use iggy_common::Validatable;
use serde::{Deserialize, Serialize};
-use serde_with::serde_as;
use serde_with::DisplayFromStr;
+use serde_with::serde_as;
use std::str::FromStr;
use std::sync::Arc;
diff --git a/core/server/src/configs/system.rs b/core/server/src/configs/system.rs
index 777fe4ee..fc263a26 100644
--- a/core/server/src/configs/system.rs
+++ b/core/server/src/configs/system.rs
@@ -23,8 +23,8 @@ use iggy_common::IggyExpiry;
use iggy_common::MaxTopicSize;
use iggy_common::{CompressionAlgorithm, IggyDuration};
use serde::{Deserialize, Serialize};
-use serde_with::serde_as;
use serde_with::DisplayFromStr;
+use serde_with::serde_as;
#[derive(Debug, Deserialize, Serialize)]
pub struct SystemConfig {
diff --git a/core/server/src/configs/tcp.rs b/core/server/src/configs/tcp.rs
index b9cac38e..0b8de779 100644
--- a/core/server/src/configs/tcp.rs
+++ b/core/server/src/configs/tcp.rs
@@ -18,8 +18,8 @@
use iggy_common::{IggyByteSize, IggyDuration};
use serde::{Deserialize, Serialize};
-use serde_with::serde_as;
use serde_with::DisplayFromStr;
+use serde_with::serde_as;
#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct TcpConfig {
diff --git a/core/server/src/configs/validators.rs b/core/server/src/configs/validators.rs
index 658230c5..5135655b 100644
--- a/core/server/src/configs/validators.rs
+++ b/core/server/src/configs/validators.rs
@@ -24,9 +24,9 @@ use super::server::{
};
use super::system::{CompressionConfig, MemoryPoolConfig, PartitionConfig};
use crate::archiver::ArchiverKindType;
+use crate::configs::COMPONENT;
use crate::configs::server::{PersonalAccessTokenConfig, ServerConfig};
use crate::configs::system::SegmentConfig;
-use crate::configs::COMPONENT;
use crate::server_error::ConfigError;
use crate::streaming::segments::*;
use error_set::ErrContext;
@@ -52,7 +52,9 @@ impl Validatable<ConfigError> for ServerConfig {
self.personal_access_token
.validate()
.with_error_context(|error| {
- format!("{COMPONENT} (error: {error}) - failed to validate personal access token config")
+ format!(
+ "{COMPONENT} (error: {error}) - failed to validate personal access token config"
+ )
})?;
self.system.segment.validate().with_error_context(|error| {
format!("{COMPONENT} (error: {error}) - failed to validate segment config")
diff --git a/core/server/src/http/consumer_groups.rs b/core/server/src/http/consumer_groups.rs
index c311ec04..dd48c8c2 100644
--- a/core/server/src/http/consumer_groups.rs
+++ b/core/server/src/http/consumer_groups.rs
@@ -16,11 +16,11 @@
* under the License.
*/
+use crate::http::COMPONENT;
use crate::http::error::CustomError;
use crate::http::jwt::json_web_token::Identity;
use crate::http::mapper;
use crate::http::shared::AppState;
-use crate::http::COMPONENT;
use crate::state::command::EntryCommand;
use crate::state::models::CreateConsumerGroupWithId;
use crate::streaming::session::Session;
@@ -29,10 +29,10 @@ use axum::http::StatusCode;
use axum::routing::get;
use axum::{Extension, Json, Router};
use error_set::ErrContext;
-use iggy_common::create_consumer_group::CreateConsumerGroup;
-use iggy_common::delete_consumer_group::DeleteConsumerGroup;
use iggy_common::Identifier;
use iggy_common::Validatable;
+use iggy_common::create_consumer_group::CreateConsumerGroup;
+use iggy_common::delete_consumer_group::DeleteConsumerGroup;
use iggy_common::{ConsumerGroup, ConsumerGroupDetails};
use std::sync::Arc;
use tracing::instrument;
diff --git a/core/server/src/http/consumer_offsets.rs b/core/server/src/http/consumer_offsets.rs
index ed1c860e..c07dabd6 100644
--- a/core/server/src/http/consumer_offsets.rs
+++ b/core/server/src/http/consumer_offsets.rs
@@ -16,23 +16,23 @@
* under the License.
*/
+use crate::http::COMPONENT;
use crate::http::error::CustomError;
use crate::http::jwt::json_web_token::Identity;
use crate::http::shared::AppState;
-use crate::http::COMPONENT;
use crate::streaming::session::Session;
use axum::extract::{Path, Query, State};
use axum::http::StatusCode;
use axum::routing::{delete, get};
use axum::{Extension, Json, Router};
use error_set::ErrContext;
-use iggy_common::delete_consumer_offset::DeleteConsumerOffset;
-use iggy_common::get_consumer_offset::GetConsumerOffset;
-use iggy_common::store_consumer_offset::StoreConsumerOffset;
use iggy_common::Consumer;
use iggy_common::ConsumerOffsetInfo;
use iggy_common::Identifier;
use iggy_common::Validatable;
+use iggy_common::delete_consumer_offset::DeleteConsumerOffset;
+use iggy_common::get_consumer_offset::GetConsumerOffset;
+use iggy_common::store_consumer_offset::StoreConsumerOffset;
use std::sync::Arc;
pub fn router(state: Arc<AppState>) -> Router {
diff --git a/core/server/src/http/diagnostics.rs b/core/server/src/http/diagnostics.rs
index 155f8721..1531d391 100644
--- a/core/server/src/http/diagnostics.rs
+++ b/core/server/src/http/diagnostics.rs
@@ -54,7 +54,9 @@ pub async fn request_diagnostics(
if let Ok(response) = &result {
let status = response.status();
if status != StatusCode::NOT_FOUND && status >= StatusCode::BAD_REQUEST {
- error!("Returning an invalid status code: {status}, IP address: {ip_address}, request ID: {request_id}");
+ error!(
+ "Returning an invalid status code: {status}, IP address: {ip_address}, request ID: {request_id}"
+ );
}
}
let elapsed = now.elapsed();
diff --git a/core/server/src/http/error.rs b/core/server/src/http/error.rs
index 39a1b37d..66b2a834 100644
--- a/core/server/src/http/error.rs
+++ b/core/server/src/http/error.rs
@@ -16,9 +16,9 @@
* under the License.
*/
+use axum::Json;
use axum::http::StatusCode;
use axum::response::{IntoResponse, Response};
-use axum::Json;
use iggy_common::IggyError;
use serde::Serialize;
use thiserror::Error;
diff --git a/core/server/src/http/http_server.rs b/core/server/src/http/http_server.rs
index 95b96563..9baf082c 100644
--- a/core/server/src/http/http_server.rs
+++ b/core/server/src/http/http_server.rs
@@ -27,7 +27,7 @@ use crate::http::*;
use crate::streaming::systems::system::SharedSystem;
use axum::extract::DefaultBodyLimit;
use axum::http::Method;
-use axum::{middleware, Router};
+use axum::{Router, middleware};
use axum_server::tls_rustls::RustlsConfig;
use std::net::SocketAddr;
use std::path::PathBuf;
diff --git a/core/server/src/http/jwt/jwt_manager.rs b/core/server/src/http/jwt/jwt_manager.rs
index 48010cb6..5b569209 100644
--- a/core/server/src/http/jwt/jwt_manager.rs
+++ b/core/server/src/http/jwt/jwt_manager.rs
@@ -17,20 +17,20 @@
*/
use crate::configs::http::HttpJwtConfig;
+use crate::http::jwt::COMPONENT;
use crate::http::jwt::json_web_token::{GeneratedToken, JwtClaims, RevokedAccessToken};
use crate::http::jwt::storage::TokenStorage;
-use crate::http::jwt::COMPONENT;
use crate::streaming::persistence::persister::PersisterKind;
use ahash::AHashMap;
use error_set::ErrContext;
-use iggy_common::locking::IggySharedMut;
-use iggy_common::locking::IggySharedMutFn;
use iggy_common::IggyDuration;
use iggy_common::IggyError;
use iggy_common::IggyExpiry;
use iggy_common::IggyTimestamp;
use iggy_common::UserId;
-use jsonwebtoken::{encode, Algorithm, DecodingKey, EncodingKey, Header, TokenData, Validation};
+use iggy_common::locking::IggySharedMut;
+use iggy_common::locking::IggySharedMutFn;
+use jsonwebtoken::{Algorithm, DecodingKey, EncodingKey, Header, TokenData, Validation, encode};
use std::sync::Arc;
use tracing::{debug, error, info};
diff --git a/core/server/src/http/jwt/storage.rs b/core/server/src/http/jwt/storage.rs
index 1d20671d..970b5373 100644
--- a/core/server/src/http/jwt/storage.rs
+++ b/core/server/src/http/jwt/storage.rs
@@ -17,8 +17,8 @@
*/
use crate::http::jwt::COMPONENT;
-use crate::streaming::utils::file;
use crate::streaming::utils::PooledBuffer;
+use crate::streaming::utils::file;
use crate::{
http::jwt::json_web_token::RevokedAccessToken, streaming::persistence::persister::PersisterKind,
};
diff --git a/core/server/src/http/mapper.rs b/core/server/src/http/mapper.rs
index b09d7f9b..81aa0483 100644
--- a/core/server/src/http/mapper.rs
+++ b/core/server/src/http/mapper.rs
@@ -23,13 +23,13 @@ use crate::streaming::streams::stream::Stream;
use crate::streaming::topics::consumer_group::ConsumerGroup;
use crate::streaming::topics::topic::Topic;
use crate::streaming::users::user::User;
-use iggy_common::locking::IggySharedMut;
-use iggy_common::locking::IggySharedMutFn;
use iggy_common::ConsumerGroupInfo;
use iggy_common::PersonalAccessTokenInfo;
use iggy_common::Sizeable;
use iggy_common::StreamDetails;
use iggy_common::TopicDetails;
+use iggy_common::locking::IggySharedMut;
+use iggy_common::locking::IggySharedMutFn;
use iggy_common::{ConsumerGroupDetails, ConsumerGroupMember};
use iggy_common::{IdentityInfo, TokenInfo};
use iggy_common::{UserInfo, UserInfoDetails};
diff --git a/core/server/src/http/messages.rs b/core/server/src/http/messages.rs
index 800e1448..ee6f6b66 100644
--- a/core/server/src/http/messages.rs
+++ b/core/server/src/http/messages.rs
@@ -16,10 +16,10 @@
* under the License.
*/
+use crate::http::COMPONENT;
use crate::http::error::CustomError;
use crate::http::jwt::json_web_token::Identity;
use crate::http::shared::AppState;
-use crate::http::COMPONENT;
use crate::streaming::segments::{IggyIndexesMut, IggyMessagesBatchMut};
use crate::streaming::session::Session;
use crate::streaming::systems::messages::PollingArgs;
diff --git a/core/server/src/http/partitions.rs b/core/server/src/http/partitions.rs
index 074b2fb5..607ad71e 100644
--- a/core/server/src/http/partitions.rs
+++ b/core/server/src/http/partitions.rs
@@ -16,10 +16,10 @@
* under the License.
*/
+use crate::http::COMPONENT;
use crate::http::error::CustomError;
use crate::http::jwt::json_web_token::Identity;
use crate::http::shared::AppState;
-use crate::http::COMPONENT;
use crate::state::command::EntryCommand;
use crate::streaming::session::Session;
use axum::extract::{Path, Query, State};
@@ -27,10 +27,10 @@ use axum::http::StatusCode;
use axum::routing::post;
use axum::{Extension, Json, Router};
use error_set::ErrContext;
-use iggy_common::create_partitions::CreatePartitions;
-use iggy_common::delete_partitions::DeletePartitions;
use iggy_common::Identifier;
use iggy_common::Validatable;
+use iggy_common::create_partitions::CreatePartitions;
+use iggy_common::delete_partitions::DeletePartitions;
use std::sync::Arc;
use tracing::instrument;
diff --git a/core/server/src/http/personal_access_tokens.rs b/core/server/src/http/personal_access_tokens.rs
index ebb03933..aae3ab6e 100644
--- a/core/server/src/http/personal_access_tokens.rs
+++ b/core/server/src/http/personal_access_tokens.rs
@@ -16,12 +16,12 @@
* under the License.
*/
+use crate::http::COMPONENT;
use crate::http::error::CustomError;
use crate::http::jwt::json_web_token::Identity;
use crate::http::mapper;
use crate::http::mapper::map_generated_access_token_to_identity_info;
use crate::http::shared::AppState;
-use crate::http::COMPONENT;
use crate::state::command::EntryCommand;
use crate::state::models::CreatePersonalAccessTokenWithHash;
use crate::streaming::personal_access_tokens::personal_access_token::PersonalAccessToken;
@@ -31,11 +31,11 @@ use axum::http::StatusCode;
use axum::routing::{delete, get, post};
use axum::{Extension, Json, Router};
use error_set::ErrContext;
+use iggy_common::IdentityInfo;
+use iggy_common::Validatable;
use iggy_common::create_personal_access_token::CreatePersonalAccessToken;
use iggy_common::delete_personal_access_token::DeletePersonalAccessToken;
use iggy_common::login_with_personal_access_token::LoginWithPersonalAccessToken;
-use iggy_common::IdentityInfo;
-use iggy_common::Validatable;
use iggy_common::{PersonalAccessTokenInfo, RawPersonalAccessToken};
use std::sync::Arc;
use tracing::instrument;
diff --git a/core/server/src/http/streams.rs b/core/server/src/http/streams.rs
index 673e0879..9398cd47 100644
--- a/core/server/src/http/streams.rs
+++ b/core/server/src/http/streams.rs
@@ -16,23 +16,23 @@
* under the License.
*/
+use crate::http::COMPONENT;
use crate::http::error::CustomError;
use crate::http::jwt::json_web_token::Identity;
use crate::http::mapper;
use crate::http::shared::AppState;
-use crate::http::COMPONENT;
use crate::streaming::session::Session;
use axum::extract::{Path, State};
use axum::http::StatusCode;
use axum::routing::{delete, get};
use axum::{Extension, Json, Router};
use error_set::ErrContext;
+use iggy_common::Identifier;
+use iggy_common::Validatable;
use iggy_common::create_stream::CreateStream;
use iggy_common::delete_stream::DeleteStream;
use iggy_common::purge_stream::PurgeStream;
use iggy_common::update_stream::UpdateStream;
-use iggy_common::Identifier;
-use iggy_common::Validatable;
use iggy_common::{Stream, StreamDetails};
use crate::state::command::EntryCommand;
diff --git a/core/server/src/http/system.rs b/core/server/src/http/system.rs
index d150d6fa..23096252 100644
--- a/core/server/src/http/system.rs
+++ b/core/server/src/http/system.rs
@@ -17,25 +17,25 @@
*/
use crate::configs::http::HttpMetricsConfig;
+use crate::http::COMPONENT;
use crate::http::error::CustomError;
use crate::http::jwt::json_web_token::Identity;
use crate::http::mapper;
use crate::http::shared::AppState;
-use crate::http::COMPONENT;
use crate::streaming::session::Session;
use axum::body::Body;
use axum::extract::{Path, State};
-use axum::http::{header, HeaderMap};
+use axum::http::{HeaderMap, header};
use axum::response::IntoResponse;
use axum::routing::{get, post};
use axum::{Extension, Json, Router};
use bytes::Bytes;
use chrono::Local;
use error_set::ErrContext;
-use iggy_common::get_snapshot::GetSnapshot;
-use iggy_common::locking::IggySharedMutFn;
use iggy_common::Stats;
use iggy_common::Validatable;
+use iggy_common::get_snapshot::GetSnapshot;
+use iggy_common::locking::IggySharedMutFn;
use iggy_common::{ClientInfo, ClientInfoDetails};
use std::sync::Arc;
diff --git a/core/server/src/http/topics.rs b/core/server/src/http/topics.rs
index bfc909df..8f1a2438 100644
--- a/core/server/src/http/topics.rs
+++ b/core/server/src/http/topics.rs
@@ -16,11 +16,11 @@
* under the License.
*/
+use crate::http::COMPONENT;
use crate::http::error::CustomError;
use crate::http::jwt::json_web_token::Identity;
use crate::http::mapper;
use crate::http::shared::AppState;
-use crate::http::COMPONENT;
use crate::state::command::EntryCommand;
use crate::state::models::CreateTopicWithId;
use crate::streaming::session::Session;
@@ -29,12 +29,12 @@ use axum::http::StatusCode;
use axum::routing::{delete, get};
use axum::{Extension, Json, Router};
use error_set::ErrContext;
+use iggy_common::Identifier;
+use iggy_common::Validatable;
use iggy_common::create_topic::CreateTopic;
use iggy_common::delete_topic::DeleteTopic;
use iggy_common::purge_topic::PurgeTopic;
use iggy_common::update_topic::UpdateTopic;
-use iggy_common::Identifier;
-use iggy_common::Validatable;
use iggy_common::{Topic, TopicDetails};
use std::sync::Arc;
use tracing::instrument;
diff --git a/core/server/src/http/users.rs b/core/server/src/http/users.rs
index 2644d3aa..aebce2e5 100644
--- a/core/server/src/http/users.rs
+++ b/core/server/src/http/users.rs
@@ -16,12 +16,12 @@
* under the License.
*/
+use crate::http::COMPONENT;
use crate::http::error::CustomError;
use crate::http::jwt::json_web_token::Identity;
use crate::http::mapper;
use crate::http::mapper::map_generated_access_token_to_identity_info;
use crate::http::shared::AppState;
-use crate::http::COMPONENT;
use crate::state::command::EntryCommand;
use crate::state::models::CreateUserWithId;
use crate::streaming::session::Session;
diff --git a/core/server/src/log/logger.rs b/core/server/src/log/logger.rs
index 3383b636..a2431ebb 100644
--- a/core/server/src/log/logger.rs
+++ b/core/server/src/log/logger.rs
@@ -16,35 +16,35 @@
* under the License.
*/
+use crate::VERSION;
use crate::configs::server::{TelemetryConfig, TelemetryTransport};
use crate::configs::system::LoggingConfig;
use crate::server_error::LogError;
-use crate::VERSION;
+use opentelemetry::KeyValue;
use opentelemetry::global;
use opentelemetry::trace::TracerProvider;
-use opentelemetry::KeyValue;
use opentelemetry_appender_tracing::layer::OpenTelemetryTracingBridge;
use opentelemetry_otlp::{WithExportConfig, WithHttpConfig};
+use opentelemetry_sdk::Resource;
use opentelemetry_sdk::logs::log_processor_with_async_runtime;
use opentelemetry_sdk::propagation::TraceContextPropagator;
use opentelemetry_sdk::runtime;
use opentelemetry_sdk::trace::span_processor_with_async_runtime;
-use opentelemetry_sdk::Resource;
use std::io::{self, Write};
use std::path::PathBuf;
use std::str::FromStr;
use std::sync::{Arc, Mutex};
-use tracing::{event, info, trace, Level};
+use tracing::{Level, event, info, trace};
use tracing_appender::non_blocking::WorkerGuard;
use tracing_opentelemetry::OpenTelemetryLayer;
use tracing_subscriber::field::{RecordFields, VisitOutput};
-use tracing_subscriber::fmt::format::DefaultVisitor;
use tracing_subscriber::fmt::FormatFields;
+use tracing_subscriber::fmt::format::DefaultVisitor;
use tracing_subscriber::layer::SubscriberExt;
use tracing_subscriber::util::SubscriberInitExt;
use tracing_subscriber::{
- filter::LevelFilter, fmt, fmt::format::Format, fmt::MakeWriter, reload, reload::Handle,
- EnvFilter, Layer, Registry,
+ EnvFilter, Layer, Registry, filter::LevelFilter, fmt, fmt::MakeWriter, fmt::format::Format,
+ reload, reload::Handle,
};
const IGGY_LOG_FILE_PREFIX: &str = "iggy-server.log";
@@ -404,7 +404,9 @@ impl Logging {
hash, built_at, rust_version, target
);
} else {
- info!("It seems that you are a developer. Environment variable IGGY_CI_BUILD is not set to 'true', skipping build info print.")
+ info!(
+ "It seems that you are a developer. Environment variable IGGY_CI_BUILD is not set to 'true', skipping build info print."
+ )
}
}
}
diff --git a/core/server/src/main.rs b/core/server/src/main.rs
index 00180faa..d9d9d753 100644
--- a/core/server/src/main.rs
+++ b/core/server/src/main.rs
@@ -119,7 +119,7 @@ async fn main() -> Result<(), ServerError> {
#[cfg(unix)]
let (mut ctrl_c, mut sigterm) = {
- use tokio::signal::unix::{signal, SignalKind};
+ use tokio::signal::unix::{SignalKind, signal};
(
signal(SignalKind::interrupt())?,
signal(SignalKind::terminate())?,
diff --git a/core/server/src/quic/quic_server.rs b/core/server/src/quic/quic_server.rs
index 8eff266f..96d78d96 100644
--- a/core/server/src/quic/quic_server.rs
+++ b/core/server/src/quic/quic_server.rs
@@ -28,8 +28,8 @@ use rustls::pki_types::{CertificateDer, PrivateKeyDer};
use tracing::info;
use crate::configs::quic::QuicConfig;
-use crate::quic::listener;
use crate::quic::COMPONENT;
+use crate::quic::listener;
use crate::server_error::QuicError;
use crate::streaming::systems::system::SharedSystem;
diff --git a/core/server/src/state/command.rs b/core/server/src/state/command.rs
index fd84142e..2657cc9c 100644
--- a/core/server/src/state/command.rs
+++ b/core/server/src/state/command.rs
@@ -21,6 +21,8 @@ use crate::state::models::{
CreateTopicWithId, CreateUserWithId,
};
use bytes::{Buf, BufMut, Bytes, BytesMut};
+use iggy_common::BytesSerializable;
+use iggy_common::IggyError;
use iggy_common::change_password::ChangePassword;
use iggy_common::create_partitions::CreatePartitions;
use iggy_common::delete_consumer_group::DeleteConsumerGroup;
@@ -36,12 +38,10 @@ use iggy_common::update_permissions::UpdatePermissions;
use iggy_common::update_stream::UpdateStream;
use iggy_common::update_topic::UpdateTopic;
use iggy_common::update_user::UpdateUser;
-use iggy_common::BytesSerializable;
-use iggy_common::IggyError;
use iggy_common::{
- Command, CHANGE_PASSWORD_CODE, CREATE_CONSUMER_GROUP_CODE, CREATE_PARTITIONS_CODE,
+ CHANGE_PASSWORD_CODE, CREATE_CONSUMER_GROUP_CODE, CREATE_PARTITIONS_CODE,
CREATE_PERSONAL_ACCESS_TOKEN_CODE, CREATE_STREAM_CODE, CREATE_TOPIC_CODE, CREATE_USER_CODE,
- DELETE_CONSUMER_GROUP_CODE, DELETE_PARTITIONS_CODE, DELETE_PERSONAL_ACCESS_TOKEN_CODE,
+ Command, DELETE_CONSUMER_GROUP_CODE, DELETE_PARTITIONS_CODE, DELETE_PERSONAL_ACCESS_TOKEN_CODE,
DELETE_STREAM_CODE, DELETE_TOPIC_CODE, DELETE_USER_CODE, PURGE_STREAM_CODE, PURGE_TOPIC_CODE,
UPDATE_PERMISSIONS_CODE, UPDATE_STREAM_CODE, UPDATE_TOPIC_CODE, UPDATE_USER_CODE,
};
diff --git a/core/server/src/state/entry.rs b/core/server/src/state/entry.rs
index 99a5289a..aa4e82d6 100644
--- a/core/server/src/state/entry.rs
+++ b/core/server/src/state/entry.rs
@@ -20,7 +20,7 @@ use crate::state::command::EntryCommand;
use bytes::{Buf, BufMut, Bytes, BytesMut};
use iggy_common::IggyError;
use iggy_common::IggyTimestamp;
-use iggy_common::{calculate_checksum, BytesSerializable};
+use iggy_common::{BytesSerializable, calculate_checksum};
use std::fmt::{Display, Formatter};
/// State entry in the log
diff --git a/core/server/src/state/file.rs b/core/server/src/state/file.rs
index 458ffbab..c9e77977 100644
--- a/core/server/src/state/file.rs
+++ b/core/server/src/state/file.rs
@@ -17,7 +17,7 @@
*/
use crate::state::command::EntryCommand;
-use crate::state::{State, StateEntry, COMPONENT};
+use crate::state::{COMPONENT, State, StateEntry};
use crate::streaming::persistence::persister::PersisterKind;
use crate::streaming::utils::file;
use crate::versioning::SemanticVersion;
@@ -30,8 +30,8 @@ use iggy_common::IggyError;
use iggy_common::IggyTimestamp;
use std::fmt::Debug;
use std::path::Path;
-use std::sync::atomic::{AtomicU32, AtomicU64, Ordering};
use std::sync::Arc;
+use std::sync::atomic::{AtomicU32, AtomicU64, Ordering};
use tokio::io::{AsyncReadExt, BufReader};
use tracing::{debug, error, info};
diff --git a/core/server/src/state/models.rs b/core/server/src/state/models.rs
index 521a5c48..12987765 100644
--- a/core/server/src/state/models.rs
+++ b/core/server/src/state/models.rs
@@ -19,15 +19,15 @@
use crate::state::COMPONENT;
use bytes::{BufMut, Bytes, BytesMut};
use error_set::ErrContext;
+use iggy_common::BytesSerializable;
+use iggy_common::Command;
+use iggy_common::IggyError;
+use iggy_common::Validatable;
use iggy_common::create_consumer_group::CreateConsumerGroup;
use iggy_common::create_personal_access_token::CreatePersonalAccessToken;
use iggy_common::create_stream::CreateStream;
use iggy_common::create_topic::CreateTopic;
use iggy_common::create_user::CreateUser;
-use iggy_common::BytesSerializable;
-use iggy_common::Command;
-use iggy_common::IggyError;
-use iggy_common::Validatable;
use serde::{Deserialize, Serialize};
use std::fmt;
use std::fmt::{Display, Formatter};
diff --git a/core/server/src/state/system.rs b/core/server/src/state/system.rs
index 67a2824c..a1970cb2 100644
--- a/core/server/src/state/system.rs
+++ b/core/server/src/state/system.rs
@@ -16,7 +16,7 @@
* under the License.
*/
-use crate::state::{EntryCommand, StateEntry, COMPONENT};
+use crate::state::{COMPONENT, EntryCommand, StateEntry};
use crate::streaming::personal_access_tokens::personal_access_token::PersonalAccessToken;
use ahash::AHashMap;
use error_set::ErrContext;
@@ -93,7 +93,9 @@ impl SystemState {
for entry in entries {
debug!("Processing state entry: {entry}",);
match entry.command().with_error_context(|error| {
- format!("{COMPONENT} (error: {error}) - failed to retrieve state entry command: {entry}")
+ format!(
+ "{COMPONENT} (error: {error}) - failed to retrieve state entry command: {entry}"
+ )
})? {
EntryCommand::CreateStream(command) => {
info!("Creating stream: {command:?}");
@@ -265,7 +267,13 @@ impl SystemState {
let partition_id = command.partition_id;
- let _partition = topic.partitions.get(&command.partition_id).unwrap_or_else(|| panic!("{}", format!("Partition {partition_id} not found.")));
+ let _partition =
+ topic
+ .partitions
+ .get(&command.partition_id)
+ .unwrap_or_else(|| {
+ panic!("{}", format!("Partition {partition_id} not found."))
+ });
// State is not affected by the delete segments
}
diff --git a/core/server/src/streaming/clients/client_manager.rs b/core/server/src/streaming/clients/client_manager.rs
index 86ff75a6..4a84a58c 100644
--- a/core/server/src/streaming/clients/client_manager.rs
+++ b/core/server/src/streaming/clients/client_manager.rs
@@ -19,11 +19,11 @@
use crate::streaming::session::Session;
use crate::streaming::utils::hash;
use ahash::AHashMap;
-use iggy_common::locking::IggySharedMut;
-use iggy_common::locking::IggySharedMutFn;
use iggy_common::IggyError;
use iggy_common::IggyTimestamp;
use iggy_common::UserId;
+use iggy_common::locking::IggySharedMut;
+use iggy_common::locking::IggySharedMutFn;
use std::fmt::{Display, Formatter};
use std::net::SocketAddr;
use std::sync::Arc;
diff --git a/core/server/src/streaming/partitions/consumer_offsets.rs b/core/server/src/streaming/partitions/consumer_offsets.rs
index 536c4244..a9f82df7 100644
--- a/core/server/src/streaming/partitions/consumer_offsets.rs
+++ b/core/server/src/streaming/partitions/consumer_offsets.rs
@@ -16,8 +16,8 @@
* under the License.
*/
-use crate::streaming::partitions::partition::{ConsumerOffset, Partition};
use crate::streaming::partitions::COMPONENT;
+use crate::streaming::partitions::partition::{ConsumerOffset, Partition};
use crate::streaming::polling_consumer::PollingConsumer;
use dashmap::DashMap;
use error_set::ErrContext;
@@ -32,9 +32,7 @@ impl Partition {
) -> Result<Option<u64>, IggyError> {
trace!(
"Getting consumer offset for {}, partition: {}, current: {}...",
- consumer,
- self.partition_id,
- self.current_offset
+ consumer, self.partition_id, self.current_offset
);
match consumer {
@@ -62,10 +60,7 @@ impl Partition {
) -> Result<(), IggyError> {
trace!(
"Storing offset: {} for {}, partition: {}, current: {}...",
- offset,
- consumer,
- self.partition_id,
- self.current_offset
+ offset, consumer, self.partition_id, self.current_offset
);
if offset > self.current_offset {
return Err(IggyError::InvalidOffset(offset));
@@ -132,9 +127,7 @@ impl Partition {
pub async fn load_consumer_offsets(&mut self) -> Result<(), IggyError> {
trace!(
"Loading consumer offsets for partition with ID: {} for topic with ID: {} and stream with ID: {}...",
- self.partition_id,
- self.topic_id,
- self.stream_id
+ self.partition_id, self.topic_id, self.stream_id
);
self.load_consumer_offsets_from_storage(ConsumerKind::Consumer)
.await
@@ -179,14 +172,15 @@ impl Partition {
}
fn log_consumer_offset(&self, consumer_offset: &ConsumerOffset) {
- trace!("Loaded consumer offset value: {} for {} with ID: {} for partition with ID: {} for topic with ID: {} and stream with ID: {}.",
- consumer_offset.offset,
- consumer_offset.kind,
- consumer_offset.consumer_id,
- self.partition_id,
- self.topic_id,
- self.stream_id
- );
+ trace!(
+ "Loaded consumer offset value: {} for {} with ID: {} for partition with ID: {} for topic with ID: {} and stream with ID: {}.",
+ consumer_offset.offset,
+ consumer_offset.kind,
+ consumer_offset.consumer_id,
+ self.partition_id,
+ self.topic_id,
+ self.stream_id
+ );
}
pub async fn delete_consumer_offset(
diff --git a/core/server/src/streaming/partitions/messages.rs b/core/server/src/streaming/partitions/messages.rs
index e960c275..97a2771e 100644
--- a/core/server/src/streaming/partitions/messages.rs
+++ b/core/server/src/streaming/partitions/messages.rs
@@ -16,8 +16,8 @@
* under the License.
*/
-use crate::streaming::partitions::partition::Partition;
use crate::streaming::partitions::COMPONENT;
+use crate::streaming::partitions::partition::Partition;
use crate::streaming::polling_consumer::PollingConsumer;
use crate::streaming::segments::*;
use error_set::ErrContext;
@@ -61,8 +61,7 @@ impl Partition {
) -> Result<IggyMessagesBatchSet, IggyError> {
trace!(
"Getting {count} messages for start offset: {start_offset} for partition: {}, current offset: {}...",
- self.partition_id,
- self.current_offset
+ self.partition_id, self.current_offset
);
if self.segments.is_empty() || start_offset > self.current_offset || count == 0 {
@@ -114,8 +113,7 @@ impl Partition {
if consumer_offset.is_none() {
trace!(
"Consumer: {} hasn't stored offset for partition: {}, returning the first messages...",
- consumer_id,
- self.partition_id
+ consumer_id, self.partition_id
);
return self.get_first_messages(count).await;
}
@@ -124,9 +122,7 @@ impl Partition {
if consumer_offset.offset == self.current_offset {
trace!(
"Consumer: {} has the latest offset: {} for partition: {}, returning empty messages...",
- consumer_id,
- consumer_offset.offset,
- self.partition_id
+ consumer_id, consumer_offset.offset, self.partition_id
);
return Ok(IggyMessagesBatchSet::empty());
}
@@ -134,9 +130,7 @@ impl Partition {
let offset = consumer_offset.offset + 1;
trace!(
"Getting next messages for consumer id: {} for partition: {} from offset: {}...",
- consumer_id,
- self.partition_id,
- offset
+ consumer_id, self.partition_id, offset
);
self.get_messages_by_offset(offset, count).await
@@ -241,9 +235,9 @@ impl Partition {
if last_segment.is_closed() {
let start_offset = last_segment.end_offset() + 1;
trace!(
- "Current segment is closed, creating new segment with start offset: {} for partition with ID: {}...",
- start_offset, self.partition_id
- );
+ "Current segment is closed, creating new segment with start offset: {} for partition with ID: {}...",
+ start_offset, self.partition_id
+ );
self.add_persisted_segment(start_offset).await.with_error_context(|error| format!(
"{COMPONENT} (error: {error}) - failed to add persisted segment, partition: {}, start offset: {}",
self, start_offset,
@@ -305,16 +299,20 @@ impl Partition {
self.unsaved_messages_count,
self.config.partition.messages_required_to_save
)
- } else if unsaved_messages_size_exceeded {
- format!("unsaved messages size exceeded: {}, max from config: {}",
+ } else if unsaved_messages_size_exceeded {
+ format!(
+ "unsaved messages size exceeded: {}, max from config: {}",
self.unsaved_messages_size,
- self.config.partition.size_of_messages_required_to_save)
- } else {
- format!("segment is full, current size: {}, max from config: {}",
+ self.config.partition.size_of_messages_required_to_save
+ )
+ } else {
+ format!(
+ "segment is full, current size: {}, max from config: {}",
last_segment.get_messages_size(),
- self.config.segment.size)
- }
- );
+ self.config.segment.size
+ )
+ }
+ );
last_segment.persist_messages(confirmation).await.with_error_context(|error| {
format!(
@@ -368,8 +366,8 @@ mod tests {
use crate::streaming::utils::MemoryPool;
use bytes::Bytes;
use iggy_common::{IggyExpiry, IggyMessage};
- use std::sync::atomic::{AtomicU32, AtomicU64};
use std::sync::Arc;
+ use std::sync::atomic::{AtomicU32, AtomicU64};
use tempfile::TempDir;
#[tokio::test]
diff --git a/core/server/src/streaming/partitions/partition.rs b/core/server/src/streaming/partitions/partition.rs
index 809978fc..73c190cc 100644
--- a/core/server/src/streaming/partitions/partition.rs
+++ b/core/server/src/streaming/partitions/partition.rs
@@ -28,8 +28,8 @@ use iggy_common::IggyExpiry;
use iggy_common::IggyTimestamp;
use iggy_common::Sizeable;
use std::fmt;
-use std::sync::atomic::{AtomicU32, AtomicU64, Ordering};
use std::sync::Arc;
+use std::sync::atomic::{AtomicU32, AtomicU64, Ordering};
#[derive(Debug)]
pub struct Partition {
@@ -209,8 +209,8 @@ mod tests {
use iggy_common::IggyDuration;
use iggy_common::IggyExpiry;
use iggy_common::IggyTimestamp;
- use std::sync::atomic::{AtomicU32, AtomicU64};
use std::sync::Arc;
+ use std::sync::atomic::{AtomicU32, AtomicU64};
#[tokio::test]
async fn should_be_created_with_a_single_segment_given_valid_parameters() {
diff --git a/core/server/src/streaming/partitions/persistence.rs b/core/server/src/streaming/partitions/persistence.rs
index b323ee7d..44053b08 100644
--- a/core/server/src/streaming/partitions/persistence.rs
+++ b/core/server/src/streaming/partitions/persistence.rs
@@ -17,8 +17,8 @@
*/
use crate::state::system::PartitionState;
-use crate::streaming::partitions::partition::Partition;
use crate::streaming::partitions::COMPONENT;
+use crate::streaming::partitions::partition::Partition;
use error_set::ErrContext;
use iggy_common::IggyError;
use std::path::Path;
diff --git a/core/server/src/streaming/partitions/segments.rs b/core/server/src/streaming/partitions/segments.rs
index 64cd850e..ae293ca2 100644
--- a/core/server/src/streaming/partitions/segments.rs
+++ b/core/server/src/streaming/partitions/segments.rs
@@ -18,8 +18,8 @@
use std::sync::atomic::Ordering;
-use crate::streaming::partitions::partition::Partition;
use crate::streaming::partitions::COMPONENT;
+use crate::streaming::partitions::partition::Partition;
use crate::streaming::segments::*;
use error_set::ErrContext;
use iggy_common::IggyError;
diff --git a/core/server/src/streaming/partitions/storage.rs b/core/server/src/streaming/partitions/storage.rs
index 3e31c9ef..ac95b264 100644
--- a/core/server/src/streaming/partitions/storage.rs
+++ b/core/server/src/streaming/partitions/storage.rs
@@ -19,8 +19,8 @@
use crate::compat::index_rebuilding::index_rebuilder::IndexRebuilder;
use crate::configs::cache_indexes::CacheIndexesConfig;
use crate::state::system::PartitionState;
-use crate::streaming::partitions::partition::{ConsumerOffset, Partition};
use crate::streaming::partitions::COMPONENT;
+use crate::streaming::partitions::partition::{ConsumerOffset, Partition};
use crate::streaming::persistence::persister::PersisterKind;
use crate::streaming::segments::*;
use crate::streaming::storage::PartitionStorage;
@@ -29,8 +29,8 @@ use error_set::ErrContext;
use iggy_common::ConsumerKind;
use iggy_common::IggyError;
use std::path::Path;
-use std::sync::atomic::Ordering;
use std::sync::Arc;
+use std::sync::atomic::Ordering;
use tokio::fs;
use tokio::fs::create_dir_all;
use tokio::io::AsyncReadExt;
@@ -55,7 +55,10 @@ impl PartitionStorage for FilePartitionStorage {
) -> Result<(), IggyError> {
info!(
"Loading partition with ID: {} for stream with ID: {} and topic with ID: {}, for path: {} from disk...",
- partition.partition_id, partition.stream_id, partition.topic_id, partition.partition_path
+ partition.partition_id,
+ partition.stream_id,
+ partition.topic_id,
+ partition.partition_path
);
partition.created_at = state.created_at;
let dir_entries = fs::read_dir(&partition.partition_path).await;
@@ -155,16 +158,28 @@ impl PartitionStorage for FilePartitionStorage {
}
if partition.config.partition.validate_checksum {
- info!("Validating messages checksum for partition with ID: {} and segment with start offset: {}...", partition.partition_id, segment.start_offset());
+ info!(
+ "Validating messages checksum for partition with ID: {} and segment with start offset: {}...",
+ partition.partition_id,
+ segment.start_offset()
+ );
segment.validate_messages_checksums().await?;
- info!("Validated messages checksum for partition with ID: {} and segment with start offset: {}.", partition.partition_id, segment.start_offset());
+ info!(
+ "Validated messages checksum for partition with ID: {} and segment with start offset: {}.",
+ partition.partition_id,
+ segment.start_offset()
+ );
}
// Load the unique message IDs for the partition if the deduplication feature is enabled.
let mut unique_message_ids_count = 0;
if let Some(message_deduplicator) = &partition.message_deduplicator {
let max_entries = partition.config.message_deduplication.max_entries as u32;
- info!("Loading {max_entries} unique message IDs for partition with ID: {} and segment with start offset: {}...", partition.partition_id, segment.start_offset());
+ info!(
+ "Loading {max_entries} unique message IDs for partition with ID: {} and segment with start offset: {}...",
+ partition.partition_id,
+ segment.start_offset()
+ );
let message_ids = segment.load_message_ids(max_entries).await.with_error_context(|error| {
format!("{COMPONENT} (error: {error}) - failed to load message ids, segment: {segment}",)
})?;
@@ -172,10 +187,20 @@ impl PartitionStorage for FilePartitionStorage {
if message_deduplicator.try_insert(message_id).await {
unique_message_ids_count += 1;
} else {
- warn!("Duplicated message ID: {} for partition with ID: {} and segment with start offset: {}.", message_id, partition.partition_id, segment.start_offset());
+ warn!(
+ "Duplicated message ID: {} for partition with ID: {} and segment with start offset: {}.",
+ message_id,
+ partition.partition_id,
+ segment.start_offset()
+ );
}
}
- info!("Loaded: {} unique message IDs for partition with ID: {} and segment with start offset: {}...", unique_message_ids_count, partition.partition_id, segment.start_offset());
+ info!(
+ "Loaded: {} unique message IDs for partition with ID: {} and segment with start offset: {}...",
+ unique_message_ids_count,
+ partition.partition_id,
+ segment.start_offset()
+ );
}
if CacheIndexesConfig::None == partition.config.segment.cache_indexes {
@@ -230,7 +255,10 @@ impl PartitionStorage for FilePartitionStorage {
})?;
info!(
"Loaded partition with ID: {} for stream with ID: {} and topic with ID: {}, current offset: {}.",
- partition.partition_id, partition.stream_id, partition.topic_id, partition.current_offset
+ partition.partition_id,
+ partition.stream_id,
+ partition.topic_id,
+ partition.current_offset
);
Ok(())
@@ -303,7 +331,13 @@ impl PartitionStorage for FilePartitionStorage {
})?;
}
- info!("Saved partition with start ID: {} for stream with ID: {} and topic with ID: {}, path: {}.", partition.partition_id, partition.stream_id, partition.topic_id, partition.partition_path);
+ info!(
+ "Saved partition with start ID: {} for stream with ID: {} and topic with ID: {}, path: {}.",
+ partition.partition_id,
+ partition.stream_id,
+ partition.topic_id,
+ partition.partition_path
+ );
Ok(())
}
@@ -318,7 +352,10 @@ impl PartitionStorage for FilePartitionStorage {
.delete_consumer_offsets(&partition.consumer_offsets_path)
.await
{
- error!("Cannot delete consumer offsets for partition with ID: {} for topic with ID: {} for stream with ID: {}. Error: {}", partition.partition_id, partition.topic_id, partition.stream_id, err);
+ error!(
+ "Cannot delete consumer offsets for partition with ID: {} for topic with ID: {} for stream with ID: {}. Error: {}",
+ partition.partition_id, partition.topic_id, partition.stream_id, err
+ );
return Err(IggyError::CannotDeletePartition(
partition.partition_id,
partition.topic_id,
@@ -330,7 +367,10 @@ impl PartitionStorage for FilePartitionStorage {
.delete_consumer_offsets(&partition.consumer_group_offsets_path)
.await
{
- error!("Cannot delete consumer group offsets for partition with ID: {} for topic with ID: {} for stream with ID: {}. Error: {}", partition.partition_id, partition.topic_id, partition.stream_id, err);
+ error!(
+ "Cannot delete consumer group offsets for partition with ID: {} for topic with ID: {} for stream with ID: {}. Error: {}",
+ partition.partition_id, partition.topic_id, partition.stream_id, err
+ );
return Err(IggyError::CannotDeletePartition(
partition.partition_id,
partition.topic_id,
@@ -339,7 +379,13 @@ impl PartitionStorage for FilePartitionStorage {
}
if fs::remove_dir_all(&partition.partition_path).await.is_err() {
- error!("Cannot delete partition directory: {} for partition with ID: {} for topic with ID: {} for stream with ID: {}.", partition.partition_path, partition.partition_id, partition.topic_id, partition.stream_id);
+ error!(
+ "Cannot delete partition directory: {} for partition with ID: {} for topic with ID: {} for stream with ID: {}.",
+ partition.partition_path,
+ partition.partition_id,
+ partition.topic_id,
+ partition.stream_id
+ );
return Err(IggyError::CannotDeletePartitionDirectory(
partition.partition_id,
partition.stream_id,
diff --git a/core/server/src/streaming/persistence/task.rs b/core/server/src/streaming/persistence/task.rs
index 3742b0c5..70510ed5 100644
--- a/core/server/src/streaming/persistence/task.rs
+++ b/core/server/src/streaming/persistence/task.rs
@@ -19,7 +19,7 @@
use crate::streaming::persistence::COMPONENT;
use bytes::Bytes;
use error_set::ErrContext;
-use flume::{unbounded, Receiver, Sender};
+use flume::{Receiver, Sender, unbounded};
use iggy_common::IggyError;
use std::{sync::Arc, time::Duration};
use tokio::task;
diff --git a/core/server/src/streaming/personal_access_tokens/personal_access_token.rs b/core/server/src/streaming/personal_access_tokens/personal_access_token.rs
index e8f3f987..8fc0c853 100644
--- a/core/server/src/streaming/personal_access_tokens/personal_access_token.rs
+++ b/core/server/src/streaming/personal_access_tokens/personal_access_token.rs
@@ -16,10 +16,10 @@
* under the License.
*/
use crate::streaming::utils::hash;
-use iggy_common::text::as_base64;
use iggy_common::IggyExpiry;
use iggy_common::IggyTimestamp;
use iggy_common::UserId;
+use iggy_common::text::as_base64;
use ring::rand::SecureRandom;
use std::sync::Arc;
diff --git a/core/server/src/streaming/segments/indexes/index_reader.rs b/core/server/src/streaming/segments/indexes/index_reader.rs
index e9547a3a..96e7ef83 100644
--- a/core/server/src/streaming/segments/indexes/index_reader.rs
+++ b/core/server/src/streaming/segments/indexes/index_reader.rs
@@ -20,14 +20,14 @@ use super::IggyIndexesMut;
use crate::streaming::utils::PooledBuffer;
use bytes::BytesMut;
use error_set::ErrContext;
-use iggy_common::{IggyError, IggyIndex, IggyIndexView, INDEX_SIZE};
+use iggy_common::{INDEX_SIZE, IggyError, IggyIndex, IggyIndexView};
use std::{
fs::File as StdFile,
io::ErrorKind,
os::unix::fs::FileExt,
sync::{
- atomic::{AtomicU64, Ordering},
Arc,
+ atomic::{AtomicU64, Ordering},
},
};
use tokio::fs::OpenOptions;
@@ -123,8 +123,7 @@ impl IndexReader {
if relative_start_offset >= total_indexes {
trace!(
"Start offset {} is out of bounds. Total indexes: {}",
- relative_start_offset,
- total_indexes
+ relative_start_offset, total_indexes
);
return Ok(None);
}
@@ -135,8 +134,7 @@ impl IndexReader {
if actual_count == 0 {
trace!(
"No available indexes to load. Start offset: {}, requested count: {}",
- relative_start_offset,
- count
+ relative_start_offset, count
);
return Ok(None);
}
@@ -178,9 +176,7 @@ impl IndexReader {
trace!(
"Loaded {} indexes from disk starting at offset {}, base position: {}",
- actual_count,
- relative_start_offset,
- base_position
+ actual_count, relative_start_offset, base_position
);
Ok(Some(IggyIndexesMut::from_bytes(
@@ -220,8 +216,7 @@ impl IndexReader {
if actual_count == 0 {
trace!(
"No available indexes to load. Start index pos: {}, requested count: {}",
- start_index_pos,
- count
+ start_index_pos, count
);
return Ok(None);
}
@@ -261,9 +256,7 @@ impl IndexReader {
trace!(
"Loaded {} indexes from disk starting at timestamp {}, base position: {}",
- actual_count,
- timestamp,
- base_position
+ actual_count, timestamp, base_position
);
Ok(Some(IggyIndexesMut::from_bytes(
@@ -370,8 +363,7 @@ impl IndexReader {
if position >= total_indexes {
trace!(
"Index position {} is out of bounds. Total indexes: {}",
- position,
- total_indexes
+ position, total_indexes
);
return Ok(None);
}
diff --git a/core/server/src/streaming/segments/indexes/index_writer.rs b/core/server/src/streaming/segments/indexes/index_writer.rs
index 29049993..71b18b6d 100644
--- a/core/server/src/streaming/segments/indexes/index_writer.rs
+++ b/core/server/src/streaming/segments/indexes/index_writer.rs
@@ -17,11 +17,11 @@
*/
use error_set::ErrContext;
-use iggy_common::IggyError;
use iggy_common::INDEX_SIZE;
+use iggy_common::IggyError;
use std::sync::{
- atomic::{AtomicU64, Ordering},
Arc,
+ atomic::{AtomicU64, Ordering},
};
use tokio::{
fs::{File, OpenOptions},
diff --git a/core/server/src/streaming/segments/indexes/indexes_mut.rs b/core/server/src/streaming/segments/indexes/indexes_mut.rs
index cdb358f3..6a22b475 100644
--- a/core/server/src/streaming/segments/indexes/indexes_mut.rs
+++ b/core/server/src/streaming/segments/indexes/indexes_mut.rs
@@ -17,7 +17,7 @@
*/
use crate::streaming::utils::PooledBuffer;
-use iggy_common::{IggyIndexView, INDEX_SIZE};
+use iggy_common::{INDEX_SIZE, IggyIndexView};
use std::fmt;
use std::ops::{Deref, Index as StdIndex};
diff --git a/core/server/src/streaming/segments/messages/messages_reader.rs b/core/server/src/streaming/segments/messages/messages_reader.rs
index 9c7812dc..b7e4f434 100644
--- a/core/server/src/streaming/segments/messages/messages_reader.rs
+++ b/core/server/src/streaming/segments/messages/messages_reader.rs
@@ -25,8 +25,8 @@ use std::{fs::File as StdFile, os::unix::prelude::FileExt};
use std::{
io::ErrorKind,
sync::{
- atomic::{AtomicU64, Ordering},
Arc,
+ atomic::{AtomicU64, Ordering},
},
};
use tokio::fs::OpenOptions;
@@ -60,16 +60,16 @@ impl MessagesReader {
#[cfg(not(target_os = "macos"))]
{
let _ = nix::fcntl::posix_fadvise(
- &file,
- 0,
- 0, // 0 means the entire file
- nix::fcntl::PosixFadviseAdvice::POSIX_FADV_SEQUENTIAL,
+ &file,
+ 0,
+ 0, // 0 means the entire file
+ nix::fcntl::PosixFadviseAdvice::POSIX_FADV_SEQUENTIAL,
+ )
+ .with_info_context(|error| {
+ format!(
+ "Failed to set sequential access pattern on messages file: {file_path}. {error}"
)
- .with_info_context(|error| {
- format!(
- "Failed to set sequential access pattern on messages file: {file_path}. {error}"
- )
- });
+ });
}
trace!(
diff --git a/core/server/src/streaming/segments/messages/messages_writer.rs b/core/server/src/streaming/segments/messages/messages_writer.rs
index 50164584..01a661ac 100644
--- a/core/server/src/streaming/segments/messages/messages_writer.rs
+++ b/core/server/src/streaming/segments/messages/messages_writer.rs
@@ -17,12 +17,12 @@
*/
use super::PersisterTask;
-use crate::streaming::segments::{messages::write_batch, IggyMessagesBatchSet};
+use crate::streaming::segments::{IggyMessagesBatchSet, messages::write_batch};
use error_set::ErrContext;
use iggy_common::{Confirmation, IggyByteSize, IggyError};
use std::sync::{
- atomic::{AtomicU64, Ordering},
Arc,
+ atomic::{AtomicU64, Ordering},
};
use tokio::fs::{File, OpenOptions};
use tracing::{error, trace};
diff --git a/core/server/src/streaming/segments/messages/persister_task.rs b/core/server/src/streaming/segments/messages/persister_task.rs
index 887913d2..ea0caa5a 100644
--- a/core/server/src/streaming/segments/messages/persister_task.rs
+++ b/core/server/src/streaming/segments/messages/persister_task.rs
@@ -18,11 +18,11 @@
use crate::streaming::segments::IggyMessagesBatchSet;
use error_set::ErrContext;
-use flume::{unbounded, Receiver};
+use flume::{Receiver, unbounded};
use std::{
sync::{
- atomic::{AtomicU64, Ordering},
Arc,
+ atomic::{AtomicU64, Ordering},
},
time::Duration,
};
@@ -193,9 +193,9 @@ impl PersisterTask {
}
Err(e) => {
error!(
- "Failed to persist data in LogPersisterTask for file {file_path}: {:?}",
- e
- )
+ "Failed to persist data in LogPersisterTask for file {file_path}: {:?}",
+ e
+ )
}
}
}
diff --git a/core/server/src/streaming/segments/messages_accumulator.rs b/core/server/src/streaming/segments/messages_accumulator.rs
index fe259c27..e44a1f62 100644
--- a/core/server/src/streaming/segments/messages_accumulator.rs
+++ b/core/server/src/streaming/segments/messages_accumulator.rs
@@ -76,10 +76,7 @@ impl MessagesAccumulator {
trace!(
"Coalescing batch with base_offset: {}, segment_current_offset: {}, self.messages_count: {}, batch.count: {}",
- self.base_offset,
- segment_current_offset,
- self.messages_count,
- batch_messages_count
+ self.base_offset, segment_current_offset, self.messages_count, batch_messages_count
);
self.initialize_or_update_offsets(segment_current_offset, segment_current_position);
@@ -125,8 +122,10 @@ impl MessagesAccumulator {
///
/// A batch set containing the requested messages
pub fn get_messages_by_offset(&self, start_offset: u64, count: u32) -> IggyMessagesBatchSet {
- trace!("Getting {count} messages from accumulator by offset {start_offset}, current_offset: {}, current_position: {}",
- self.current_offset, self.current_position);
+ trace!(
+ "Getting {count} messages from accumulator by offset {start_offset}, current_offset: {}, current_position: {}",
+ self.current_offset, self.current_position
+ );
self.batches.get_by_offset(start_offset, count)
}
diff --git a/core/server/src/streaming/segments/reading_messages.rs b/core/server/src/streaming/segments/reading_messages.rs
index 713d835b..4a4ba731 100644
--- a/core/server/src/streaming/segments/reading_messages.rs
+++ b/core/server/src/streaming/segments/reading_messages.rs
@@ -128,10 +128,7 @@ impl Segment {
trace!(
"Getting messages by offset: {}, count: {}, segment start_offset: {}, segment end_offset: {}",
- offset,
- count,
- self.start_offset,
- self.end_offset
+ offset, count, self.start_offset, self.end_offset
);
// Case 0: Accumulator is empty, so all messages have to be on disk
diff --git a/core/server/src/streaming/segments/segment.rs b/core/server/src/streaming/segments/segment.rs
index 545e801c..f2024d1d 100644
--- a/core/server/src/streaming/segments/segment.rs
+++ b/core/server/src/streaming/segments/segment.rs
@@ -22,13 +22,13 @@ use super::messages_accumulator::MessagesAccumulator;
use crate::configs::system::SystemConfig;
use crate::streaming::segments::*;
use error_set::ErrContext;
+use iggy_common::INDEX_SIZE;
use iggy_common::IggyByteSize;
use iggy_common::IggyError;
use iggy_common::IggyExpiry;
use iggy_common::IggyTimestamp;
-use iggy_common::INDEX_SIZE;
-use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::Arc;
+use std::sync::atomic::{AtomicU64, Ordering};
use tokio::fs::remove_file;
use tracing::{info, warn};
@@ -161,12 +161,14 @@ impl Segment {
self.end_offset = self.start_offset + last_index_offset;
- info!("Loaded {} indexes for segment with start offset: {} and partition with ID: {} for topic with ID: {} and stream with ID: {}.",
- self.indexes.count(),
- self.start_offset,
- self.partition_id,
- self.topic_id,
- self.stream_id);
+ info!(
+ "Loaded {} indexes for segment with start offset: {} and partition with ID: {} for topic with ID: {} and stream with ID: {}.",
+ self.indexes.count(),
+ self.start_offset,
+ self.partition_id,
+ self.topic_id,
+ self.stream_id
+ );
if self.is_full().await {
self.is_closed = true;
@@ -203,12 +205,16 @@ impl Segment {
/// Save the segment state to disk.
pub async fn persist(&mut self) -> Result<(), IggyError> {
- info!("Saving segment with start offset: {} for partition with ID: {} for topic with ID: {} and stream with ID: {}",
- self.start_offset, self.partition_id, self.topic_id, self.stream_id);
+ info!(
+ "Saving segment with start offset: {} for partition with ID: {} for topic with ID: {} and stream with ID: {}",
+ self.start_offset, self.partition_id, self.topic_id, self.stream_id
+ );
self.initialize_writing(false).await?;
self.initialize_reading().await?;
- info!("Saved segment log file with start offset: {} for partition with ID: {} for topic with ID: {} and stream with ID: {}",
- self.start_offset, self.partition_id, self.topic_id, self.stream_id);
+ info!(
+ "Saved segment log file with start offset: {} for partition with ID: {} for topic with ID: {} and stream with ID: {}",
+ self.start_offset, self.partition_id, self.topic_id, self.stream_id
+ );
Ok(())
}
diff --git a/core/server/src/streaming/segments/types/message_view_mut.rs b/core/server/src/streaming/segments/types/message_view_mut.rs
index 8487edc8..4a5e8b66 100644
--- a/core/server/src/streaming/segments/types/message_view_mut.rs
+++ b/core/server/src/streaming/segments/types/message_view_mut.rs
@@ -17,7 +17,7 @@
*/
use super::IggyMessageHeaderViewMut;
-use iggy_common::{calculate_checksum, IggyMessageHeaderView, IGGY_MESSAGE_HEADER_SIZE};
+use iggy_common::{IGGY_MESSAGE_HEADER_SIZE, IggyMessageHeaderView, calculate_checksum};
use lending_iterator::prelude::*;
/// A mutable view of a message for in-place modifications
diff --git a/core/server/src/streaming/segments/types/messages_batch_mut.rs b/core/server/src/streaming/segments/types/messages_batch_mut.rs
index e769d763..acf948f7 100644
--- a/core/server/src/streaming/segments/types/messages_batch_mut.rs
+++ b/core/server/src/streaming/segments/types/messages_batch_mut.rs
@@ -19,13 +19,13 @@
use super::message_view_mut::IggyMessageViewMutIterator;
use crate::streaming::deduplication::message_deduplicator::MessageDeduplicator;
use crate::streaming::segments::indexes::IggyIndexesMut;
-use crate::streaming::utils::random_id;
use crate::streaming::utils::PooledBuffer;
+use crate::streaming::utils::random_id;
use bytes::{BufMut, BytesMut};
use iggy_common::{
- BytesSerializable, IggyByteSize, IggyError, IggyIndexView, IggyMessage, IggyMessageView,
- IggyMessageViewIterator, IggyTimestamp, Sizeable, Validatable, IGGY_MESSAGE_HEADER_SIZE,
- INDEX_SIZE, MAX_PAYLOAD_SIZE, MAX_USER_HEADERS_SIZE,
+ BytesSerializable, IGGY_MESSAGE_HEADER_SIZE, INDEX_SIZE, IggyByteSize, IggyError,
+ IggyIndexView, IggyMessage, IggyMessageView, IggyMessageViewIterator, IggyTimestamp,
+ MAX_PAYLOAD_SIZE, MAX_USER_HEADERS_SIZE, Sizeable, Validatable,
};
use lending_iterator::prelude::*;
use std::ops::{Deref, Index};
@@ -662,21 +662,21 @@ impl IggyMessagesBatchMut {
if message.header().offset() < prev_offset {
error!(
- "Offset of previous message: {} is smaller than current message {} at offset {}",
- prev_offset,
- message.header().offset(),
- i
- );
+ "Offset of previous message: {} is smaller than current message {} at offset {}",
+ prev_offset,
+ message.header().offset(),
+ i
+ );
return Err(IggyError::InvalidOffset(message.header().offset()));
}
if index.position() < prev_position {
error!(
- "Position of previous message: {} is smaller than current message {} at offset {}",
- prev_position,
- index.position(),
- i
- );
+ "Position of previous message: {} is smaller than current message {} at offset {}",
+ prev_position,
+ index.position(),
+ i
+ );
return Err(IggyError::CannotReadIndexPosition);
}
@@ -748,8 +748,7 @@ impl IggyMessagesBatchMut {
None => {
error!(
"Message at index {} is missing, or message size is less than minimum message size {} B (header)",
- i,
- IGGY_MESSAGE_HEADER_SIZE
+ i, IGGY_MESSAGE_HEADER_SIZE
);
return Err(IggyError::MissingIndex(i));
}
diff --git a/core/server/src/streaming/segments/writing_messages.rs b/core/server/src/streaming/segments/writing_messages.rs
index ff332f77..ddfa1d86 100644
--- a/core/server/src/streaming/segments/writing_messages.rs
+++ b/core/server/src/streaming/segments/writing_messages.rs
@@ -77,9 +77,7 @@ impl Segment {
let unsaved_messages_count = self.accumulator.unsaved_messages_count();
trace!(
"Saving {} messages on disk in segment with start offset: {} for partition with ID: {}...",
- unsaved_messages_count,
- self.start_offset,
- self.partition_id
+ unsaved_messages_count, self.start_offset, self.partition_id
);
let accumulator = std::mem::take(&mut self.accumulator);
@@ -132,10 +130,7 @@ impl Segment {
trace!(
"Saved {} messages on disk in segment with start offset: {} for partition with ID: {}, total bytes written: {}.",
- unsaved_messages_count,
- self.start_offset,
- self.partition_id,
- saved_bytes
+ unsaved_messages_count, self.start_offset, self.partition_id, saved_bytes
);
Ok(unsaved_messages_count)
@@ -177,7 +172,10 @@ impl Segment {
self.shutdown_writing().await;
info!(
"Closed segment with start offset: {}, end offset: {}, size: {} for partition with ID: {}.",
- self.start_offset, self.end_offset, self.get_messages_size(), self.partition_id
+ self.start_offset,
+ self.end_offset,
+ self.get_messages_size(),
+ self.partition_id
);
self.is_closed = true;
}
diff --git a/core/server/src/streaming/storage.rs b/core/server/src/streaming/storage.rs
index b7f4fbb3..fc0a752d 100644
--- a/core/server/src/streaming/storage.rs
+++ b/core/server/src/streaming/storage.rs
@@ -119,7 +119,7 @@ pub trait PartitionStorage: Send {
state: PartitionState,
) -> impl Future<Output = Result<(), IggyError>> + Send;
fn save(&self, partition: &mut Partition)
- -> impl Future<Output = Result<(), IggyError>> + Send;
+ -> impl Future<Output = Result<(), IggyError>> + Send;
fn delete(&self, partition: &Partition) -> impl Future<Output = Result<(), IggyError>> + Send;
fn save_consumer_offset(
&self,
diff --git a/core/server/src/streaming/streams/persistence.rs b/core/server/src/streaming/streams/persistence.rs
index 0488cd6d..3f5cae9e 100644
--- a/core/server/src/streaming/streams/persistence.rs
+++ b/core/server/src/streaming/streams/persistence.rs
@@ -17,8 +17,8 @@
*/
use crate::state::system::StreamState;
-use crate::streaming::streams::stream::Stream;
use crate::streaming::streams::COMPONENT;
+use crate::streaming::streams::stream::Stream;
use error_set::ErrContext;
use iggy_common::IggyError;
diff --git a/core/server/src/streaming/streams/storage.rs b/core/server/src/streaming/streams/storage.rs
index 91476386..3e3e5e76 100644
--- a/core/server/src/streaming/streams/storage.rs
+++ b/core/server/src/streaming/streams/storage.rs
@@ -18,8 +18,8 @@
use crate::state::system::StreamState;
use crate::streaming::storage::StreamStorage;
-use crate::streaming::streams::stream::Stream;
use crate::streaming::streams::COMPONENT;
+use crate::streaming::streams::stream::Stream;
use crate::streaming::topics::topic::Topic;
use ahash::AHashSet;
use error_set::ErrContext;
@@ -69,11 +69,15 @@ impl StreamStorage for FileStreamStorage {
let topic_state = state.topics.get(&topic_id);
if topic_state.is_none() {
let stream_id = stream.stream_id;
- error!("Topic with ID: '{topic_id}' for stream with ID: '{stream_id}' was not found in state, but exists on disk and will be removed.");
+ error!(
+ "Topic with ID: '{topic_id}' for stream with ID: '{stream_id}' was not found in state, but exists on disk and will be removed."
+ );
if let Err(error) = fs::remove_dir_all(&dir_entry.path()).await {
error!("Cannot remove topic directory: {error}");
} else {
- warn!("Topic with ID: '{topic_id}' for stream with ID: '{stream_id}' was removed.");
+ warn!(
+ "Topic with ID: '{topic_id}' for stream with ID: '{stream_id}' was removed."
+ );
}
continue;
}
@@ -108,12 +112,15 @@ impl StreamStorage for FileStreamStorage {
stream.stream_id
);
} else {
- warn!("Topics with IDs: '{missing_ids:?}' for stream with ID: '{}' were not found on disk.", stream.stream_id);
- if stream.config.recovery.recreate_missing_state {
- info!(
- "Recreating missing state in recovery config is enabled, missing topics will be created for stream with ID: '{}'.",
+ warn!(
+ "Topics with IDs: '{missing_ids:?}' for stream with ID: '{}' were not found on disk.",
stream.stream_id
);
+ if stream.config.recovery.recreate_missing_state {
+ info!(
+ "Recreating missing state in recovery config is enabled, missing topics will be created for stream with ID: '{}'.",
+ stream.stream_id
+ );
for topic_id in missing_ids {
let topic_state = state.topics.get(&topic_id).unwrap();
let topic = Topic::empty(
@@ -137,7 +144,10 @@ impl StreamStorage for FileStreamStorage {
);
}
} else {
- warn!("Recreating missing state in recovery config is disabled, missing topics will not be created for stream with ID: '{}'.", stream.stream_id);
+ warn!(
+ "Recreating missing state in recovery config is disabled, missing topics will not be created for stream with ID: '{}'.",
+ stream.stream_id
+ );
}
}
diff --git a/core/server/src/streaming/streams/stream.rs b/core/server/src/streaming/streams/stream.rs
index d73c0e50..ef528197 100644
--- a/core/server/src/streaming/streams/stream.rs
+++ b/core/server/src/streaming/streams/stream.rs
@@ -23,8 +23,8 @@ use ahash::AHashMap;
use iggy_common::IggyByteSize;
use iggy_common::IggyTimestamp;
use std::fmt::Display;
-use std::sync::atomic::{AtomicU32, AtomicU64, Ordering};
use std::sync::Arc;
+use std::sync::atomic::{AtomicU32, AtomicU64, Ordering};
#[derive(Debug)]
pub struct Stream {
diff --git a/core/server/src/streaming/streams/topics.rs b/core/server/src/streaming/streams/topics.rs
index ef5cb45f..f8c742be 100644
--- a/core/server/src/streaming/streams/topics.rs
+++ b/core/server/src/streaming/streams/topics.rs
@@ -16,15 +16,15 @@
* under the License.
*/
-use crate::streaming::streams::stream::Stream;
use crate::streaming::streams::COMPONENT;
+use crate::streaming::streams::stream::Stream;
use crate::streaming::topics::topic::Topic;
use error_set::ErrContext;
-use iggy_common::locking::IggySharedMutFn;
use iggy_common::CompressionAlgorithm;
use iggy_common::IggyError;
use iggy_common::IggyExpiry;
use iggy_common::MaxTopicSize;
+use iggy_common::locking::IggySharedMutFn;
use iggy_common::{IdKind, Identifier};
use std::sync::atomic::Ordering;
use tracing::info;
diff --git a/core/server/src/streaming/systems/clients.rs b/core/server/src/streaming/systems/clients.rs
index 35cdc7ff..050a0b58 100644
--- a/core/server/src/streaming/systems/clients.rs
+++ b/core/server/src/streaming/systems/clients.rs
@@ -18,13 +18,13 @@
use crate::streaming::clients::client_manager::{Client, Transport};
use crate::streaming::session::Session;
-use crate::streaming::systems::system::System;
use crate::streaming::systems::COMPONENT;
+use crate::streaming::systems::system::System;
use error_set::ErrContext;
-use iggy_common::locking::IggySharedMut;
-use iggy_common::locking::IggySharedMutFn;
use iggy_common::Identifier;
use iggy_common::IggyError;
+use iggy_common::locking::IggySharedMut;
+use iggy_common::locking::IggySharedMutFn;
use std::net::SocketAddr;
use std::sync::Arc;
use tracing::{error, info};
diff --git a/core/server/src/streaming/systems/consumer_groups.rs b/core/server/src/streaming/systems/consumer_groups.rs
index 45c73ac0..4303dc4d 100644
--- a/core/server/src/streaming/systems/consumer_groups.rs
+++ b/core/server/src/streaming/systems/consumer_groups.rs
@@ -17,13 +17,13 @@
*/
use crate::streaming::session::Session;
-use crate::streaming::systems::system::System;
use crate::streaming::systems::COMPONENT;
+use crate::streaming::systems::system::System;
use crate::streaming::topics::consumer_group::ConsumerGroup;
use error_set::ErrContext;
-use iggy_common::locking::IggySharedMutFn;
use iggy_common::Identifier;
use iggy_common::IggyError;
+use iggy_common::locking::IggySharedMutFn;
use tokio::sync::RwLock;
impl System {
diff --git a/core/server/src/streaming/systems/consumer_offsets.rs b/core/server/src/streaming/systems/consumer_offsets.rs
index 72aae553..fdac2b0c 100644
--- a/core/server/src/streaming/systems/consumer_offsets.rs
+++ b/core/server/src/streaming/systems/consumer_offsets.rs
@@ -17,8 +17,8 @@
*/
use crate::streaming::session::Session;
-use crate::streaming::systems::system::System;
use crate::streaming::systems::COMPONENT;
+use crate::streaming::systems::system::System;
use error_set::ErrContext;
use iggy_common::{Consumer, ConsumerOffsetInfo, Identifier, IggyError};
diff --git a/core/server/src/streaming/systems/info.rs b/core/server/src/streaming/systems/info.rs
index dc1da46b..61c1bcbb 100644
--- a/core/server/src/streaming/systems/info.rs
+++ b/core/server/src/streaming/systems/info.rs
@@ -70,11 +70,15 @@ impl System {
if current_version.is_equal_to(&loaded_version) {
info!("System version {current_version} is up to date.");
} else if current_version.is_greater_than(&loaded_version) {
- info!("System version {current_version} is greater than {loaded_version}, checking the available migrations...");
+ info!(
+ "System version {current_version} is greater than {loaded_version}, checking the available migrations..."
+ );
self.update_system_info(&mut system_info, ¤t_version)
.await?;
} else {
- info!("System version {current_version} is lower than {loaded_version}, possible downgrade.");
+ info!(
+ "System version {current_version} is lower than {loaded_version}, possible downgrade."
+ );
self.update_system_info(&mut system_info, ¤t_version)
.await?;
}
diff --git a/core/server/src/streaming/systems/messages.rs b/core/server/src/streaming/systems/messages.rs
index ae4fd339..53ed0432 100644
--- a/core/server/src/streaming/systems/messages.rs
+++ b/core/server/src/streaming/systems/messages.rs
@@ -19,13 +19,13 @@
use crate::binary::handlers::messages::poll_messages_handler::IggyPollMetadata;
use crate::streaming::segments::{IggyIndexesMut, IggyMessagesBatchMut, IggyMessagesBatchSet};
use crate::streaming::session::Session;
-use crate::streaming::systems::system::System;
use crate::streaming::systems::COMPONENT;
+use crate::streaming::systems::system::System;
use crate::streaming::utils::PooledBuffer;
use error_set::ErrContext;
use iggy_common::{
- BytesSerializable, Confirmation, Consumer, EncryptorKind, Identifier, IggyError, Partitioning,
- PollingStrategy, IGGY_MESSAGE_HEADER_SIZE,
+ BytesSerializable, Confirmation, Consumer, EncryptorKind, IGGY_MESSAGE_HEADER_SIZE, Identifier,
+ IggyError, Partitioning, PollingStrategy,
};
use tracing::{error, trace};
@@ -74,7 +74,10 @@ impl System {
let offset = batch_set
.last_offset()
.expect("Batch set should have at least one batch");
- trace!("Last offset: {} will be automatically stored for {}, stream: {}, topic: {}, partition: {}", offset, consumer, stream_id, topic_id, partition_id);
+ trace!(
+ "Last offset: {} will be automatically stored for {}, stream: {}, topic: {}, partition: {}",
+ offset, consumer, stream_id, topic_id, partition_id
+ );
topic
.store_consumer_offset_internal(polling_consumer, offset, partition_id)
.await
diff --git a/core/server/src/streaming/systems/partitions.rs b/core/server/src/streaming/systems/partitions.rs
index ff728358..5bb72875 100644
--- a/core/server/src/streaming/systems/partitions.rs
+++ b/core/server/src/streaming/systems/partitions.rs
@@ -17,8 +17,8 @@
*/
use crate::streaming::session::Session;
-use crate::streaming::systems::system::System;
use crate::streaming::systems::COMPONENT;
+use crate::streaming::systems::system::System;
use error_set::ErrContext;
use iggy_common::Identifier;
use iggy_common::IggyError;
diff --git a/core/server/src/streaming/systems/personal_access_tokens.rs b/core/server/src/streaming/systems/personal_access_tokens.rs
index f85ea0c5..945c853b 100644
--- a/core/server/src/streaming/systems/personal_access_tokens.rs
+++ b/core/server/src/streaming/systems/personal_access_tokens.rs
@@ -18,8 +18,8 @@
use crate::streaming::personal_access_tokens::personal_access_token::PersonalAccessToken;
use crate::streaming::session::Session;
-use crate::streaming::systems::system::System;
use crate::streaming::systems::COMPONENT;
+use crate::streaming::systems::system::System;
use crate::streaming::users::user::User;
use error_set::ErrContext;
use iggy_common::IggyError;
@@ -69,8 +69,8 @@ impl System {
let max_token_per_user = self.personal_access_token.max_tokens_per_user;
if user.personal_access_tokens.len() as u32 >= max_token_per_user {
error!(
- "User with ID: {user_id} has reached the maximum number of personal access tokens: {max_token_per_user}.",
- );
+ "User with ID: {user_id} has reached the maximum number of personal access tokens: {max_token_per_user}.",
+ );
return Err(IggyError::PersonalAccessTokensLimitReached(
user_id,
max_token_per_user,
diff --git a/core/server/src/streaming/systems/segments.rs b/core/server/src/streaming/systems/segments.rs
index eac24cfa..a15952c1 100644
--- a/core/server/src/streaming/systems/segments.rs
+++ b/core/server/src/streaming/systems/segments.rs
@@ -16,12 +16,12 @@
* under the License.
*/
use crate::streaming::session::Session;
-use crate::streaming::systems::system::System;
use crate::streaming::systems::COMPONENT;
+use crate::streaming::systems::system::System;
use error_set::ErrContext;
-use iggy_common::locking::IggySharedMutFn;
use iggy_common::Identifier;
use iggy_common::IggyError;
+use iggy_common::locking::IggySharedMutFn;
impl System {
pub async fn delete_segments(
diff --git a/core/server/src/streaming/systems/stats.rs b/core/server/src/streaming/systems/stats.rs
index e6df09d7..80c588e6 100644
--- a/core/server/src/streaming/systems/stats.rs
+++ b/core/server/src/streaming/systems/stats.rs
@@ -16,9 +16,9 @@
* under the License.
*/
+use crate::VERSION;
use crate::streaming::systems::system::System;
use crate::versioning::SemanticVersion;
-use crate::VERSION;
use iggy_common::locking::IggySharedMutFn;
use iggy_common::{IggyDuration, IggyError, Stats};
use std::sync::OnceLock;
diff --git a/core/server/src/streaming/systems/storage.rs b/core/server/src/streaming/systems/storage.rs
index 0934c952..d4363631 100644
--- a/core/server/src/streaming/systems/storage.rs
+++ b/core/server/src/streaming/systems/storage.rs
@@ -18,10 +18,10 @@
use crate::streaming::persistence::persister::PersisterKind;
use crate::streaming::storage::SystemInfoStorage;
-use crate::streaming::systems::info::SystemInfo;
use crate::streaming::systems::COMPONENT;
-use crate::streaming::utils::file;
+use crate::streaming::systems::info::SystemInfo;
use crate::streaming::utils::PooledBuffer;
+use crate::streaming::utils::file;
use anyhow::Context;
use error_set::ErrContext;
use iggy_common::IggyError;
diff --git a/core/server/src/streaming/systems/streams.rs b/core/server/src/streaming/systems/streams.rs
index 715fbb0b..a22a8a83 100644
--- a/core/server/src/streaming/systems/streams.rs
+++ b/core/server/src/streaming/systems/streams.rs
@@ -19,8 +19,8 @@
use crate::state::system::StreamState;
use crate::streaming::session::Session;
use crate::streaming::streams::stream::Stream;
-use crate::streaming::systems::system::System;
use crate::streaming::systems::COMPONENT;
+use crate::streaming::systems::system::System;
use ahash::{AHashMap, AHashSet};
use error_set::ErrContext;
use futures::future::try_join_all;
@@ -56,7 +56,9 @@ impl System {
})?;
let stream_state = streams.iter().find(|s| s.id == stream_id);
if stream_state.is_none() {
- error!("Stream with ID: '{stream_id}' was not found in state, but exists on disk and will be removed.");
+ error!(
+ "Stream with ID: '{stream_id}' was not found in state, but exists on disk and will be removed."
+ );
if let Err(error) = fs::remove_dir_all(&dir_entry.path()).await {
error!("Cannot remove stream directory: {error}");
} else {
@@ -93,7 +95,9 @@ impl System {
} else {
warn!("Streams with IDs: '{missing_ids:?}' were not found on disk.");
if self.config.recovery.recreate_missing_state {
- info!("Recreating missing state in recovery config is enabled, missing streams will be created.");
+ info!(
+ "Recreating missing state in recovery config is enabled, missing streams will be created."
+ );
for stream_id in missing_ids.iter() {
let stream_id = *stream_id;
let stream_state = streams.iter().find(|s| s.id == stream_id).unwrap();
@@ -112,7 +116,9 @@ impl System {
}
missing_ids.clear();
} else {
- warn!("Recreating missing state in recovery config is disabled, missing streams will not be created.");
+ warn!(
+ "Recreating missing state in recovery config is disabled, missing streams will not be created."
+ );
}
}
diff --git a/core/server/src/streaming/systems/system.rs b/core/server/src/streaming/systems/system.rs
index 6a8f3975..761f6d1b 100644
--- a/core/server/src/streaming/systems/system.rs
+++ b/core/server/src/streaming/systems/system.rs
@@ -20,9 +20,9 @@ use crate::archiver::{ArchiverKind, ArchiverKindType};
use crate::configs::server::{DataMaintenanceConfig, PersonalAccessTokenConfig};
use crate::configs::system::SystemConfig;
use crate::map_toggle_str;
+use crate::state::StateKind;
use crate::state::file::FileState;
use crate::state::system::SystemState;
-use crate::state::StateKind;
use crate::streaming::clients::client_manager::ClientManager;
use crate::streaming::diagnostics::metrics::Metrics;
use crate::streaming::persistence::persister::*;
diff --git a/core/server/src/streaming/systems/topics.rs b/core/server/src/streaming/systems/topics.rs
index 080c7ff9..a61f5464 100644
--- a/core/server/src/streaming/systems/topics.rs
+++ b/core/server/src/streaming/systems/topics.rs
@@ -17,8 +17,8 @@
*/
use crate::streaming::session::Session;
-use crate::streaming::systems::system::System;
use crate::streaming::systems::COMPONENT;
+use crate::streaming::systems::system::System;
use crate::streaming::topics::topic::Topic;
use error_set::ErrContext;
use iggy_common::locking::IggySharedMutFn;
diff --git a/core/server/src/streaming/systems/users.rs b/core/server/src/streaming/systems/users.rs
index 8c07edb8..cc27fcae 100644
--- a/core/server/src/streaming/systems/users.rs
+++ b/core/server/src/streaming/systems/users.rs
@@ -21,22 +21,22 @@ use crate::state::models::CreateUserWithId;
use crate::state::system::UserState;
use crate::streaming::personal_access_tokens::personal_access_token::PersonalAccessToken;
use crate::streaming::session::Session;
-use crate::streaming::systems::system::System;
use crate::streaming::systems::COMPONENT;
+use crate::streaming::systems::system::System;
use crate::streaming::users::user::User;
use crate::streaming::utils::crypto;
use crate::{IGGY_ROOT_PASSWORD_ENV, IGGY_ROOT_USERNAME_ENV};
use error_set::ErrContext;
-use iggy_common::create_user::CreateUser;
-use iggy_common::defaults::*;
-use iggy_common::locking::IggySharedMutFn;
use iggy_common::IggyError;
use iggy_common::Permissions;
use iggy_common::UserStatus;
+use iggy_common::create_user::CreateUser;
+use iggy_common::defaults::*;
+use iggy_common::locking::IggySharedMutFn;
use iggy_common::{IdKind, Identifier};
use std::env;
-use std::sync::atomic::{AtomicU32, Ordering};
use std::sync::Arc;
+use std::sync::atomic::{AtomicU32, Ordering};
use tracing::{error, info, warn};
static USER_ID: AtomicU32 = AtomicU32::new(1);
@@ -113,7 +113,9 @@ impl System {
let username = env::var(IGGY_ROOT_USERNAME_ENV);
let password = env::var(IGGY_ROOT_PASSWORD_ENV);
if (username.is_ok() && password.is_err()) || (username.is_err() && password.is_ok()) {
- panic!("When providing the custom root user credentials, both username and password must be set.");
+ panic!(
+ "When providing the custom root user credentials, both username and password must be set."
+ );
}
if username.is_ok() && password.is_ok() {
info!("Using the custom root user credentials.");
diff --git a/core/server/src/streaming/topics/consumer_group.rs b/core/server/src/streaming/topics/consumer_group.rs
index d015c15d..dedb29c7 100644
--- a/core/server/src/streaming/topics/consumer_group.rs
+++ b/core/server/src/streaming/topics/consumer_group.rs
@@ -94,9 +94,7 @@ impl ConsumerGroup {
);
trace!(
"Added member with ID: {} to consumer group: {} for topic with ID: {}",
- member_id,
- self.group_id,
- self.topic_id
+ member_id, self.group_id, self.topic_id
);
self.assign_partitions().await;
}
@@ -105,9 +103,7 @@ impl ConsumerGroup {
if self.members.remove(&member_id).is_some() {
trace!(
"Deleted member with ID: {} in consumer group: {} for topic with ID: {}",
- member_id,
- self.group_id,
- self.topic_id
+ member_id, self.group_id, self.topic_id
);
self.assign_partitions().await;
}
@@ -140,8 +136,10 @@ impl ConsumerGroup {
member.current_partition_id = Some(partition_id);
member.current_partition_index = Some(member_partition_index);
}
- trace!("Assigned partition ID: {} to member with ID: {} for topic with ID: {} in consumer group: {}",
- partition_id, member.id, self.topic_id, self.group_id)
+ trace!(
+ "Assigned partition ID: {} to member with ID: {} for topic with ID: {} in consumer group: {}",
+ partition_id, member.id, self.topic_id, self.group_id
+ )
}
}
}
@@ -156,8 +154,7 @@ impl ConsumerGroupMember {
let Some(partition_id) = self.partitions.get(&partition_index) else {
trace!(
"No partition ID found for index: {} for member with ID: {}.",
- partition_index,
- self.id
+ partition_index, self.id
);
return None;
};
@@ -171,8 +168,7 @@ impl ConsumerGroupMember {
}
trace!(
"Calculated partition ID: {} for member with ID: {}",
- partition_id,
- self.id
+ partition_id, self.id
);
Some(partition_id)
}
diff --git a/core/server/src/streaming/topics/consumer_groups.rs b/core/server/src/streaming/topics/consumer_groups.rs
index ea18f590..dec2f163 100644
--- a/core/server/src/streaming/topics/consumer_groups.rs
+++ b/core/server/src/streaming/topics/consumer_groups.rs
@@ -16,12 +16,12 @@
* under the License.
*/
+use crate::streaming::topics::COMPONENT;
use crate::streaming::topics::consumer_group::ConsumerGroup;
use crate::streaming::topics::topic::Topic;
-use crate::streaming::topics::COMPONENT;
use error_set::ErrContext;
-use iggy_common::locking::IggySharedMutFn;
use iggy_common::IggyError;
+use iggy_common::locking::IggySharedMutFn;
use iggy_common::{IdKind, Identifier};
use std::sync::atomic::Ordering;
use tokio::sync::RwLock;
@@ -238,8 +238,8 @@ mod tests {
use crate::streaming::storage::SystemStorage;
use crate::streaming::utils::MemoryPool;
use iggy_common::{CompressionAlgorithm, IggyExpiry, MaxTopicSize};
- use std::sync::atomic::{AtomicU32, AtomicU64};
use std::sync::Arc;
+ use std::sync::atomic::{AtomicU32, AtomicU64};
#[tokio::test]
async fn should_be_created_given_valid_parameters() {
diff --git a/core/server/src/streaming/topics/consumer_offsets.rs b/core/server/src/streaming/topics/consumer_offsets.rs
index 201d8840..8558acbc 100644
--- a/core/server/src/streaming/topics/consumer_offsets.rs
+++ b/core/server/src/streaming/topics/consumer_offsets.rs
@@ -17,11 +17,11 @@
*/
use crate::streaming::polling_consumer::PollingConsumer;
-use crate::streaming::topics::topic::Topic;
use crate::streaming::topics::COMPONENT;
+use crate::streaming::topics::topic::Topic;
use error_set::ErrContext;
-use iggy_common::locking::IggySharedMutFn;
use iggy_common::IggyError;
+use iggy_common::locking::IggySharedMutFn;
use iggy_common::{Consumer, ConsumerOffsetInfo};
impl Topic {
@@ -39,9 +39,13 @@ impl Topic {
return Err(IggyError::ConsumerOffsetNotFound(client_id));
};
- let partition = self.get_partition(partition_id).with_error_context(|error| {
- format!("{COMPONENT} (error: {error}) - failed to get partition with id: {partition_id}")
- })?;
+ let partition = self
+ .get_partition(partition_id)
+ .with_error_context(|error| {
+ format!(
+ "{COMPONENT} (error: {error}) - failed to get partition with id: {partition_id}"
+ )
+ })?;
let partition = partition.read().await;
partition
.store_consumer_offset(polling_consumer, offset)
@@ -55,9 +59,13 @@ impl Topic {
offset: u64,
partition_id: u32,
) -> Result<(), IggyError> {
- let partition = self.get_partition(partition_id).with_error_context(|error| {
- format!("{COMPONENT} (error: {error}) - failed to get partition with id: {partition_id}")
- })?;
+ let partition = self
+ .get_partition(partition_id)
+ .with_error_context(|error| {
+ format!(
+ "{COMPONENT} (error: {error}) - failed to get partition with id: {partition_id}"
+ )
+ })?;
let partition = partition.read().await;
partition.store_consumer_offset(consumer, offset).await.with_error_context(|error| format!("{COMPONENT} (error: {error}) - failed to store consumer offset, consumer: {consumer}, offset: {offset}"))
}
@@ -75,9 +83,13 @@ impl Topic {
return Ok(None);
};
- let partition = self.get_partition(partition_id).with_error_context(|error| {
- format!("{COMPONENT} (error: {error}) - failed to get partition with ID: {partition_id}")
- })?;
+ let partition = self
+ .get_partition(partition_id)
+ .with_error_context(|error| {
+ format!(
+ "{COMPONENT} (error: {error}) - failed to get partition with ID: {partition_id}"
+ )
+ })?;
let partition = partition.read().await;
let offset = partition
.get_consumer_offset(polling_consumer)
@@ -111,9 +123,13 @@ impl Topic {
return Err(IggyError::ConsumerOffsetNotFound(client_id));
};
- let partition = self.get_partition(partition_id).with_error_context(|error| {
- format!("{COMPONENT} (error: {error}) - failed to get partition with id: {partition_id}")
- })?;
+ let partition = self
+ .get_partition(partition_id)
+ .with_error_context(|error| {
+ format!(
+ "{COMPONENT} (error: {error}) - failed to get partition with id: {partition_id}"
+ )
+ })?;
let mut partition = partition.write().await;
partition
.delete_consumer_offset(polling_consumer)
diff --git a/core/server/src/streaming/topics/messages.rs b/core/server/src/streaming/topics/messages.rs
index 431b2faf..56d7c1c7 100644
--- a/core/server/src/streaming/topics/messages.rs
+++ b/core/server/src/streaming/topics/messages.rs
@@ -19,8 +19,8 @@
use crate::binary::handlers::messages::poll_messages_handler::IggyPollMetadata;
use crate::streaming::polling_consumer::PollingConsumer;
use crate::streaming::segments::{IggyMessagesBatchMut, IggyMessagesBatchSet};
-use crate::streaming::topics::topic::Topic;
use crate::streaming::topics::COMPONENT;
+use crate::streaming::topics::topic::Topic;
use crate::streaming::utils::hash;
use ahash::AHashMap;
use error_set::ErrContext;
@@ -175,9 +175,7 @@ impl Topic {
}
trace!(
"Calculated partition ID: {} for messages key: {:?}, hash: {}",
- partition_id,
- messages_key,
- messages_key_hash
+ partition_id, messages_key, messages_key_hash
);
partition_id
}
@@ -211,9 +209,9 @@ mod tests {
use bytes::Bytes;
use iggy_common::CompressionAlgorithm;
use iggy_common::{IggyMessage, MaxTopicSize};
+ use std::sync::Arc;
use std::sync::atomic::AtomicU32;
use std::sync::atomic::AtomicU64;
- use std::sync::Arc;
#[tokio::test]
async fn given_partition_id_key_messages_should_be_appended_only_to_the_chosen_partition() {
@@ -283,8 +281,8 @@ mod tests {
}
#[tokio::test]
- async fn given_multiple_partitions_calculate_next_partition_id_should_return_next_partition_id_using_round_robin(
- ) {
+ async fn given_multiple_partitions_calculate_next_partition_id_should_return_next_partition_id_using_round_robin()
+ {
let partitions_count = 3;
let messages_count = 1000;
let topic = init_topic(partitions_count).await;
@@ -302,8 +300,8 @@ mod tests {
}
#[tokio::test]
- async fn given_multiple_partitions_calculate_partition_id_by_hash_should_return_next_partition_id(
- ) {
+ async fn given_multiple_partitions_calculate_partition_id_by_hash_should_return_next_partition_id()
+ {
let partitions_count = 3;
let messages_count = 1000;
let topic = init_topic(partitions_count).await;
diff --git a/core/server/src/streaming/topics/partitions.rs b/core/server/src/streaming/topics/partitions.rs
index e58347a0..eb6b4280 100644
--- a/core/server/src/streaming/topics/partitions.rs
+++ b/core/server/src/streaming/topics/partitions.rs
@@ -17,8 +17,8 @@
*/
use crate::streaming::partitions::partition::Partition;
-use crate::streaming::topics::topic::Topic;
use crate::streaming::topics::COMPONENT;
+use crate::streaming::topics::topic::Topic;
use error_set::ErrContext;
use iggy_common::locking::{IggySharedMut, IggySharedMutFn};
use iggy_common::{IggyError, IggyTimestamp};
diff --git a/core/server/src/streaming/topics/persistence.rs b/core/server/src/streaming/topics/persistence.rs
index 9c55fa07..a423c67d 100644
--- a/core/server/src/streaming/topics/persistence.rs
+++ b/core/server/src/streaming/topics/persistence.rs
@@ -17,11 +17,11 @@
*/
use crate::state::system::TopicState;
-use crate::streaming::topics::topic::Topic;
use crate::streaming::topics::COMPONENT;
+use crate::streaming::topics::topic::Topic;
use error_set::ErrContext;
-use iggy_common::locking::IggySharedMutFn;
use iggy_common::IggyError;
+use iggy_common::locking::IggySharedMutFn;
impl Topic {
pub async fn load(&mut self, state: TopicState) -> Result<(), IggyError> {
diff --git a/core/server/src/streaming/topics/storage.rs b/core/server/src/streaming/topics/storage.rs
index 4834d075..1cc33310 100644
--- a/core/server/src/streaming/topics/storage.rs
+++ b/core/server/src/streaming/topics/storage.rs
@@ -19,16 +19,16 @@
use crate::state::system::TopicState;
use crate::streaming::partitions::partition::Partition;
use crate::streaming::storage::TopicStorage;
+use crate::streaming::topics::COMPONENT;
use crate::streaming::topics::consumer_group::ConsumerGroup;
use crate::streaming::topics::topic::Topic;
-use crate::streaming::topics::COMPONENT;
use ahash::AHashSet;
use anyhow::Context;
use error_set::ErrContext;
use futures::future::join_all;
+use iggy_common::IggyError;
use iggy_common::locking::IggySharedMut;
use iggy_common::locking::IggySharedMutFn;
-use iggy_common::IggyError;
use serde::{Deserialize, Serialize};
use std::path::Path;
use std::sync::Arc;
@@ -85,11 +85,15 @@ impl TopicStorage for FileTopicStorage {
if partition_state.is_none() {
let stream_id = topic.stream_id;
let topic_id = topic.topic_id;
- error!("Partition with ID: '{partition_id}' for stream with ID: '{stream_id}' and topic with ID: '{topic_id}' was not found in state, but exists on disk and will be removed.");
+ error!(
+ "Partition with ID: '{partition_id}' for stream with ID: '{stream_id}' and topic with ID: '{topic_id}' was not found in state, but exists on disk and will be removed."
+ );
if let Err(error) = fs::remove_dir_all(&dir_entry.path()).await {
error!("Cannot remove partition directory: {error}");
} else {
- warn!("Partition with ID: '{partition_id}' for stream with ID: '{stream_id}' and topic with ID: '{topic_id}' was removed.");
+ warn!(
+ "Partition with ID: '{partition_id}' for stream with ID: '{stream_id}' and topic with ID: '{topic_id}' was removed."
+ );
}
continue;
}
@@ -131,7 +135,8 @@ impl TopicStorage for FileTopicStorage {
} else {
warn!(
"Partitions with IDs: '{missing_ids:?}' for topic with ID: '{topic_id}' for stream with ID: '{stream_id}' were not found on disk.",
- topic_id = topic.topic_id, stream_id = topic.stream_id
+ topic_id = topic.topic_id,
+ stream_id = topic.stream_id
);
if topic.config.recovery.recreate_missing_state {
info!(
@@ -165,12 +170,15 @@ impl TopicStorage for FileTopicStorage {
partition.segments.clear();
unloaded_partitions.push(partition);
info!(
- "Created missing partition with ID: '{partition_id}', for topic with ID: '{}' for stream with ID: '{}'.",
- topic.topic_id, topic.stream_id
- );
+ "Created missing partition with ID: '{partition_id}', for topic with ID: '{}' for stream with ID: '{}'.",
+ topic.topic_id, topic.stream_id
+ );
}
} else {
- warn!("Recreating missing state in recovery config is disabled, missing partitions will not be created for topic with ID: '{}' for stream with ID: '{}'.", topic.topic_id, topic.stream_id);
+ warn!(
+ "Recreating missing state in recovery config is disabled, missing partitions will not be created for topic with ID: '{}' for stream with ID: '{}'.",
+ topic.topic_id, topic.stream_id
+ );
}
}
@@ -189,7 +197,8 @@ impl TopicStorage for FileTopicStorage {
Err(error) => {
error!(
"Failed to load partition with ID: {} for stream with ID: {stream_id} and topic with ID: {topic_id}. Error: {error}",
- partition.partition_id);
+ partition.partition_id
+ );
}
}
});
diff --git a/core/server/src/streaming/topics/topic.rs b/core/server/src/streaming/topics/topic.rs
index 3fd809bb..b0913856 100644
--- a/core/server/src/streaming/topics/topic.rs
+++ b/core/server/src/streaming/topics/topic.rs
@@ -29,8 +29,8 @@ use iggy_common::{
IggyTimestamp, MaxTopicSize, Sizeable,
};
-use std::sync::atomic::{AtomicU32, AtomicU64, Ordering};
use std::sync::Arc;
+use std::sync::atomic::{AtomicU32, AtomicU64, Ordering};
use tokio::sync::RwLock;
use tracing::info;
diff --git a/core/server/src/streaming/users/user.rs b/core/server/src/streaming/users/user.rs
index 4fcae0c0..01a9faa0 100644
--- a/core/server/src/streaming/users/user.rs
+++ b/core/server/src/streaming/users/user.rs
@@ -18,9 +18,9 @@
use crate::streaming::personal_access_tokens::personal_access_token::PersonalAccessToken;
use crate::streaming::utils::crypto;
use dashmap::DashMap;
-use iggy_common::defaults::*;
use iggy_common::IggyTimestamp;
use iggy_common::UserStatus;
+use iggy_common::defaults::*;
use iggy_common::{Permissions, UserId};
use std::sync::Arc;
diff --git a/core/server/src/streaming/utils/file.rs b/core/server/src/streaming/utils/file.rs
index e8bc0840..af26454d 100644
--- a/core/server/src/streaming/utils/file.rs
+++ b/core/server/src/streaming/utils/file.rs
@@ -17,7 +17,7 @@
*/
use std::path::Path;
-use tokio::fs::{remove_file, File, OpenOptions};
+use tokio::fs::{File, OpenOptions, remove_file};
pub async fn open(path: &str) -> Result<File, std::io::Error> {
OpenOptions::new().read(true).open(path).await
diff --git a/core/server/src/streaming/utils/memory_pool.rs b/core/server/src/streaming/utils/memory_pool.rs
index db52b848..d52c92f5 100644
--- a/core/server/src/streaming/utils/memory_pool.rs
+++ b/core/server/src/streaming/utils/memory_pool.rs
@@ -21,8 +21,8 @@ use bytes::BytesMut;
use crossbeam::queue::ArrayQueue;
use human_repr::HumanCount;
use once_cell::sync::OnceCell;
-use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
use std::sync::Arc;
+use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
use tracing::{info, trace, warn};
/// Global memory pool instance. Use `memory_pool()` to access it.
@@ -236,8 +236,7 @@ impl MemoryPool {
self.inc_resize_events();
trace!(
"Buffer capacity {} != original {} when returning",
- current_capacity,
- original_capacity
+ current_capacity, original_capacity
);
}
diff --git a/core/server/src/streaming/utils/mod.rs b/core/server/src/streaming/utils/mod.rs
index cc3695df..e441a051 100644
--- a/core/server/src/streaming/utils/mod.rs
+++ b/core/server/src/streaming/utils/mod.rs
@@ -25,5 +25,5 @@ pub mod random_id;
mod memory_pool;
mod pooled_buffer;
-pub use memory_pool::{memory_pool, MemoryPool};
+pub use memory_pool::{MemoryPool, memory_pool};
pub use pooled_buffer::PooledBuffer;
diff --git a/core/server/src/streaming/utils/pooled_buffer.rs b/core/server/src/streaming/utils/pooled_buffer.rs
index 5f04ff70..9c4375d2 100644
--- a/core/server/src/streaming/utils/pooled_buffer.rs
+++ b/core/server/src/streaming/utils/pooled_buffer.rs
@@ -16,7 +16,7 @@
* under the License.
*/
-use super::memory_pool::{memory_pool, BytesMutExt};
+use super::memory_pool::{BytesMutExt, memory_pool};
use bytes::{Buf, BufMut, BytesMut};
use std::ops::{Deref, DerefMut};
diff --git a/core/server/src/tcp/tcp_listener.rs b/core/server/src/tcp/tcp_listener.rs
index dbdaee42..0d84aa10 100644
--- a/core/server/src/tcp/tcp_listener.rs
+++ b/core/server/src/tcp/tcp_listener.rs
@@ -72,9 +72,13 @@ pub async fn start(address: &str, socket: TcpSocket, system: SharedSystem) -> So
handle_error(error);
system.read().await.delete_client(client_id).await;
if let Err(error) = sender.shutdown().await {
- error!("Failed to shutdown TCP stream for client: {client_id}, address: {address}. {error}");
+ error!(
+ "Failed to shutdown TCP stream for client: {client_id}, address: {address}. {error}"
+ );
} else {
- info!("Successfully closed TCP stream for client: {client_id}, address: {address}.");
+ info!(
+ "Successfully closed TCP stream for client: {client_id}, address: {address}."
+ );
}
}
});
diff --git a/core/server/src/tcp/tcp_tls_listener.rs b/core/server/src/tcp/tcp_tls_listener.rs
index 43f1c323..cecd0702 100644
--- a/core/server/src/tcp/tcp_tls_listener.rs
+++ b/core/server/src/tcp/tcp_tls_listener.rs
@@ -99,9 +99,13 @@ pub(crate) async fn start(
handle_error(error);
system.read().await.delete_client(client_id).await;
if let Err(error) = sender.shutdown().await {
- error!("Failed to shutdown TCP stream for client: {client_id}, address: {address}. {error}");
+ error!(
+ "Failed to shutdown TCP stream for client: {client_id}, address: {address}. {error}"
+ );
} else {
- info!("Successfully closed TCP stream for client: {client_id}, address: {address}.");
+ info!(
+ "Successfully closed TCP stream for client: {client_id}, address: {address}."
+ );
}
}
});
diff --git a/core/tools/Cargo.toml b/core/tools/Cargo.toml
index 9fd6fdf5..be036b36 100644
--- a/core/tools/Cargo.toml
+++ b/core/tools/Cargo.toml
@@ -18,7 +18,7 @@
[package]
name = "tools"
version = "0.1.0"
-edition = "2021"
+edition = "2024"
license = "Apache-2.0"
[dependencies]