diff --git a/scylla/src/statement/batch.rs b/scylla/src/statement/batch.rs index 01fd17147..7665a8198 100644 --- a/scylla/src/statement/batch.rs +++ b/scylla/src/statement/batch.rs @@ -1,6 +1,7 @@ use std::sync::Arc; use crate::history::HistoryListener; +use crate::load_balancing; use crate::retry_policy::RetryPolicy; use crate::statement::{prepared_statement::PreparedStatement, query::Query}; use crate::transport::{execution_profile::ExecutionProfileHandle, Node}; @@ -211,12 +212,10 @@ impl Batch { self.set_execution_profile_handle(Some( execution_profile_handle .pointee_to_builder() - .load_balancing_policy(Arc::new( - crate::load_balancing::EnforceTargetNodePolicy::new( - node, - execution_profile_handle.load_balancing_policy(), - ), - )) + .load_balancing_policy(Arc::new(load_balancing::EnforceTargetNodePolicy::new( + node, + execution_profile_handle.load_balancing_policy(), + ))) .build() .into_handle(), )) diff --git a/scylla/src/transport/load_balancing/enforce_node.rs b/scylla/src/transport/load_balancing/enforce_node.rs index f3809603c..3b5650849 100644 --- a/scylla/src/transport/load_balancing/enforce_node.rs +++ b/scylla/src/transport/load_balancing/enforce_node.rs @@ -1,6 +1,7 @@ use super::{DefaultPolicy, FallbackPlan, LoadBalancingPolicy, NodeRef, RoutingInfo}; use crate::transport::{cluster::ClusterData, Node}; use std::sync::Arc; +use uuid::Uuid; /// This policy will always return the same node, unless it is not available anymore, in which case it will /// fallback to the provided policy. @@ -8,7 +9,7 @@ use std::sync::Arc; /// This is meant to be used for shard-aware batching. #[derive(Debug)] pub struct EnforceTargetNodePolicy { - target_node: uuid::Uuid, + target_node: Uuid, fallback: Arc, }