fn parse_operator_rates(file: &Path, verbose: bool) -> Vec<(OperatorId,Rate)>
{
    let file = File::open(&file).expect("Cannot open operator rates file.");
    let reader = BufReader::new(file);
    let mut source_rates = Vec::new();
    for line in reader.lines()
    {
        let line = line.unwrap();
        if line.len() == 0 || line.chars().next() == Some('#') { continue; }
        let fields: Vec<&str> = line.split(',').map(|x| x.trim()).collect();
        let op_id = fields[0].to_string();
        let op_rate = Rate::from_str(fields[1]).expect("Cannot parse operator rate.");
        if verbose { println!("Found operator {} with rate {} per instance",&op_id,op_rate); }
        source_rates.push((op_id,op_rate));
    }
    source_rates
}
/// Parses operator rates from a CSV file into a vector
///
/// # Arguments
///
/// `file`: The path to the CSV file
///
/// `verbose`: A boolean flag to print further information to standard output
///
/// # Returns
///
/// A vector of `(OperatorId,Rate)` pairs, where
/// `OperatorId` is the id of an operator and
/// `Rate` is its (processing or output) rate
///
/// # Comments
///
/// * Each line in `file` has the form:
///
///   `operator_id,true_rate_per_instance`
///
/// * This function is used in Heron experiments to provide a max true processing rate per operator, and in Flink/Timely experiments to provide a fixed true output rate for source operators
Parses operator rates from a CSV file into a vector
Parses operator rates from a CSV file into a vector
fn parse_operator_rates(file: &Path, verbose: bool) -> Vec<(OperatorId,Rate)>
{
    let file = File::open(&file).expect("Cannot open operator rates file.");
    let reader = BufReader::new(file);
    let mut source_rates = Vec::new();
    for line in reader.lines()
    {
        let line = line.unwrap();
        if line.len() == 0 || line.chars().next() == Some('#') { continue; }
        let fields: Vec<&str> = line.split(',').map(|x| x.trim()).collect();
        let op_id = fields[0].to_string();
        let op_rate = Rate::from_str(fields[1]).expect("Cannot parse operator rate.");
        if verbose { println!("Found operator {} with rate {} per instance",&op_id,op_rate); }
        source_rates.push((op_id,op_rate));
    }
    source_rates
}
fn parse_operator_rates ( file : & Path , verbose : bool ) -> Vec < ( OperatorId , Rate ) > { let file = File :: open ( & file ) . expect ( " " ) ; let reader = BufReader :: new ( file ) ; let mut source_rates = Vec :: new ( ) ; for line in reader . lines ( ) { let line = line . unwrap ( ) ; if line . len ( ) == 0 || line . chars ( ) . next ( ) == Some ( '#' ) { continue ; } let fields : Vec < & str > = line . split ( ',' ) . map ( | x | x . trim ( ) ) . collect ( ) ; let op_id = fields [ 0 ] . to_string ( ) ; let op_rate = Rate :: from_str ( fields [ 1 ] ) . expect ( " " ) ; if verbose { println ! ( " " op_id op_rate ) ; } source_rates . push ( ( op_id , op_rate ) ) ; } source_rates }
Parses operator rates from a CSV file into a vector
Parses operator rates from a CSV file into a vector
file
&Path
verbose
bool
A vector of `(OperatorId,Rate)` pairs, where
`OperatorId` is the id of an operator and
`Rate` is its (processing or output) rate
A vector of ` ( OperatorId Rate ) ` pairs where ` OperatorId ` is the id of an operator and ` Rate ` is its ( processing or output ) rate
file
&Path
verbose
bool
comments
Each line in `file` has the form.



This function is used in Heron experiments to provide a max true processing rate per operator, and in Flink/Timely experiments to provide a fixed true output rate for source operators
Each line in ` file ` has the form . This function is used in Heron experiments to provide a max true processing rate per operator and in Flink / Timely experiments to provide a fixed true output rate for source operators