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/10/06 13:19:35 UTC
(iggy) branch io_uring_tpc updated: fix(io_uring_tpc): fix most of lints via cargo fix (#2239)
This is an automated email from the ASF dual-hosted git repository.
hgruszecki pushed a commit to branch io_uring_tpc
in repository https://gitbox.apache.org/repos/asf/iggy.git
The following commit(s) were added to refs/heads/io_uring_tpc by this push:
new 931a4314 fix(io_uring_tpc): fix most of lints via cargo fix (#2239)
931a4314 is described below
commit 931a4314a5f794fd976c5ff6813bcce177cdc9a7
Author: Hubert Gruszecki <h....@gmail.com>
AuthorDate: Mon Oct 6 15:19:29 2025 +0200
fix(io_uring_tpc): fix most of lints via cargo fix (#2239)
---
.../bench/src/actors/consumer/client/high_level.rs | 4 +--
.../tests/server/scenarios/system_scenario.rs | 4 +--
core/integration/tests/state/mod.rs | 1 -
.../tests/streaming/common/test_setup.rs | 1 -
.../tests/streaming/get_by_timestamp.rs | 2 --
core/integration/tests/streaming/snapshot.rs | 5 ++--
core/sdk/src/clients/consumer_builder.rs | 1 -
core/sdk/src/tcp/tcp_client.rs | 1 -
.../create_consumer_group_handler.rs | 2 +-
.../delete_consumer_group_handler.rs | 2 +-
.../consumer_groups/get_consumer_group_handler.rs | 3 +--
.../consumer_groups/get_consumer_groups_handler.rs | 4 +--
.../handlers/messages/poll_messages_handler.rs | 8 ------
.../handlers/messages/send_messages_handler.rs | 5 +---
.../partitions/create_partitions_handler.rs | 3 +--
.../partitions/delete_partitions_handler.rs | 4 +--
.../create_personal_access_token_handler.rs | 3 +--
.../delete_personal_access_token_handler.rs | 2 +-
.../handlers/segments/delete_segments_handler.rs | 2 +-
.../handlers/streams/purge_stream_handler.rs | 2 +-
.../handlers/streams/update_stream_handler.rs | 2 +-
.../binary/handlers/topics/delete_topic_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 | 4 +--
.../binary/handlers/users/create_user_handler.rs | 4 +--
.../binary/handlers/users/delete_user_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/binary/mapper.rs | 2 +-
core/server/src/bootstrap.rs | 3 +--
core/server/src/configs/defaults.rs | 2 --
core/server/src/configs/sharding.rs | 19 +++----------
core/server/src/http/http_server.rs | 1 -
core/server/src/http/partitions.rs | 2 +-
core/server/src/http/streams.rs | 4 +--
core/server/src/http/users.rs | 2 +-
core/server/src/io/storage.rs | 4 +--
core/server/src/log/logger.rs | 1 -
core/server/src/log/runtime.rs | 4 +--
core/server/src/quic/quic_server.rs | 2 +-
core/server/src/shard/mod.rs | 31 +++++-----------------
core/server/src/shard/system/clients.rs | 1 -
core/server/src/shard/system/consumer_groups.rs | 2 +-
core/server/src/shard/system/messages.rs | 26 +++++++++---------
core/server/src/shard/system/partitions.rs | 7 -----
core/server/src/shard/system/segments.rs | 4 +--
core/server/src/shard/system/snapshot/mod.rs | 6 ++---
core/server/src/shard/system/stats.rs | 1 -
core/server/src/shard/system/streams.rs | 7 ++---
core/server/src/shard/system/topics.rs | 1 -
core/server/src/shard/system/users.rs | 17 ++----------
core/server/src/slab/streams.rs | 2 +-
core/server/src/slab/topics.rs | 4 +++
core/server/src/state/file.rs | 3 +--
.../deduplication/message_deduplicator.rs | 6 ++---
core/server/src/streaming/partitions/helpers.rs | 5 ++--
core/server/src/streaming/partitions/log.rs | 10 +++----
core/server/src/streaming/partitions/messages.rs | 8 ------
core/server/src/streaming/partitions/partition2.rs | 5 +---
core/server/src/streaming/partitions/segments.rs | 9 -------
core/server/src/streaming/partitions/storage2.rs | 16 +++--------
.../src/streaming/segments/indexes/index_reader.rs | 8 +-----
.../src/streaming/segments/indexes/index_writer.rs | 5 +---
.../streaming/segments/messages/messages_reader.rs | 7 ++---
.../streaming/segments/messages/messages_writer.rs | 7 ++---
core/server/src/streaming/streams/helpers.rs | 4 +--
core/server/src/streaming/topics/helpers.rs | 11 +++-----
core/server/src/streaming/topics/storage2.rs | 1 -
core/server/src/streaming/topics/topic2.rs | 6 +----
core/server/src/streaming/utils/memory_pool.rs | 3 +--
core/server/src/tcp/connection_handler.rs | 4 +--
core/server/src/tcp/sender.rs | 9 +++----
core/server/src/tcp/tcp_listener.rs | 4 +--
core/server/src/tcp/tcp_sender.rs | 4 +--
core/server/src/tcp/tcp_tls_listener.rs | 2 +-
78 files changed, 113 insertions(+), 264 deletions(-)
diff --git a/core/bench/src/actors/consumer/client/high_level.rs b/core/bench/src/actors/consumer/client/high_level.rs
index e34f7b12..152b0ffb 100644
--- a/core/bench/src/actors/consumer/client/high_level.rs
+++ b/core/bench/src/actors/consumer/client/high_level.rs
@@ -111,7 +111,7 @@ impl BenchmarkInit for HighLevelConsumerClient {
let mut consumer = if let Some(cg_id) = self.config.consumer_group_id {
let consumer_group_name = format!("cg_{cg_id}");
client
- .consumer_group(&consumer_group_name, &stream_id_str, &topic_id_str)?
+ .consumer_group(&consumer_group_name, &stream_id_str, topic_id_str)?
.batch_length(self.config.messages_per_batch.get())
.auto_commit(AutoCommit::When(AutoCommitWhen::PollingMessages))
.create_consumer_group_if_not_exists()
@@ -125,7 +125,7 @@ impl BenchmarkInit for HighLevelConsumerClient {
.consumer(
&format!("hl_consumer_{}", self.config.consumer_id),
&stream_id_str,
- &topic_id_str,
+ topic_id_str,
0,
)?
.polling_strategy(PollingStrategy::offset(0))
diff --git a/core/integration/tests/server/scenarios/system_scenario.rs b/core/integration/tests/server/scenarios/system_scenario.rs
index 5e0191e4..02072cf5 100644
--- a/core/integration/tests/server/scenarios/system_scenario.rs
+++ b/core/integration/tests/server/scenarios/system_scenario.rs
@@ -17,8 +17,8 @@
*/
use crate::server::scenarios::{
- CONSUMER_GROUP_NAME, CONSUMER_ID, CONSUMER_KIND, MESSAGES_COUNT, PARTITION_ID,
- PARTITIONS_COUNT, STREAM_NAME, TOPIC_NAME, get_consumer_group, leave_consumer_group,
+ CONSUMER_GROUP_NAME, CONSUMER_KIND, MESSAGES_COUNT, PARTITION_ID, PARTITIONS_COUNT,
+ STREAM_NAME, TOPIC_NAME, get_consumer_group, leave_consumer_group,
};
use bytes::Bytes;
use iggy::prelude::*;
diff --git a/core/integration/tests/state/mod.rs b/core/integration/tests/state/mod.rs
index fe496abd..40ed9781 100644
--- a/core/integration/tests/state/mod.rs
+++ b/core/integration/tests/state/mod.rs
@@ -18,7 +18,6 @@
use compio::fs::create_dir;
use iggy::prelude::{Aes256GcmEncryptor, EncryptorKind};
-use server::bootstrap::create_directories;
use server::state::file::FileState;
use server::streaming::persistence::persister::{FileWithSyncPersister, PersisterKind};
use server::streaming::utils::file::overwrite;
diff --git a/core/integration/tests/streaming/common/test_setup.rs b/core/integration/tests/streaming/common/test_setup.rs
index 02cb95a1..d22b16ea 100644
--- a/core/integration/tests/streaming/common/test_setup.rs
+++ b/core/integration/tests/streaming/common/test_setup.rs
@@ -17,7 +17,6 @@
*/
use compio::fs;
-use log::error;
use server::bootstrap::create_directories;
use server::configs::system::SystemConfig;
use server::streaming::persistence::persister::{FileWithSyncPersister, PersisterKind};
diff --git a/core/integration/tests/streaming/get_by_timestamp.rs b/core/integration/tests/streaming/get_by_timestamp.rs
index bf7428f9..3313e9ec 100644
--- a/core/integration/tests/streaming/get_by_timestamp.rs
+++ b/core/integration/tests/streaming/get_by_timestamp.rs
@@ -29,8 +29,6 @@ use server::streaming::segments::IggyMessagesBatchMut;
use server::streaming::traits::MainOps;
use std::collections::HashMap;
use std::str::FromStr;
-use std::sync::Arc;
-use std::sync::atomic::{AtomicU32, AtomicU64};
use std::thread::sleep;
use test_case::test_matrix;
diff --git a/core/integration/tests/streaming/snapshot.rs b/core/integration/tests/streaming/snapshot.rs
index 5f3ea032..76c9fa97 100644
--- a/core/integration/tests/streaming/snapshot.rs
+++ b/core/integration/tests/streaming/snapshot.rs
@@ -16,6 +16,8 @@
* under the License.
*/
+//TODO: Fix me use shard instead of system
+/*
use crate::streaming::common::test_setup::TestSetup;
use iggy::prelude::{SnapshotCompression, SystemSnapshotType};
use server::configs::cluster::ClusterConfig;
@@ -25,8 +27,7 @@ use std::io::{Cursor, Read};
use std::net::{Ipv4Addr, SocketAddr};
use zip::ZipArchive;
-//TODO: Fix me use shard instead of system
-/*
+
#[tokio::test]
async fn should_create_snapshot_file() {
let setup = TestSetup::init().await;
diff --git a/core/sdk/src/clients/consumer_builder.rs b/core/sdk/src/clients/consumer_builder.rs
index 3246b06e..1de18a69 100644
--- a/core/sdk/src/clients/consumer_builder.rs
+++ b/core/sdk/src/clients/consumer_builder.rs
@@ -18,7 +18,6 @@
use crate::client_wrappers::client_wrapper::ClientWrapper;
use crate::prelude::{AutoCommit, AutoCommitWhen, IggyConsumer};
-use iggy_binary_protocol::Client;
use iggy_common::locking::IggyRwLock;
use iggy_common::{Consumer, EncryptorKind, Identifier, IggyDuration, PollingStrategy};
use std::sync::Arc;
diff --git a/core/sdk/src/tcp/tcp_client.rs b/core/sdk/src/tcp/tcp_client.rs
index ed269284..ab299cc4 100644
--- a/core/sdk/src/tcp/tcp_client.rs
+++ b/core/sdk/src/tcp/tcp_client.rs
@@ -17,7 +17,6 @@
*/
use crate::prelude::Client;
-use crate::prelude::IggyConsumer;
use crate::prelude::TcpClientConfig;
use crate::tcp::tcp_connection_stream::TcpConnectionStream;
use crate::tcp::tcp_connection_stream_kind::ConnectionStreamKind;
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 9634dceb..eb7e8019 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
@@ -60,7 +60,7 @@ impl ServerCommandHandler for CreateConsumerGroup {
topic_id: self.topic_id.clone(),
cg,
};
- let _responses = shard.broadcast_event_to_all_shards(event.into()).await;
+ let _responses = shard.broadcast_event_to_all_shards(event).await;
let stream_id = self.stream_id.clone();
let topic_id = self.topic_id.clone();
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 14d49ec2..5dfb9dda 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
@@ -87,7 +87,7 @@ impl ServerCommandHandler for DeleteConsumerGroup {
topic_id: self.topic_id.clone(),
group_id: self.group_id.clone(),
};
- let _responses = shard.broadcast_event_to_all_shards(event.into()).await;
+ let _responses = shard.broadcast_event_to_all_shards(event).await;
let stream_id = self.stream_id.clone();
let topic_id = self.topic_id.clone();
shard
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 a056659c..768dc749 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
@@ -16,7 +16,6 @@
* under the License.
*/
-use super::COMPONENT;
use crate::binary::command::{BinaryServerCommand, ServerCommand, ServerCommandHandler};
use crate::binary::handlers::utils::receive_and_validate;
use crate::binary::mapper;
@@ -57,7 +56,7 @@ impl ServerCommandHandler for GetConsumerGroup {
session.get_user_id(),
numeric_stream_id as u32,
numeric_topic_id as u32,
- );
+ )?;
let consumer_group = shard.streams2.with_consumer_group_by_id(
&self.stream_id,
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 3740d44a..8b799d01 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
@@ -17,7 +17,6 @@
*/
use crate::binary::command::{BinaryServerCommand, ServerCommand, ServerCommandHandler};
-use crate::binary::handlers::consumer_groups::COMPONENT;
use crate::binary::handlers::utils::receive_and_validate;
use crate::binary::mapper;
use crate::binary::sender::SenderKind;
@@ -26,7 +25,6 @@ use crate::slab::traits_ext::{EntityComponentSystem, IntoComponents};
use crate::streaming::session::Session;
use crate::streaming::{streams, topics};
use anyhow::Result;
-use error_set::ErrContext;
use iggy_common::IggyError;
use iggy_common::get_consumer_groups::GetConsumerGroups;
use std::rc::Rc;
@@ -59,7 +57,7 @@ impl ServerCommandHandler for GetConsumerGroups {
session.get_user_id(),
numeric_stream_id as u32,
numeric_topic_id as u32,
- );
+ )?;
let consumer_groups =
shard
diff --git a/core/server/src/binary/handlers/messages/poll_messages_handler.rs b/core/server/src/binary/handlers/messages/poll_messages_handler.rs
index 1a835efc..6c0d8ab0 100644
--- a/core/server/src/binary/handlers/messages/poll_messages_handler.rs
+++ b/core/server/src/binary/handlers/messages/poll_messages_handler.rs
@@ -17,22 +17,14 @@
*/
use crate::binary::command::{BinaryServerCommand, ServerCommand, ServerCommandHandler};
-use crate::binary::handlers::messages::COMPONENT;
use crate::binary::handlers::utils::receive_and_validate;
use crate::binary::sender::SenderKind;
use crate::shard::IggyShard;
use crate::shard::system::messages::PollingArgs;
-use crate::shard::transmission::frame::ShardResponse;
-use crate::shard::transmission::message::{ShardMessage, ShardRequest, ShardRequestPayload};
-use crate::streaming::segments::IggyMessagesBatchSet;
use crate::streaming::session::Session;
use crate::streaming::utils::PooledBuffer;
-use crate::to_iovec;
use anyhow::Result;
-use bytes::BytesMut;
-use error_set::ErrContext;
use iggy_common::{IggyError, PollMessages};
-use std::io::IoSlice;
use std::rc::Rc;
use tracing::{debug, trace};
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 f8afd67a..6bb4e777 100644
--- a/core/server/src/binary/handlers/messages/send_messages_handler.rs
+++ b/core/server/src/binary/handlers/messages/send_messages_handler.rs
@@ -16,20 +16,17 @@
* under the License.
*/
-use super::COMPONENT;
use crate::binary::command::{BinaryServerCommand, ServerCommandHandler};
use crate::binary::sender::SenderKind;
use crate::shard::IggyShard;
-use crate::shard::transmission::frame::ShardResponse;
-use crate::shard::transmission::message::{ShardMessage, ShardRequest, ShardRequestPayload};
use crate::streaming::segments::{IggyIndexesMut, IggyMessagesBatchMut};
use crate::streaming::session::Session;
use crate::streaming::utils::PooledBuffer;
use anyhow::Result;
use compio::buf::{IntoInner as _, IoBuf};
+use iggy_common::INDEX_SIZE;
use iggy_common::Identifier;
use iggy_common::Sizeable;
-use iggy_common::{INDEX_SIZE, IdKind};
use iggy_common::{IggyError, Partitioning, SendMessages, Validatable};
use std::rc::Rc;
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 721f063f..6589031d 100644
--- a/core/server/src/binary/handlers/partitions/create_partitions_handler.rs
+++ b/core/server/src/binary/handlers/partitions/create_partitions_handler.rs
@@ -21,7 +21,6 @@ use crate::binary::handlers::utils::receive_and_validate;
use crate::binary::{handlers::partitions::COMPONENT, sender::SenderKind};
use crate::shard::IggyShard;
use crate::shard::transmission::event::ShardEvent;
-use crate::slab::traits_ext::EntityMarker;
use crate::state::command::EntryCommand;
use crate::streaming::session::Session;
use crate::streaming::{streams, topics};
@@ -59,7 +58,7 @@ impl ServerCommandHandler for CreatePartitions {
topic_id: self.topic_id.clone(),
partitions,
};
- let _responses = shard.broadcast_event_to_all_shards(event.into()).await;
+ let _responses = shard.broadcast_event_to_all_shards(event).await;
// TODO: Rebalance the consumer group.
let stream_id = shard
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 c88a35b8..98b56f76 100644
--- a/core/server/src/binary/handlers/partitions/delete_partitions_handler.rs
+++ b/core/server/src/binary/handlers/partitions/delete_partitions_handler.rs
@@ -21,9 +21,7 @@ use crate::binary::handlers::utils::receive_and_validate;
use crate::binary::{handlers::partitions::COMPONENT, sender::SenderKind};
use crate::shard::IggyShard;
use crate::shard::transmission::event::ShardEvent;
-use crate::slab::traits_ext::EntityMarker;
use crate::state::command::EntryCommand;
-use crate::streaming::partitions::storage2::create_partition_file_hierarchy;
use crate::streaming::session::Session;
use anyhow::Result;
use error_set::ErrContext;
@@ -63,7 +61,7 @@ impl ServerCommandHandler for DeletePartitions {
partitions_count: self.partitions_count,
partition_ids: deleted_partition_ids,
};
- let _responses = shard.broadcast_event_to_all_shards(event.into()).await;
+ let _responses = shard.broadcast_event_to_all_shards(event).await;
// TODO: Rebalance the consumer group.
shard
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 5a05aa25..ea7b947a 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
@@ -24,7 +24,6 @@ use crate::shard::IggyShard;
use crate::shard::transmission::event::ShardEvent;
use crate::state::command::EntryCommand;
use crate::state::models::CreatePersonalAccessTokenWithHash;
-use crate::streaming::personal_access_tokens::personal_access_token::PersonalAccessToken;
use crate::streaming::session::Session;
use anyhow::Result;
use error_set::ErrContext;
@@ -61,7 +60,7 @@ impl ServerCommandHandler for CreatePersonalAccessToken {
let event = ShardEvent::CreatedPersonalAccessToken {
personal_access_token: personal_access_token.clone(),
};
- let _responses = shard.broadcast_event_to_all_shards(event.into()).await;
+ let _responses = shard.broadcast_event_to_all_shards(event).await;
shard
.state
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 13a06e55..b2708f9c 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
@@ -56,7 +56,7 @@ impl ServerCommandHandler for DeletePersonalAccessToken {
user_id: session.get_user_id(),
name: self.name.clone(),
};
- let _responses = shard.broadcast_event_to_all_shards(event.into()).await;
+ let _responses = shard.broadcast_event_to_all_shards(event).await;
shard
.state
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 ef74b11f..ccb5f859 100644
--- a/core/server/src/binary/handlers/segments/delete_segments_handler.rs
+++ b/core/server/src/binary/handlers/segments/delete_segments_handler.rs
@@ -68,7 +68,7 @@ impl ServerCommandHandler for DeleteSegments {
partition_id: self.partition_id as usize,
segments_count: self.segments_count,
};
- let _responses = shard.broadcast_event_to_all_shards(event.into()).await;
+ let _responses = shard.broadcast_event_to_all_shards(event).await;
shard
.state
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 fb3f2787..b8b35b64 100644
--- a/core/server/src/binary/handlers/streams/purge_stream_handler.rs
+++ b/core/server/src/binary/handlers/streams/purge_stream_handler.rs
@@ -54,7 +54,7 @@ impl ServerCommandHandler for PurgeStream {
let event = ShardEvent::PurgedStream2 {
stream_id: self.stream_id.clone(),
};
- let _responses = shard.broadcast_event_to_all_shards(event.into()).await;
+ let _responses = shard.broadcast_event_to_all_shards(event).await;
shard
.state
.apply(session.get_user_id(), &EntryCommand::PurgeStream(self))
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 ebfe1121..2e81915a 100644
--- a/core/server/src/binary/handlers/streams/update_stream_handler.rs
+++ b/core/server/src/binary/handlers/streams/update_stream_handler.rs
@@ -56,7 +56,7 @@ impl ServerCommandHandler for UpdateStream {
stream_id: self.stream_id.clone(),
name: self.name.clone(),
};
- let _responses = shard.broadcast_event_to_all_shards(event.into()).await;
+ let _responses = shard.broadcast_event_to_all_shards(event).await;
shard
.state
.apply(session.get_user_id(), &EntryCommand::UpdateStream(self))
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 c589d5ea..69d9d995 100644
--- a/core/server/src/binary/handlers/topics/delete_topic_handler.rs
+++ b/core/server/src/binary/handlers/topics/delete_topic_handler.rs
@@ -71,7 +71,7 @@ impl ServerCommandHandler for DeleteTopic {
stream_id: self.stream_id.clone(),
topic_id: self.topic_id.clone(),
};
- let _responses = shard.broadcast_event_to_all_shards(event.into()).await;
+ let _responses = shard.broadcast_event_to_all_shards(event).await;
shard
.state
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 63d0daa0..7c4d5179 100644
--- a/core/server/src/binary/handlers/topics/purge_topic_handler.rs
+++ b/core/server/src/binary/handlers/topics/purge_topic_handler.rs
@@ -60,7 +60,7 @@ impl ServerCommandHandler for PurgeTopic {
stream_id: self.stream_id.clone(),
topic_id: self.topic_id.clone(),
};
- let _responses = shard.broadcast_event_to_all_shards(event.into()).await;
+ let _responses = shard.broadcast_event_to_all_shards(event).await;
shard
.state
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 f37990ac..8f9146ac 100644
--- a/core/server/src/binary/handlers/topics/update_topic_handler.rs
+++ b/core/server/src/binary/handlers/topics/update_topic_handler.rs
@@ -81,7 +81,7 @@ impl ServerCommandHandler for UpdateTopic {
max_topic_size: self.max_topic_size,
replication_factor: self.replication_factor,
};
- let _responses = shard.broadcast_event_to_all_shards(event.into()).await;
+ let _responses = shard.broadcast_event_to_all_shards(event).await;
let topic_id = self.topic_id.clone();
let stream_id = self.stream_id.clone();
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 fa010d6c..0b595ee4 100644
--- a/core/server/src/binary/handlers/users/change_password_handler.rs
+++ b/core/server/src/binary/handlers/users/change_password_handler.rs
@@ -21,10 +21,10 @@ use crate::binary::handlers::utils::receive_and_validate;
use crate::binary::{handlers::users::COMPONENT, sender::SenderKind};
use crate::shard::IggyShard;
use crate::shard::transmission::event::ShardEvent;
+use crate::shard_info;
use crate::state::command::EntryCommand;
use crate::streaming::session::Session;
use crate::streaming::utils::crypto;
-use crate::{shard_debug, shard_info};
use anyhow::Result;
use error_set::ErrContext;
use iggy_common::IggyError;
@@ -77,7 +77,7 @@ impl ServerCommandHandler for ChangePassword {
current_password: self.current_password.clone(),
new_password: self.new_password.clone(),
};
- let _responses = shard.broadcast_event_to_all_shards(event.into()).await;
+ let _responses = shard.broadcast_event_to_all_shards(event).await;
// For the security of the system, we hash the password before storing it in metadata.
shard
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 0837a794..96521d5f 100644
--- a/core/server/src/binary/handlers/users/create_user_handler.rs
+++ b/core/server/src/binary/handlers/users/create_user_handler.rs
@@ -33,7 +33,7 @@ use anyhow::Result;
use error_set::ErrContext;
use iggy_common::IggyError;
use iggy_common::create_user::CreateUser;
-use tracing::{debug, instrument};
+use tracing::instrument;
impl ServerCommandHandler for CreateUser {
fn code(&self) -> u32 {
@@ -78,7 +78,7 @@ impl ServerCommandHandler for CreateUser {
status: self.status,
permissions: self.permissions.clone(),
};
- let _responses = shard.broadcast_event_to_all_shards(event.into()).await;
+ let _responses = shard.broadcast_event_to_all_shards(event).await;
let user_id = user.id;
let response = mapper::map_user(&user);
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 078fd548..f265f8df 100644
--- a/core/server/src/binary/handlers/users/delete_user_handler.rs
+++ b/core/server/src/binary/handlers/users/delete_user_handler.rs
@@ -66,7 +66,7 @@ impl ServerCommandHandler for DeleteUser {
let event = ShardEvent::DeletedUser {
user_id: self.user_id.clone(),
};
- let _responses = shard.broadcast_event_to_all_shards(event.into()).await;
+ let _responses = shard.broadcast_event_to_all_shards(event).await;
let user_id = self.user_id.clone();
shard
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 647934ae..395f2724 100644
--- a/core/server/src/binary/handlers/users/login_user_handler.rs
+++ b/core/server/src/binary/handlers/users/login_user_handler.rs
@@ -70,7 +70,7 @@ impl ServerCommandHandler for LoginUser {
password,
};
// Broadcast the event to all shards.
- let _responses = shard.broadcast_event_to_all_shards(event.into()).await;
+ let _responses = shard.broadcast_event_to_all_shards(event).await;
let identity_info = mapper::map_identity_info(user.id);
sender.send_ok_response(&identity_info).await?;
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 4a15484a..7dbc99b4 100644
--- a/core/server/src/binary/handlers/users/logout_user_handler.rs
+++ b/core/server/src/binary/handlers/users/logout_user_handler.rs
@@ -61,7 +61,7 @@ impl ServerCommandHandler for LogoutUser {
let event = ShardEvent::LogoutUser {
client_id: session.client_id,
};
- let _responses = shard.broadcast_event_to_all_shards(event.into()).await;
+ let _responses = shard.broadcast_event_to_all_shards(event).await;
session.clear_user_id();
sender.send_empty_ok_response().await?;
Ok(())
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 1b297a05..4b42d902 100644
--- a/core/server/src/binary/handlers/users/update_permissions_handler.rs
+++ b/core/server/src/binary/handlers/users/update_permissions_handler.rs
@@ -61,7 +61,7 @@ impl ServerCommandHandler for UpdatePermissions {
user_id: self.user_id.clone(),
permissions: self.permissions.clone(),
};
- let _responses = shard.broadcast_event_to_all_shards(event.into()).await;
+ let _responses = shard.broadcast_event_to_all_shards(event).await;
shard
.state
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 cd833a5c..c8f28db3 100644
--- a/core/server/src/binary/handlers/users/update_user_handler.rs
+++ b/core/server/src/binary/handlers/users/update_user_handler.rs
@@ -73,7 +73,7 @@ impl ServerCommandHandler for UpdateUser {
username: self.username.clone(),
status: self.status,
};
- let _responses = shard.broadcast_event_to_all_shards(event.into()).await;
+ let _responses = shard.broadcast_event_to_all_shards(event).await;
let user_id = self.user_id.clone();
shard
diff --git a/core/server/src/binary/mapper.rs b/core/server/src/binary/mapper.rs
index 64f80dfb..ca43991d 100644
--- a/core/server/src/binary/mapper.rs
+++ b/core/server/src/binary/mapper.rs
@@ -174,7 +174,7 @@ pub fn map_stream(root: &stream2::StreamRoot, stats: &StreamStats) -> Bytes {
.map(|(_, val)| val)
.zip(stats.iter().map(|(_, val)| val))
{
- extend_topic(&root, &stat, &mut bytes);
+ extend_topic(root, stat, &mut bytes);
}
});
bytes.freeze()
diff --git a/core/server/src/bootstrap.rs b/core/server/src/bootstrap.rs
index 250a52a5..09dca813 100644
--- a/core/server/src/bootstrap.rs
+++ b/core/server/src/bootstrap.rs
@@ -324,8 +324,7 @@ pub fn create_root_user() -> User {
if password.len() > MAX_PASSWORD_LENGTH {
panic!("Root password is too long.");
}
- let user = User::root(&username, &password);
- user
+ User::root(&username, &password)
}
pub fn create_shard_executor(cpu_set: HashSet<usize>) -> Runtime {
diff --git a/core/server/src/configs/defaults.rs b/core/server/src/configs/defaults.rs
index e9640097..36ae3c2a 100644
--- a/core/server/src/configs/defaults.rs
+++ b/core/server/src/configs/defaults.rs
@@ -37,8 +37,6 @@ use crate::configs::system::{
use crate::configs::tcp::{TcpConfig, TcpTlsConfig};
use iggy_common::IggyByteSize;
use iggy_common::IggyDuration;
-use iggy_common::TransportProtocol;
-use std::str::FromStr;
use std::sync::Arc;
use std::time::Duration;
diff --git a/core/server/src/configs/sharding.rs b/core/server/src/configs/sharding.rs
index 1accd214..aa8214f6 100644
--- a/core/server/src/configs/sharding.rs
+++ b/core/server/src/configs/sharding.rs
@@ -21,33 +21,20 @@ use std::collections::HashSet;
use std::str::FromStr;
use std::thread::available_parallelism;
-#[derive(Debug, Deserialize, Serialize)]
+#[derive(Debug, Deserialize, Serialize, Default)]
pub struct ShardingConfig {
#[serde(default)]
pub cpu_allocation: CpuAllocation,
}
-impl Default for ShardingConfig {
- fn default() -> Self {
- ShardingConfig {
- cpu_allocation: CpuAllocation::default(),
- }
- }
-}
-
-#[derive(Debug, Clone, PartialEq)]
+#[derive(Debug, Clone, PartialEq, Default)]
pub enum CpuAllocation {
+ #[default]
All,
Count(usize),
Range(usize, usize),
}
-impl Default for CpuAllocation {
- fn default() -> Self {
- CpuAllocation::All
- }
-}
-
impl CpuAllocation {
pub fn to_shard_set(&self) -> HashSet<usize> {
match self {
diff --git a/core/server/src/http/http_server.rs b/core/server/src/http/http_server.rs
index 9c3dd114..317e9c61 100644
--- a/core/server/src/http/http_server.rs
+++ b/core/server/src/http/http_server.rs
@@ -34,7 +34,6 @@ use axum::http::Method;
use axum::{Router, middleware};
use axum_server::tls_rustls::RustlsConfig;
use compio_net::TcpListener;
-use futures::FutureExt;
use iggy_common::IggyError;
use std::net::SocketAddr;
use std::path::PathBuf;
diff --git a/core/server/src/http/partitions.rs b/core/server/src/http/partitions.rs
index b54539ea..70b21ed5 100644
--- a/core/server/src/http/partitions.rs
+++ b/core/server/src/http/partitions.rs
@@ -75,7 +75,7 @@ async fn create_partitions(
topic_id: command.topic_id.clone(),
partitions,
};
- let _responses = shard.broadcast_event_to_all_shards(event.into()).await;
+ let _responses = shard.broadcast_event_to_all_shards(event).await;
let numeric_stream_id = shard
.streams2
diff --git a/core/server/src/http/streams.rs b/core/server/src/http/streams.rs
index d765a91d..650262f7 100644
--- a/core/server/src/http/streams.rs
+++ b/core/server/src/http/streams.rs
@@ -66,7 +66,7 @@ async fn get_stream(
.shard()
.streams2
.with_stream_by_id(&stream_id, |(root, stats)| {
- crate::http::mapper::map_stream_details(&*root, &**stats)
+ crate::http::mapper::map_stream_details(&root, &stats)
})
})();
@@ -79,7 +79,7 @@ async fn get_streams(State(state): State<Arc<AppState>>) -> Result<Json<Vec<Stre
let streams = SendWrapper::new(|| {
state.shard.shard().streams2.with_components(|stream_ref| {
let (roots, stats) = stream_ref.into_components();
- crate::http::mapper::map_streams_from_slabs(&*roots, &*stats)
+ crate::http::mapper::map_streams_from_slabs(&roots, &stats)
})
})();
diff --git a/core/server/src/http/users.rs b/core/server/src/http/users.rs
index 388bca92..a1de84bf 100644
--- a/core/server/src/http/users.rs
+++ b/core/server/src/http/users.rs
@@ -140,7 +140,7 @@ async fn create_user(
{
let username = command.username.clone();
let entry_command = EntryCommand::CreateUser(CreateUserWithId {
- user_id: user_id,
+ user_id,
command: CreateUser {
username: command.username.to_owned(),
password: crypto::hash_password(&command.password),
diff --git a/core/server/src/io/storage.rs b/core/server/src/io/storage.rs
index 6ec828c5..447cea12 100644
--- a/core/server/src/io/storage.rs
+++ b/core/server/src/io/storage.rs
@@ -2,10 +2,8 @@ use std::future::Future;
use compio::{
buf::{IoBuf, IoBufMut},
- driver::op,
- io::{AsyncReadAtExt, AsyncWriteAt, AsyncWriteAtExt, BufWriter, util::Splittable},
+ io::{AsyncReadAtExt, AsyncWriteAtExt},
};
-use enum_dispatch::enum_dispatch;
pub trait Storage {
fn read_exact_at<B: IoBufMut>(
diff --git a/core/server/src/log/logger.rs b/core/server/src/log/logger.rs
index b400233a..b70bec17 100644
--- a/core/server/src/log/logger.rs
+++ b/core/server/src/log/logger.rs
@@ -29,7 +29,6 @@ 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 std::io::{self, Write};
use std::path::PathBuf;
diff --git a/core/server/src/log/runtime.rs b/core/server/src/log/runtime.rs
index 1cbec8ce..cd62736f 100644
--- a/core/server/src/log/runtime.rs
+++ b/core/server/src/log/runtime.rs
@@ -1,6 +1,6 @@
-use futures::{FutureExt, SinkExt, Stream, StreamExt, channel::mpsc, future::poll_fn};
+use futures::{Stream, StreamExt, channel::mpsc};
use opentelemetry_sdk::runtime::{Runtime, RuntimeChannel, TrySend};
-use std::{pin::Pin, task::Poll, time::Duration};
+use std::{pin::Pin, time::Duration};
#[derive(Clone)]
pub struct CompioRuntime;
diff --git a/core/server/src/quic/quic_server.rs b/core/server/src/quic/quic_server.rs
index d484a045..1f7471c6 100644
--- a/core/server/src/quic/quic_server.rs
+++ b/core/server/src/quic/quic_server.rs
@@ -147,7 +147,7 @@ fn configure_quic(config: &QuicConfig) -> Result<ServerConfig, QuicError> {
false => load_certificates(&config.certificate.cert_file, &config.certificate.key_file)?,
};
- let mut builder = ServerBuilder::new_with_single_cert(certificates, private_key)
+ let builder = ServerBuilder::new_with_single_cert(certificates, private_key)
.with_error_context(|error| {
format!("{COMPONENT} (error: {error}) - failed to create QUIC server builder")
})
diff --git a/core/server/src/shard/mod.rs b/core/server/src/shard/mod.rs
index f95a63d0..3c6e9348 100644
--- a/core/server/src/shard/mod.rs
+++ b/core/server/src/shard/mod.rs
@@ -28,7 +28,6 @@ use self::tasks::{continuous, periodic};
use crate::{
binary::handlers::messages::poll_messages_handler::IggyPollMetadata,
configs::server::ServerConfig,
- io::fs_utils,
shard::{
namespace::{IggyFullNamespace, IggyNamespace},
task_registry::TaskRegistry,
@@ -39,20 +38,12 @@ use crate::{
},
},
shard_error, shard_info, shard_warn,
- slab::{
- streams::Streams,
- traits_ext::{EntityComponentSystem, EntityMarker, Insert},
- },
- state::{
- StateKind,
- file::FileState,
- system::{StreamState, SystemState, UserState},
- },
+ slab::{streams::Streams, traits_ext::EntityMarker},
+ state::StateKind,
streaming::{
clients::client_manager::ClientManager,
diagnostics::metrics::Metrics,
partitions,
- persistence::persister::PersisterKind,
polling_consumer::PollingConsumer,
session::Session,
traits::MainOps,
@@ -61,34 +52,24 @@ use crate::{
},
versioning::SemanticVersion,
};
-use ahash::{AHashMap, AHashSet, HashMap};
+use ahash::HashMap;
use builder::IggyShardBuilder;
use compio::io::AsyncWriteAtExt;
use dashmap::DashMap;
use error_set::ErrContext;
-use futures::future::try_join_all;
use hash32::{Hasher, Murmur3Hasher};
use iggy_common::{
- EncryptorKind, IdKind, Identifier, IggyError, IggyTimestamp, Permissions, PollingKind,
- TransportProtocol, UserId, UserStatus,
- defaults::{DEFAULT_ROOT_PASSWORD, DEFAULT_ROOT_USERNAME},
- locking::IggyRwLockFn,
+ EncryptorKind, Identifier, IggyError, IggyTimestamp, PollingKind, TransportProtocol, UserId,
};
use std::hash::Hasher as _;
use std::{
cell::{Cell, RefCell},
- future::Future,
net::SocketAddr,
- ops::Deref,
- pin::Pin,
rc::Rc,
- sync::{
- Arc,
- atomic::{AtomicBool, AtomicU32, Ordering},
- },
+ sync::atomic::{AtomicBool, AtomicU32, Ordering},
time::{Duration, Instant},
};
-use tracing::{debug, error, info, instrument, trace, warn};
+use tracing::{debug, error, instrument, trace};
use transmission::connector::{Receiver, ShardConnector, StopReceiver, StopSender};
pub const COMPONENT: &str = "SHARD";
diff --git a/core/server/src/shard/system/clients.rs b/core/server/src/shard/system/clients.rs
index bf8ebe17..d5eb7d18 100644
--- a/core/server/src/shard/system/clients.rs
+++ b/core/server/src/shard/system/clients.rs
@@ -22,7 +22,6 @@ use crate::streaming::clients::client_manager::Client;
use crate::streaming::session::Session;
use error_set::ErrContext;
use iggy_common::IggyError;
-use iggy_common::locking::IggyRwLockFn;
use iggy_common::{Identifier, TransportProtocol};
use std::net::SocketAddr;
use std::rc::Rc;
diff --git a/core/server/src/shard/system/consumer_groups.rs b/core/server/src/shard/system/consumer_groups.rs
index e3e254fb..3877ba0e 100644
--- a/core/server/src/shard/system/consumer_groups.rs
+++ b/core/server/src/shard/system/consumer_groups.rs
@@ -181,7 +181,7 @@ impl IggyShard {
self.ensure_consumer_group_exists(stream_id, topic_id, group_id)?;
{
let topic_id = self.streams2.with_topic_by_id(
- &stream_id,
+ stream_id,
topic_id,
topics::helpers::get_topic_id(),
);
diff --git a/core/server/src/shard/system/messages.rs b/core/server/src/shard/system/messages.rs
index 7cb49a7e..ea834468 100644
--- a/core/server/src/shard/system/messages.rs
+++ b/core/server/src/shard/system/messages.rs
@@ -35,7 +35,7 @@ use crate::streaming::{partitions, streams, topics};
use error_set::ErrContext;
use iggy_common::{
BytesSerializable, Consumer, EncryptorKind, IGGY_MESSAGE_HEADER_SIZE, Identifier, IggyError,
- IggyTimestamp, Partitioning, PartitioningKind, PollingKind, PollingStrategy,
+ Partitioning, PartitioningKind, PollingKind, PollingStrategy,
};
use std::sync::atomic::Ordering;
use tracing::{error, trace};
@@ -267,8 +267,8 @@ impl IggyShard {
match consumer {
PollingConsumer::Consumer(consumer_id, _) => {
self.streams2.with_partition_by_id(
- &stream_id,
- &topic_id,
+ stream_id,
+ topic_id,
partition_id,
partitions::helpers::store_consumer_offset(
consumer_id,
@@ -281,8 +281,8 @@ impl IggyShard {
);
let (offset_value, path) = self.streams2.with_partition_by_id(
- &stream_id,
- &topic_id,
+ stream_id,
+ topic_id,
partition_id,
|(.., offsets, _, _)| {
let hdl = offsets.pin();
@@ -300,8 +300,8 @@ impl IggyShard {
}
PollingConsumer::ConsumerGroup(cg_id, _) => {
self.streams2.with_partition_by_id(
- &stream_id,
- &topic_id,
+ stream_id,
+ topic_id,
partition_id,
partitions::helpers::store_consumer_group_member_offset(
cg_id,
@@ -314,8 +314,8 @@ impl IggyShard {
);
let (offset_value, path) = self.streams2.with_partition_by_id(
- &stream_id,
- &topic_id,
+ stream_id,
+ topic_id,
partition_id,
|(.., offsets, _)| {
let hdl = offsets.pin();
@@ -408,8 +408,8 @@ impl IggyShard {
partition_id: usize,
) -> Result<(), IggyError> {
let batches = self.streams2.with_partition_by_id_mut(
- &stream_id,
- &topic_id,
+ stream_id,
+ topic_id,
partition_id,
|(.., log)| log.journal_mut().commit(),
);
@@ -417,8 +417,8 @@ impl IggyShard {
self.streams2
.persist_messages_to_disk(
self.id,
- &stream_id,
- &topic_id,
+ stream_id,
+ topic_id,
partition_id,
batches,
&self.config.system,
diff --git a/core/server/src/shard/system/partitions.rs b/core/server/src/shard/system/partitions.rs
index 3e086c5a..695006e2 100644
--- a/core/server/src/shard/system/partitions.rs
+++ b/core/server/src/shard/system/partitions.rs
@@ -22,11 +22,9 @@ use crate::shard::ShardInfo;
use crate::shard::calculate_shard_assignment;
use crate::shard::namespace::IggyNamespace;
use crate::shard_info;
-use crate::slab::traits_ext::EntityComponentSystem;
use crate::slab::traits_ext::EntityMarker;
use crate::slab::traits_ext::IntoComponents;
use crate::streaming::partitions;
-use crate::streaming::partitions::helpers::create_message_deduplicator;
use crate::streaming::partitions::journal::MemoryMessageJournal;
use crate::streaming::partitions::log::SegmentedLog;
use crate::streaming::partitions::partition2;
@@ -35,17 +33,12 @@ use crate::streaming::partitions::storage2::delete_partitions_from_disk;
use crate::streaming::segments::Segment2;
use crate::streaming::segments::storage::create_segment_storage;
use crate::streaming::session::Session;
-use crate::streaming::stats::stats::PartitionStats;
-use crate::streaming::stats::stats::TopicStats;
use crate::streaming::streams;
use crate::streaming::topics;
use error_set::ErrContext;
use iggy_common::Identifier;
use iggy_common::IggyError;
-use iggy_common::IggyTimestamp;
-use std::sync::Arc;
-use std::sync::atomic::AtomicU64;
impl IggyShard {
fn validate_partition_permissions(
diff --git a/core/server/src/shard/system/segments.rs b/core/server/src/shard/system/segments.rs
index c9a59254..8b96c610 100644
--- a/core/server/src/shard/system/segments.rs
+++ b/core/server/src/shard/system/segments.rs
@@ -1,5 +1,3 @@
-use std::error;
-
use crate::shard::IggyShard;
use crate::streaming;
/* Licensed to the Apache Software Foundation (ASF) under one
@@ -73,7 +71,7 @@ impl IggyShard {
streaming::topics::helpers::get_topic_id(),
);
- let create_base_segment = segments.len() > 0 && storages.len() > 0;
+ let create_base_segment = !segments.is_empty() && !storages.is_empty();
for (mut storage, segment) in storages.into_iter().zip(segments.into_iter()) {
let (msg_writer, index_writer) = storage.shutdown();
if let Some(msg_writer) = msg_writer
diff --git a/core/server/src/shard/system/snapshot/mod.rs b/core/server/src/shard/system/snapshot/mod.rs
index 0c95de91..9244a0c4 100644
--- a/core/server/src/shard/system/snapshot/mod.rs
+++ b/core/server/src/shard/system/snapshot/mod.rs
@@ -24,7 +24,7 @@ use crate::streaming::session::Session;
use async_zip::base::write::ZipFileWriter;
use async_zip::{Compression, ZipEntryBuilder};
use compio::fs::OpenOptions;
-use compio::io::{AsyncReadAtExt, AsyncWriteAtExt};
+use compio::io::AsyncWriteAtExt;
use iggy_common::{IggyDuration, IggyError, Snapshot, SnapshotCompression, SystemSnapshotType};
use std::path::PathBuf;
// TODO: compio has an `process` module, consider using that instead, but read the docs carefully // https://compio.rs/docs/compio/process
@@ -163,7 +163,7 @@ async fn write_command_output_to_temp_file(
}
async fn get_filesystem_overview() -> Result<NamedTempFile, std::io::Error> {
- write_command_output_to_temp_file(&mut Command::new("ls").args(["-la", "/tmp", "/proc"])).await
+ write_command_output_to_temp_file(Command::new("ls").args(["-la", "/tmp", "/proc"])).await
}
async fn get_process_info() -> Result<NamedTempFile, std::io::Error> {
@@ -212,7 +212,7 @@ async fn get_resource_usage() -> Result<NamedTempFile, std::io::Error> {
}
async fn get_test_snapshot() -> Result<NamedTempFile, std::io::Error> {
- write_command_output_to_temp_file(&mut Command::new("echo").arg("test")).await
+ write_command_output_to_temp_file(Command::new("echo").arg("test")).await
}
async fn get_server_logs(config: Arc<SystemConfig>) -> Result<NamedTempFile, std::io::Error> {
diff --git a/core/server/src/shard/system/stats.rs b/core/server/src/shard/system/stats.rs
index 1faa0bc1..367482c5 100644
--- a/core/server/src/shard/system/stats.rs
+++ b/core/server/src/shard/system/stats.rs
@@ -20,7 +20,6 @@ use crate::VERSION;
use crate::shard::IggyShard;
use crate::slab::traits_ext::{EntityComponentSystem, IntoComponents};
use crate::versioning::SemanticVersion;
-use iggy_common::locking::IggyRwLockFn;
use iggy_common::{IggyDuration, IggyError, Stats};
use std::sync::OnceLock;
use sysinfo::{Pid, ProcessesToUpdate, System as SysinfoSystem};
diff --git a/core/server/src/shard/system/streams.rs b/core/server/src/shard/system/streams.rs
index 11e7e00a..1dbae2c6 100644
--- a/core/server/src/shard/system/streams.rs
+++ b/core/server/src/shard/system/streams.rs
@@ -25,7 +25,7 @@ use crate::streaming::streams::storage2::{create_stream_file_hierarchy, delete_s
use crate::streaming::streams::{self, stream2};
use error_set::ErrContext;
-use iggy_common::{Identifier, IggyError, IggyTimestamp};
+use iggy_common::{Identifier, IggyError};
impl IggyShard {
pub async fn create_stream2(
@@ -217,6 +217,8 @@ impl IggyShard {
#[cfg(test)]
mod tests {
+ //TODO: Fixme
+ /*
use super::*;
use crate::configs::server::{DataMaintenanceConfig, PersonalAccessTokenConfig};
use crate::configs::system::SystemConfig;
@@ -230,8 +232,7 @@ mod tests {
sync::Arc,
};
- //TODO: Fixme
- /*
+
#[tokio::test]
async fn should_get_stream_by_id_and_name() {
let tempdir = tempfile::TempDir::new().unwrap();
diff --git a/core/server/src/shard/system/topics.rs b/core/server/src/shard/system/topics.rs
index f2995b30..385fb7c5 100644
--- a/core/server/src/shard/system/topics.rs
+++ b/core/server/src/shard/system/topics.rs
@@ -29,7 +29,6 @@ use error_set::ErrContext;
use iggy_common::{
CompressionAlgorithm, Identifier, IggyError, IggyExpiry, IggyTimestamp, MaxTopicSize,
};
-use std::any::Any;
use std::str::FromStr;
use std::sync::Arc;
use std::u32;
diff --git a/core/server/src/shard/system/users.rs b/core/server/src/shard/system/users.rs
index a28bfcdb..573e1f2e 100644
--- a/core/server/src/shard/system/users.rs
+++ b/core/server/src/shard/system/users.rs
@@ -18,27 +18,17 @@
use super::COMPONENT;
use crate::shard::IggyShard;
-use crate::state::command::EntryCommand;
-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::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::IggyError;
use iggy_common::Permissions;
use iggy_common::UserStatus;
-use iggy_common::create_user::CreateUser;
-use iggy_common::defaults::*;
-use iggy_common::locking::IggyRwLockFn;
use iggy_common::{IdKind, Identifier};
use std::cell::RefMut;
-use std::env;
-use std::sync::Arc;
use std::sync::atomic::{AtomicU32, Ordering};
-use tracing::{error, info, warn};
+use tracing::{error, warn};
static USER_ID: AtomicU32 = AtomicU32::new(1);
const MAX_USERS: usize = u32::MAX as usize;
@@ -111,10 +101,7 @@ impl IggyShard {
IdKind::String => {
let username = user_id.get_cow_str_value()?;
let users = self.users.borrow_mut();
- let exists = users
- .iter()
- .find(|(_, user)| user.username == username)
- .is_some();
+ let exists = users.iter().any(|(_, user)| user.username == username);
if !exists {
return Err(IggyError::ResourceNotFound(user_id.to_string()));
}
diff --git a/core/server/src/slab/streams.rs b/core/server/src/slab/streams.rs
index 5d3acc83..f318327e 100644
--- a/core/server/src/slab/streams.rs
+++ b/core/server/src/slab/streams.rs
@@ -1188,7 +1188,7 @@ impl Streams {
);
let storage = create_segment_storage(
- &config,
+ config,
numeric_stream_id,
numeric_topic_id,
partition_id,
diff --git a/core/server/src/slab/topics.rs b/core/server/src/slab/topics.rs
index 100b4e1f..d93df224 100644
--- a/core/server/src/slab/topics.rs
+++ b/core/server/src/slab/topics.rs
@@ -147,6 +147,10 @@ impl Topics {
self.root.borrow().len()
}
+ pub fn is_empty(&self) -> bool {
+ self.root.borrow().is_empty()
+ }
+
pub fn exists(&self, id: &Identifier) -> bool {
match id.kind {
iggy_common::IdKind::Numeric => {
diff --git a/core/server/src/state/file.rs b/core/server/src/state/file.rs
index 5716d7bb..3c4be921 100644
--- a/core/server/src/state/file.rs
+++ b/core/server/src/state/file.rs
@@ -22,8 +22,7 @@ use crate::streaming::persistence::persister::PersisterKind;
use crate::streaming::utils::file;
use crate::versioning::SemanticVersion;
use bytes::{Buf, BufMut, Bytes, BytesMut};
-use compio::fs::File;
-use compio::io::{AsyncReadExt, AsyncWriteExt};
+use compio::io::AsyncReadExt;
use error_set::ErrContext;
use iggy_common::BytesSerializable;
use iggy_common::EncryptorKind;
diff --git a/core/server/src/streaming/deduplication/message_deduplicator.rs b/core/server/src/streaming/deduplication/message_deduplicator.rs
index efa204e8..b5a01f32 100644
--- a/core/server/src/streaming/deduplication/message_deduplicator.rs
+++ b/core/server/src/streaming/deduplication/message_deduplicator.rs
@@ -31,7 +31,7 @@ pub struct MessageDeduplicator {
/// pointers to the shared internal data structures.
impl Clone for MessageDeduplicator {
fn clone(&self) -> Self {
- let mut builder = Cache::builder();
+ let builder = Cache::builder();
let builder = Self::setup_cache_builder(builder, self.max_entries, self.ttl);
let cache = builder.build();
@@ -65,8 +65,8 @@ impl MessageDeduplicator {
/// Creates a new message deduplicator with the given max entries and time to live for each ID.
pub fn new(max_entries: Option<u64>, ttl: Option<IggyDuration>) -> Self {
- let mut builder = Cache::builder();
- let mut builder = Self::setup_cache_builder(builder, max_entries, ttl);
+ let builder = Cache::builder();
+ let builder = Self::setup_cache_builder(builder, max_entries, ttl);
let cache = builder.build();
Self {
diff --git a/core/server/src/streaming/partitions/helpers.rs b/core/server/src/streaming/partitions/helpers.rs
index 312152c6..d0cff51b 100644
--- a/core/server/src/streaming/partitions/helpers.rs
+++ b/core/server/src/streaming/partitions/helpers.rs
@@ -1,10 +1,9 @@
use error_set::ErrContext;
use iggy_common::{ConsumerOffsetInfo, Identifier, IggyByteSize, IggyError};
use std::{
- ops::{AsyncFnOnce, Index},
+ ops::AsyncFnOnce,
sync::{Arc, atomic::Ordering},
};
-use sysinfo::Component;
use crate::{
configs::{cache_indexes::CacheIndexesConfig, system::SystemConfig},
@@ -19,7 +18,7 @@ use crate::{
deduplication::message_deduplicator::MessageDeduplicator,
partitions::{
consumer_offset::ConsumerOffset,
- journal::{Journal, MemoryMessageJournal},
+ journal::Journal,
partition2::{self, PartitionRef, PartitionRefMut},
storage2,
},
diff --git a/core/server/src/streaming/partitions/log.rs b/core/server/src/streaming/partitions/log.rs
index 3ff049e9..922f929b 100644
--- a/core/server/src/streaming/partitions/log.rs
+++ b/core/server/src/streaming/partitions/log.rs
@@ -1,10 +1,6 @@
-use crate::{
- configs::system::SystemConfig,
- slab::partitions::{self},
- streaming::{
- partitions::journal::Journal,
- segments::{IggyIndexesMut, Segment2, storage::Storage},
- },
+use crate::streaming::{
+ partitions::journal::Journal,
+ segments::{IggyIndexesMut, Segment2, storage::Storage},
};
use iggy_common::INDEX_SIZE;
use ringbuffer::AllocRingBuffer;
diff --git a/core/server/src/streaming/partitions/messages.rs b/core/server/src/streaming/partitions/messages.rs
index f11a8021..69fc6592 100644
--- a/core/server/src/streaming/partitions/messages.rs
+++ b/core/server/src/streaming/partitions/messages.rs
@@ -16,14 +16,6 @@
* under the License.
*/
-use crate::streaming::partitions::COMPONENT;
-use crate::streaming::polling_consumer::PollingConsumer;
-use crate::streaming::segments::*;
-use error_set::ErrContext;
-use iggy_common::{IggyError, IggyTimestamp, Sizeable};
-use std::sync::atomic::Ordering;
-use tracing::trace;
-
/*
impl Partition {
/// Retrieves messages by timestamp (up to a specified count).
diff --git a/core/server/src/streaming/partitions/partition2.rs b/core/server/src/streaming/partitions/partition2.rs
index e965a270..d635e863 100644
--- a/core/server/src/streaming/partitions/partition2.rs
+++ b/core/server/src/streaming/partitions/partition2.rs
@@ -17,10 +17,7 @@ use crate::{
};
use iggy_common::{Identifier, IggyTimestamp};
use slab::Slab;
-use std::{
- rc::Rc,
- sync::{Arc, atomic::AtomicU64},
-};
+use std::sync::{Arc, atomic::AtomicU64};
#[derive(Debug, Clone)]
pub struct ConsumerOffsets(papaya::HashMap<usize, consumer_offset::ConsumerOffset>);
diff --git a/core/server/src/streaming/partitions/segments.rs b/core/server/src/streaming/partitions/segments.rs
index df9c7067..44e4bb7f 100644
--- a/core/server/src/streaming/partitions/segments.rs
+++ b/core/server/src/streaming/partitions/segments.rs
@@ -16,15 +16,6 @@
* under the License.
*/
-use std::sync::atomic::Ordering;
-
-use crate::streaming::partitions::COMPONENT;
-use crate::streaming::segments::*;
-use error_set::ErrContext;
-use iggy_common::IggyError;
-use iggy_common::IggyTimestamp;
-use tracing::info;
-
pub struct DeletedSegment {
pub end_offset: u64,
pub messages_count: u32,
diff --git a/core/server/src/streaming/partitions/storage2.rs b/core/server/src/streaming/partitions/storage2.rs
index 5de830f9..4977121d 100644
--- a/core/server/src/streaming/partitions/storage2.rs
+++ b/core/server/src/streaming/partitions/storage2.rs
@@ -3,13 +3,8 @@ use crate::{
configs::system::SystemConfig,
io::fs_utils::remove_dir_all,
shard_error, shard_info, shard_trace,
- streaming::{
- partitions::{
- consumer_offset::ConsumerOffset,
- journal::MemoryMessageJournal,
- log::{Log, SegmentedLog},
- },
- segments::Segment2,
+ streaming::partitions::{
+ consumer_offset::ConsumerOffset, journal::MemoryMessageJournal, log::SegmentedLog,
},
};
use compio::{
@@ -18,12 +13,7 @@ use compio::{
};
use error_set::ErrContext;
use iggy_common::{ConsumerKind, IggyError};
-use std::{
- io::Read,
- ops::Deref,
- path::Path,
- sync::{Arc, atomic::AtomicU64},
-};
+use std::{io::Read, path::Path, sync::atomic::AtomicU64};
use tracing::{error, trace};
pub async fn create_partition_file_hierarchy(
diff --git a/core/server/src/streaming/segments/indexes/index_reader.rs b/core/server/src/streaming/segments/indexes/index_reader.rs
index cf4df83c..ff9800d7 100644
--- a/core/server/src/streaming/segments/indexes/index_reader.rs
+++ b/core/server/src/streaming/segments/indexes/index_reader.rs
@@ -20,22 +20,16 @@ use super::IggyIndexesMut;
use crate::streaming::utils::PooledBuffer;
use bytes::BytesMut;
use compio::{
- BufResult,
buf::{IntoInner, IoBuf},
fs::{File, OpenOptions},
io::AsyncReadAtExt,
};
use error_set::ErrContext;
use iggy_common::{INDEX_SIZE, IggyError, IggyIndex, IggyIndexView};
-use ring::error;
use std::{
io::ErrorKind,
- os::unix::fs::FileExt,
rc::Rc,
- sync::{
- Arc,
- atomic::{AtomicU64, Ordering},
- },
+ sync::atomic::{AtomicU64, Ordering},
};
use tracing::{error, trace};
diff --git a/core/server/src/streaming/segments/indexes/index_writer.rs b/core/server/src/streaming/segments/indexes/index_writer.rs
index 1c14d14f..4e77766c 100644
--- a/core/server/src/streaming/segments/indexes/index_writer.rs
+++ b/core/server/src/streaming/segments/indexes/index_writer.rs
@@ -23,10 +23,7 @@ use error_set::ErrContext;
use iggy_common::INDEX_SIZE;
use iggy_common::IggyError;
use std::rc::Rc;
-use std::sync::{
- Arc,
- atomic::{AtomicU64, Ordering},
-};
+use std::sync::atomic::{AtomicU64, Ordering};
use tracing::trace;
use crate::streaming::utils::PooledBuffer;
diff --git a/core/server/src/streaming/segments/messages/messages_reader.rs b/core/server/src/streaming/segments/messages/messages_reader.rs
index ccdfec07..284d3d6e 100644
--- a/core/server/src/streaming/segments/messages/messages_reader.rs
+++ b/core/server/src/streaming/segments/messages/messages_reader.rs
@@ -27,10 +27,7 @@ use iggy_common::IggyError;
use std::rc::Rc;
use std::{
io::ErrorKind,
- sync::{
- Arc,
- atomic::{AtomicU64, Ordering},
- },
+ sync::atomic::{AtomicU64, Ordering},
};
use tracing::{error, trace};
@@ -84,7 +81,7 @@ impl MessagesReader {
Ok(Self {
file_path: file_path.to_string(),
- file: file.into(),
+ file,
messages_size_bytes,
})
}
diff --git a/core/server/src/streaming/segments/messages/messages_writer.rs b/core/server/src/streaming/segments/messages/messages_writer.rs
index da1b5adc..2c506d60 100644
--- a/core/server/src/streaming/segments/messages/messages_writer.rs
+++ b/core/server/src/streaming/segments/messages/messages_writer.rs
@@ -22,12 +22,9 @@ use error_set::ErrContext;
use iggy_common::{IggyByteSize, IggyError};
use std::{
rc::Rc,
- sync::{
- Arc,
- atomic::{AtomicU64, Ordering},
- },
+ sync::atomic::{AtomicU64, Ordering},
};
-use tracing::{error, trace};
+use tracing::trace;
/// A dedicated struct for writing to the messages file.
#[derive(Debug)]
diff --git a/core/server/src/streaming/streams/helpers.rs b/core/server/src/streaming/streams/helpers.rs
index 73afc612..67783de5 100644
--- a/core/server/src/streaming/streams/helpers.rs
+++ b/core/server/src/streaming/streams/helpers.rs
@@ -46,7 +46,7 @@ pub fn store_consumer_offset(
) -> impl FnOnce(ComponentsById<StreamRef>) {
move |(root, ..)| {
let stream_id = root.id();
- root.topics().with_topic_by_id(&topic_id, |(root, ..)| {
+ root.topics().with_topic_by_id(topic_id, |(root, ..)| {
let topic_id = root.id();
root.partitions().with_components_by_id(
partition_id,
@@ -72,7 +72,7 @@ pub fn store_consumer_group_member_offset(
) -> impl FnOnce(ComponentsById<StreamRef>) {
move |(root, ..)| {
let stream_id = root.id();
- root.topics().with_topic_by_id(&topic_id, |(root, ..)| {
+ root.topics().with_topic_by_id(topic_id, |(root, ..)| {
let topic_id = root.id();
root.partitions().with_components_by_id(
partition_id,
diff --git a/core/server/src/streaming/topics/helpers.rs b/core/server/src/streaming/topics/helpers.rs
index 222aa20b..8b925a0d 100644
--- a/core/server/src/streaming/topics/helpers.rs
+++ b/core/server/src/streaming/topics/helpers.rs
@@ -5,20 +5,15 @@ use crate::{
slab::{
Keyed,
consumer_groups::{self, ConsumerGroups},
- partitions::{self, Partitions},
+ partitions::{self},
topics::{self, Topics},
- traits_ext::{
- ComponentsById, Delete, DeleteCell, EntityComponentSystem, EntityComponentSystemMut,
- EntityMarker, Insert, IntoComponents,
- },
+ traits_ext::{ComponentsById, Delete, DeleteCell, EntityMarker},
},
streaming::{
- partitions::partition2,
stats::stats::TopicStats,
topics::{
consumer_group2::{
- self, ConsumerGroupMembers, ConsumerGroupRef, ConsumerGroupRefMut,
- MEMBERS_CAPACITY, Member,
+ self, ConsumerGroupMembers, ConsumerGroupRef, ConsumerGroupRefMut, Member,
},
topic2::{Topic, TopicRef, TopicRefMut, TopicRoot},
},
diff --git a/core/server/src/streaming/topics/storage2.rs b/core/server/src/streaming/topics/storage2.rs
index 86d783b1..f355b74f 100644
--- a/core/server/src/streaming/topics/storage2.rs
+++ b/core/server/src/streaming/topics/storage2.rs
@@ -1,4 +1,3 @@
-use super::COMPONENT;
use compio::fs::create_dir_all;
use iggy_common::IggyError;
use std::path::Path;
diff --git a/core/server/src/streaming/topics/topic2.rs b/core/server/src/streaming/topics/topic2.rs
index 2142b19b..930d96af 100644
--- a/core/server/src/streaming/topics/topic2.rs
+++ b/core/server/src/streaming/topics/topic2.rs
@@ -1,14 +1,10 @@
-use crate::configs::system::SystemConfig;
use crate::shard_trace;
use crate::slab::streams::Streams;
use crate::slab::topics;
use crate::slab::traits_ext::{EntityMarker, InsertCell, IntoComponents, IntoComponentsById};
use crate::slab::{Keyed, consumer_groups::ConsumerGroups, partitions::Partitions};
-use crate::streaming::partitions::log::SegmentedLog;
use crate::streaming::stats::stats::{StreamStats, TopicStats};
-use iggy_common::{
- CompressionAlgorithm, Identifier, IggyError, IggyExpiry, IggyTimestamp, MaxTopicSize,
-};
+use iggy_common::{CompressionAlgorithm, Identifier, IggyExpiry, IggyTimestamp, MaxTopicSize};
use slab::Slab;
use std::cell::{Ref, RefMut};
use std::sync::Arc;
diff --git a/core/server/src/streaming/utils/memory_pool.rs b/core/server/src/streaming/utils/memory_pool.rs
index 2cc031d3..ed9cb4e9 100644
--- a/core/server/src/streaming/utils/memory_pool.rs
+++ b/core/server/src/streaming/utils/memory_pool.rs
@@ -21,10 +21,9 @@ use bytes::BytesMut;
use crossbeam::queue::ArrayQueue;
use human_repr::HumanCount;
use once_cell::sync::OnceCell;
-use std::rc::Rc;
use std::sync::Arc;
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
-use tracing::{error, info, trace, warn};
+use tracing::{info, trace, warn};
/// Global memory pool instance. Use `memory_pool()` to access it.
pub static MEMORY_POOL: OnceCell<MemoryPool> = OnceCell::new();
diff --git a/core/server/src/tcp/connection_handler.rs b/core/server/src/tcp/connection_handler.rs
index 597e6162..1427640a 100644
--- a/core/server/src/tcp/connection_handler.rs
+++ b/core/server/src/tcp/connection_handler.rs
@@ -76,8 +76,8 @@ pub(crate) async fn handle_connection(
u32::from_le_bytes(code_buffer_out[0..INITIAL_BYTES_LENGTH].try_into().unwrap());
initial_buffer.clear();
code_buffer_out.clear();
- length_buffer = BytesMut::from(initial_buffer);
- code_buffer = BytesMut::from(code_buffer_out);
+ length_buffer = initial_buffer;
+ code_buffer = code_buffer_out;
debug!("Received a TCP request, length: {length}, code: {code}");
let command = ServerCommand::from_code_and_reader(code, sender, length - 4).await?;
debug!("Received a TCP command: {command}, payload size: {length}");
diff --git a/core/server/src/tcp/sender.rs b/core/server/src/tcp/sender.rs
index 52a5891e..2f9ee8b5 100644
--- a/core/server/src/tcp/sender.rs
+++ b/core/server/src/tcp/sender.rs
@@ -16,16 +16,13 @@
* under the License.
*/
-use bytes::{Bytes, BytesMut};
use compio::{
BufResult,
- buf::{IoBuf, IoBufMut},
- io::{AsyncRead, AsyncReadAtExt, AsyncReadExt, AsyncWriteExt},
+ buf::IoBufMut,
+ io::{AsyncReadExt, AsyncWriteExt},
};
use iggy_common::IggyError;
-use nix::libc;
-use std::io::IoSlice;
-use tracing::{debug, error, warn};
+use tracing::debug;
use crate::streaming::utils::PooledBuffer;
diff --git a/core/server/src/tcp/tcp_listener.rs b/core/server/src/tcp/tcp_listener.rs
index 0614cb01..8fc8cbd3 100644
--- a/core/server/src/tcp/tcp_listener.rs
+++ b/core/server/src/tcp/tcp_listener.rs
@@ -29,9 +29,7 @@ use futures::FutureExt;
use iggy_common::{IggyError, TransportProtocol};
use std::net::SocketAddr;
use std::rc::Rc;
-use std::sync::Arc;
use std::time::Duration;
-use tracing::{error, info};
async fn create_listener(
addr: SocketAddr,
@@ -149,7 +147,7 @@ async fn accept_loop(
// Broadcast session to all shards.
let event = ShardEvent::NewSession { address, transport };
// TODO: Fixme look inside of broadcast_event_to_all_shards method.
- let _responses = shard_clone.broadcast_event_to_all_shards(event.into()).await;
+ let _responses = shard_clone.broadcast_event_to_all_shards(event).await;
let client_id = session.client_id;
shard_info!(shard.id, "Created new session: {}", session);
diff --git a/core/server/src/tcp/tcp_sender.rs b/core/server/src/tcp/tcp_sender.rs
index ea8eb93f..9e23be67 100644
--- a/core/server/src/tcp/tcp_sender.rs
+++ b/core/server/src/tcp/tcp_sender.rs
@@ -20,13 +20,11 @@ use crate::binary::sender::Sender;
use crate::streaming::utils::PooledBuffer;
use crate::tcp::COMPONENT;
use crate::{server_error::ServerError, tcp::sender};
-use bytes::BytesMut;
-use compio::buf::{IoBuf, IoBufMut};
+use compio::buf::IoBufMut;
use compio::io::AsyncWrite;
use compio::net::TcpStream;
use error_set::ErrContext;
use iggy_common::IggyError;
-use nix::libc;
#[derive(Debug)]
pub struct TcpSender {
diff --git a/core/server/src/tcp/tcp_tls_listener.rs b/core/server/src/tcp/tcp_tls_listener.rs
index 1bf22e03..c69326d2 100644
--- a/core/server/src/tcp/tcp_tls_listener.rs
+++ b/core/server/src/tcp/tcp_tls_listener.rs
@@ -210,7 +210,7 @@ async fn accept_loop(
// Broadcast session to all shards.
let event = ShardEvent::NewSession { address, transport };
// TODO: Fixme look inside of broadcast_event_to_all_shards method.
- let _responses = shard_clone.broadcast_event_to_all_shards(event.into()).await;
+ let _responses = shard_clone.broadcast_event_to_all_shards(event).await;
let client_id = session.client_id;
shard_info!(shard_clone.id, "Created new session: {}", session);