You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: executor.rs
    path of file: ./repos/pathivu/src/queryexecutor
    
    the code of the file until where you have to start completion: /*
 * Copyright 2019 Balaji Jinnah and Contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
use crate::config::config::Config;
use crate::ingester::manager::Manager;
use crate::iterator::merge_iterator::MergeIteartor;
use crate::json_parser::parser::get_value_from_json;
use crate::parser::parser;
use crate::partition::partition_iterator::PartitionIterator;
use crate::partition::segment_iterator::Entry;
use crate::server::server::PartitionHandler;
use crate::store::store::Store;
use crate::types::types::ResLine;
use crate::types::types::{IngesterFlushHintReq, STRUCTURED_DATA};
use crate::util::util::{
    convert_static_node_to_f32, convert_static_node_to_string, convert_string_to_f32,
};
use failure::format_err;
use futures::channel::oneshot;
use futures::executor::block_on;
use log::warn;
use serde_json::json;
use simd_json::value::borrowed::Value;
use std::cell::RefCell;
use std::collections::HashMap;
use std::rc::Rc;

pub struct QueryExecutor<S: Store + Clone> {
    store: S,
    cfg: Config,
    manager: Manager,
    partition_handler: PartitionHandler,
}

impl<S: Store + Clone> QueryExecutor<S> {
    pub fn new(cfg: Config, manager: Manager, store: S) -> QueryExecutor<S> {
        let path = cfg.dir.clone();
        QueryExecutor {
            store
    
    fn test_count() {
        let cfg = get_test_cfg();
        let store = get_test_store(cfg.clone()).clone();
        // Create log lines.
        let mut lines = Vec::new();
        lines.push(PushLogLine {
            raw_data: br#"{
            "name": "Licenser",
            "skills": {
                "language": "Rust",
                "la": ["yo","yo1"]
            },
            "age": 30
        }"#
            .to_vec(),
            indexes: Vec::new(),
            ts: 2,
            structured: true,
            json_keys: Vec::default(),
        });
        lines.push(PushLogLine {
            raw_data: br#"{
            "name": "Licenser",
            "skills": {
                "language": "Go",
                "yo": {
                    "age": 1
                },
                "la": ["yo","yo1"]
            },
            "age": 40
        }"#
            .to_vec(),
            indexes: Vec::new(),
            ts: 3,
            structured: true,
            json_keys: Vec::default(),
        });
        lines.push(PushLogLine {
            raw_data: br#"{
            "name": "Licenser",
            "skills": {
                "language": "Ruby",
                "yo": {
                    "age": 1
                },
                "la": ["yo","yo1"]
            },
            "age": 20
        }"#
            .to_vec(),
            indexes: Vec::new(),
            ts: 4,
            structured: true,
            json_keys: Vec::default(),
        });
        lines.push(PushLogLine {
            raw_data: br#"{
            "name": "Licenser",
            "skills": {
                "language": "Rust",
                "yo": {
                    "age": 1
                },
                "la": ["yo","yo1"]
            },
            "age": 15
        }"#
            .to_vec(),
            indexes: Vec::new(),
            ts: 5,
            structured: true,
            json_keys: Vec::default(),
        });
        lines.push(PushLogLine {
            raw_data: br#"{
            "name": "Licenser",
            "skills": {
                "language": "Go",
                "yo": {
                    "age": 1
                },
                "la": ["yo","yo1"]
            },
            "age": 45
        }"#
            .to_vec(),
            indexes: Vec::new(),
            ts: 7,
            structured: true,
            json_keys: Vec::default(),
        });

        // create merge iterator for the log lines.
        let mut itr = get_merge_iterator(cfg.clone(), store.clone(), lines);

        // create dummy transport for the executor
        let (sender, _) = mpsc::channel(1000);
        // Create executor to test the query.
        let manager = Manager {
            transport: vec![sender],
            no_of_shard: 1,
        };
        let executor = QueryExecutor::new(cfg, manager, store);

        let count = parser::Count {
            attr: "age".to_string(),
            alias: "age_count".to_string(),
            by: None,
        };

        let count_map = executor.handle_count(&mut itr, &count).unwrap();
        assert_eq!(*count_map.get(&"default".to_string()).unwrap(), 5);
    }