/// Validate cli options. Generate target-server and produce log configuration.
Validate cli options. Generate target-server and produce log configuration.
Validate cli options . Generate target - server and produce log configuration .
pub fn validate(self) -> Result<(ReplicaLeaderConfig, ProduceLogConfig), CliError> {
        let target_server = ReplicaLeaderConfig::new(self.sc, self.spu, self.kf, self.profile)?;
        // generate file record
        let records_from_file = if let Some(record_per_line) = self.record_per_line {
            Some(FileRecord::Lines(record_per_line.clone()))
        } else if self.record_file.len() > 0 {
            Some(FileRecord::Files(self.record_file.clone()))
        } else {
            None
        };
        // produce log specific configurations
        let produce_log_cfg = ProduceLogConfig {
            topic: self.topic,
            partition: self.partition,
            records_form_file: records_from_file,
            continuous: self.continuous,
        };
        // return server separately from config
        Ok((target_server, produce_log_cfg))
    }
pub fn validate ( self ) -> Result < ( ReplicaLeaderConfig , ProduceLogConfig ) , CliError > { let target_server = ReplicaLeaderConfig :: new ( self . sc , self . spu , self . kf , self . profile ) ? ; // generate file record let records_from_file = if let Some ( record_per_line ) = self . record_per_line { Some ( FileRecord :: Lines ( record_per_line . clone ( ) ) ) } else if self . record_file . len ( ) > 0 { Some ( FileRecord :: Files ( self . record_file . clone ( ) ) ) } else { None } ; // produce log specific configurations let produce_log_cfg = ProduceLogConfig { topic : self . topic , partition : self . partition , records_form_file : records_from_file , continuous : self . continuous , } ; // return server separately from config Ok ( ( target_server , produce_log_cfg ) ) }
Validate cli options.
Validate cli options .
self