Skip to content
Snippets Groups Projects
Verified Commit c5f683ca authored by Denis Smirnov's avatar Denis Smirnov
Browse files

refactoring: preprocessing for non-mock imports

parent 21f90b86
No related branches found
No related tags found
1 merge request!1414sbroad import
......@@ -4,17 +4,17 @@ use crate::executor::ir::ExecutionPlan;
use crate::ir::relation::SpaceEngine;
#[cfg(not(feature = "mock"))]
use crate::error;
#[cfg(not(feature = "mock"))]
use crate::errors::{Action, Entity};
#[cfg(not(feature = "mock"))]
use crate::ir::value::EncodedValue;
#[cfg(not(feature = "mock"))]
use tarantool::index::{FieldType, IndexOptions, IndexType, Part};
#[cfg(not(feature = "mock"))]
use tarantool::space::{Field, Space, SpaceCreateOptions};
mod prod_imports {
pub use crate::error;
pub use crate::errors::{Action, Entity};
pub use crate::ir::value::EncodedValue;
pub use tarantool::index::{FieldType, IndexOptions, IndexType, Part};
pub use tarantool::space::{Field, Space, SpaceCreateOptions};
pub use tarantool::tuple::Tuple;
}
#[cfg(not(feature = "mock"))]
use tarantool::tuple::Tuple;
use prod_imports::*;
#[allow(clippy::module_name_repetitions)]
#[derive(Hash, Eq, PartialEq, Debug)]
......
......@@ -27,17 +27,19 @@ use std::cell::RefCell;
use std::collections::HashMap;
use std::fmt::{Debug, Formatter};
mod fiber;
pub mod fiber;
pub mod statistics;
#[cfg(not(feature = "mock"))]
use crate::warn;
#[cfg(not(feature = "mock"))]
use fiber::fiber_id;
#[cfg(not(feature = "mock"))]
use tarantool::error::Error as TntError;
mod prod_imports {
pub use crate::warn;
pub use crate::otm::fiber::fiber_id;
pub use tarantool::error::Error as TntError;
pub use tarantool::transaction::start_transaction;
}
#[cfg(not(feature = "mock"))]
use tarantool::transaction::start_transaction;
use prod_imports::*;
static TRACER_NAME: &str = "libsbroad";
static RATIO: f64 = 0.01;
......
#[cfg(not(feature = "mock"))]
pub(super) fn fiber_id() -> u64 {
pub fn fiber_id() -> u64 {
let lua = tarantool::lua_state();
lua.get::<tarantool::tlua::LuaFunction<_>, _>("fiber_id")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment