@@ -2,14 +2,12 @@ use crate::ccm::{IP_ALLOCATOR, ROOT_CCM_DIR};
2
2
3
3
use super :: ip_allocator:: NetPrefix ;
4
4
use super :: logged_cmd:: { LoggedCmd , RunOptions } ;
5
- use super :: node_config:: NodeConfig ;
6
5
use anyhow:: { Context , Error } ;
7
6
use scylla:: client:: session_builder:: SessionBuilder ;
8
7
use std:: collections:: HashMap ;
9
8
use std:: net:: IpAddr ;
10
9
use std:: path:: { Path , PathBuf } ;
11
10
use std:: process:: Command ;
12
- use std:: str:: FromStr ;
13
11
use std:: sync:: Arc ;
14
12
use tempfile:: TempDir ;
15
13
use tokio:: fs:: metadata;
@@ -42,8 +40,6 @@ pub(crate) struct ClusterOptions {
42
40
pub ( crate ) smp : u16 ,
43
41
/// Amount of MB for Scylla to occupy has to be bigger than smp*512
44
42
pub ( crate ) memory : u32 ,
45
- /// scylla.yaml or cassandra.yaml
46
- pub ( crate ) config : NodeConfig ,
47
43
/// Don't call `ccm remove` when cluster instance is dropped
48
44
pub ( crate ) do_not_remove_on_drop : bool ,
49
45
}
@@ -58,7 +54,6 @@ impl Default for ClusterOptions {
58
54
nodes : Vec :: new ( ) ,
59
55
smp : DEFAULT_SMP ,
60
56
memory : DEFAULT_MEMORY ,
61
- config : NodeConfig :: default ( ) ,
62
57
do_not_remove_on_drop : false ,
63
58
}
64
59
}
@@ -219,23 +214,16 @@ impl NodeStopOptions {
219
214
pub ( crate ) struct Node {
220
215
status : NodeStatus ,
221
216
opts : NodeOptions ,
222
- config : NodeConfig ,
223
217
logged_cmd : Arc < LoggedCmd > ,
224
218
/// A `--config-dir` for ccm
225
219
config_dir : PathBuf ,
226
220
}
227
221
228
222
#[ allow( dead_code) ]
229
223
impl 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 {
236
225
Node {
237
226
opts,
238
- config,
239
227
logged_cmd,
240
228
status : NodeStatus :: Stopped ,
241
229
config_dir,
@@ -259,25 +247,11 @@ impl Node {
259
247
}
260
248
261
249
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 )
271
251
}
272
252
273
253
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
281
255
}
282
256
283
257
fn get_ccm_env ( & self ) -> HashMap < String , String > {
@@ -364,34 +338,6 @@ impl Node {
364
338
Ok ( ( ) )
365
339
}
366
340
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
-
395
341
fn set_status ( & mut self , status : NodeStatus ) {
396
342
self . status = status;
397
343
}
@@ -524,7 +470,6 @@ impl Cluster {
524
470
datacenter_id : datacenter_id. unwrap_or ( 1 ) ,
525
471
..NodeOptions :: from_cluster_opts ( & self . opts )
526
472
} ,
527
- self . opts . config . clone ( ) ,
528
473
self . logged_cmd . clone ( ) ,
529
474
self . config_dir ( ) . to_owned ( ) ,
530
475
) ;
0 commit comments