@@ -2,14 +2,12 @@ use crate::ccm::{IP_ALLOCATOR, ROOT_CCM_DIR};
22
33use super :: ip_allocator:: NetPrefix ;
44use super :: logged_cmd:: { LoggedCmd , RunOptions } ;
5- use super :: node_config:: NodeConfig ;
65use anyhow:: { Context , Error } ;
76use scylla:: client:: session_builder:: SessionBuilder ;
87use std:: collections:: HashMap ;
98use std:: net:: IpAddr ;
109use std:: path:: { Path , PathBuf } ;
1110use std:: process:: Command ;
12- use std:: str:: FromStr ;
1311use std:: sync:: Arc ;
1412use tempfile:: TempDir ;
1513use tokio:: fs:: metadata;
@@ -42,8 +40,6 @@ pub(crate) struct ClusterOptions {
4240 pub ( crate ) smp : u16 ,
4341 /// Amount of MB for Scylla to occupy has to be bigger than smp*512
4442 pub ( crate ) memory : u32 ,
45- /// scylla.yaml or cassandra.yaml
46- pub ( crate ) config : NodeConfig ,
4743 /// Don't call `ccm remove` when cluster instance is dropped
4844 pub ( crate ) do_not_remove_on_drop : bool ,
4945}
@@ -58,7 +54,6 @@ impl Default for ClusterOptions {
5854 nodes : Vec :: new ( ) ,
5955 smp : DEFAULT_SMP ,
6056 memory : DEFAULT_MEMORY ,
61- config : NodeConfig :: default ( ) ,
6257 do_not_remove_on_drop : false ,
6358 }
6459 }
@@ -219,23 +214,16 @@ impl NodeStopOptions {
219214pub ( crate ) struct Node {
220215 status : NodeStatus ,
221216 opts : NodeOptions ,
222- config : NodeConfig ,
223217 logged_cmd : Arc < LoggedCmd > ,
224218 /// A `--config-dir` for ccm
225219 config_dir : PathBuf ,
226220}
227221
228222#[ allow( dead_code) ]
229223impl Node {
230- fn new (
231- opts : NodeOptions ,
232- config : NodeConfig ,
233- logged_cmd : Arc < LoggedCmd > ,
234- config_dir : PathBuf ,
235- ) -> Self {
224+ fn new ( opts : NodeOptions , logged_cmd : Arc < LoggedCmd > , config_dir : PathBuf ) -> Self {
236225 Node {
237226 opts,
238- config,
239227 logged_cmd,
240228 status : NodeStatus :: Stopped ,
241229 config_dir,
@@ -259,25 +247,11 @@ impl Node {
259247 }
260248
261249 pub ( crate ) fn broadcast_rpc_address ( & self ) -> IpAddr {
262- match self . config . get ( "broadcast_rpc_address" , NodeConfig :: Null ) {
263- NodeConfig :: Null => self . opts . ip_prefix . to_ipaddress ( self . opts . id ) ,
264- NodeConfig :: String ( value) => IpAddr :: from_str ( value. as_str ( ) )
265- . with_context ( || format ! ( "unexpected content of broadcast_rpc_address: {value}" ) )
266- . unwrap ( ) ,
267- other => {
268- panic ! ( "unexpected content of broadcast_rpc_address: {other:#?}" )
269- }
270- }
250+ self . opts . ip_prefix . to_ipaddress ( self . opts . id )
271251 }
272252
273253 pub ( crate ) fn native_transport_port ( & self ) -> u16 {
274- match self . config . get ( "native_transport_port" , NodeConfig :: Null ) {
275- NodeConfig :: Null => 9042 ,
276- NodeConfig :: Int ( value) => value as u16 ,
277- other => {
278- panic ! ( "unexpected content of native_transport_port: {other:#?}" )
279- }
280- }
254+ 9042
281255 }
282256
283257 fn get_ccm_env ( & self ) -> HashMap < String , String > {
@@ -364,34 +338,6 @@ impl Node {
364338 Ok ( ( ) )
365339 }
366340
367- pub ( crate ) async fn sync_config ( & self ) -> Result < ( ) , Error > {
368- let mut args = vec ! [
369- self . opts. name( ) ,
370- "updateconf" . to_string( ) ,
371- "--config-dir" . to_string( ) ,
372- self . config_dir. to_string_lossy( ) . to_string( ) ,
373- ] ;
374-
375- // converting config to space separated list of `key:value`
376- // example:
377- // value: 1.1.1.1
378- // obj:
379- // value2: 2.2.2.2
380- // should become "value:1.1.1.1 obj.value2:2.2.2.2"
381- let additional: Vec < String > = self
382- . config
383- . to_flat_string ( )
384- . split_whitespace ( )
385- . map ( String :: from)
386- . collect ( ) ;
387-
388- args. extend ( additional) ;
389- self . logged_cmd
390- . run_command ( "ccm" , & args, RunOptions :: new ( ) )
391- . await ?;
392- Ok ( ( ) )
393- }
394-
395341 fn set_status ( & mut self , status : NodeStatus ) {
396342 self . status = status;
397343 }
@@ -524,7 +470,6 @@ impl Cluster {
524470 datacenter_id : datacenter_id. unwrap_or ( 1 ) ,
525471 ..NodeOptions :: from_cluster_opts ( & self . opts )
526472 } ,
527- self . opts . config . clone ( ) ,
528473 self . logged_cmd . clone ( ) ,
529474 self . config_dir ( ) . to_owned ( ) ,
530475 ) ;
0 commit comments