Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

Commit

Permalink
fix clippy and fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-dukhno committed May 7, 2021
1 parent f4f9053 commit 42d3912
Show file tree
Hide file tree
Showing 27 changed files with 51 additions and 6,344 deletions.
12 changes: 5 additions & 7 deletions node_engine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use data_manipulation::{QueryPlan, TypedQuery, UntypedQuery};
use data_manipulation::{QueryPlan, UntypedQuery};
use data_repr::scalar::ScalarValue;
pub use node_engine_old::NodeEngineOld;
pub use node_engine::NodeEngine;
use postgre_sql::query_ast::Query;
use std::collections::HashMap;
use types::SqlTypeFamily;

mod node_engine_old;
mod query_engine_old;
mod node_engine;
mod query_executor;
mod session_old;
mod transaction_manager;
mod worker;

Expand Down Expand Up @@ -55,7 +53,7 @@ impl QueryPlanCache {
query,
sql,
param_types,
}) => Some((query.clone(), sql.clone(), param_types.to_vec())),
}) => Some((query, sql, param_types.to_vec())),
Some(_) => None,
}
}
Expand Down Expand Up @@ -86,7 +84,7 @@ impl QueryPlanCache {
pub fn bind_portal(&mut self, statement_name: String, portal_name: String, portal: Portal) {
self.portal_per_statement
.entry(statement_name)
.or_insert_with(|| vec![])
.or_insert_with(Vec::new)
.push(portal_name.clone());
self.all_portals.insert(portal_name, portal);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use crate::query_engine_old::QueryEngineOld;
use crate::worker::Worker;
use native_tls::Identity;
use postgre_sql::wire_protocol::PgWireAcceptor;
Expand All @@ -22,15 +21,14 @@ use std::{
io::{self, Read},
net::TcpListener,
path::{Path, PathBuf},
sync::{Arc, Mutex},
thread,
};
use storage::Database;

#[derive(Default, Clone)]
pub struct NodeEngineOld;
pub struct NodeEngine;

impl NodeEngineOld {
impl NodeEngine {
pub fn start(&self, database: Database) {
let listener = TcpListener::bind("0.0.0.0:5432").expect("create listener");

Expand Down Expand Up @@ -58,33 +56,6 @@ impl NodeEngineOld {
worker.process(&mut connection, db);

Ok(())

// let arc = Arc::new(Mutex::new(connection));
// let mut query_engine = QueryEngineOld::new(arc.clone(), db);
// log::debug!("ready to handle query");
//
// loop {
// let mut guard = arc.lock().unwrap();
// let result = guard.receive();
// drop(guard);
// log::debug!("{:?}", result);
// match result {
// Err(e) => {
// log::error!("UNEXPECTED ERROR: {:?}", e);
// return Err(e);
// }
// Ok(Err(e)) => {
// log::error!("UNEXPECTED ERROR: {:?}", e);
// return Err(io::ErrorKind::InvalidInput.into());
// }
// Ok(Ok(client_request)) => match query_engine.execute(client_request) {
// Ok(()) => {}
// Err(_) => {
// break Ok(());
// }
// },
// }
// }
});
}
}
Expand Down
1,178 changes: 0 additions & 1,178 deletions node_engine/src/query_engine_old/mod.rs

This file was deleted.

97 changes: 0 additions & 97 deletions node_engine/src/query_engine_old/tests/delete.rs

This file was deleted.

0 comments on commit 42d3912

Please sign in to comment.