Skip to content
Snippets Groups Projects
Commit 7956512d authored by Igor Kuznetsov's avatar Igor Kuznetsov
Browse files

feat: update to actual tarantool-module

parent 13d882a9
No related branches found
No related tags found
1 merge request!1414sbroad import
...@@ -14,7 +14,7 @@ pest = "2.0" ...@@ -14,7 +14,7 @@ pest = "2.0"
pest_derive = "2.0" pest_derive = "2.0"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_yaml = "0.8" serde_yaml = "0.8"
tarantool = { git = "https://sbroad-cargo-token:t-nZyqJVVuhGQv17BX6v@gitlab.com/picodata/picodata/tarantool-module.git", rev="6f6bc329"} tarantool = { git = "https://sbroad-cargo-token:t-nZyqJVVuhGQv17BX6v@gitlab.com/picodata/picodata/tarantool-module.git", rev="d8921ec6"}
traversal = "0.1.2" traversal = "0.1.2"
yaml-rust = "0.4.1" yaml-rust = "0.4.1"
......
...@@ -11,7 +11,7 @@ else ...@@ -11,7 +11,7 @@ else
endif endif
endif endif
build: build:
cargo build cargo build --release
integration_test_app: integration_test_app:
cd test_app && rm -rf tmp/tarantool.log && TARANTOOL_LOG=tmp/tarantool.log ./.rocks/bin/luatest --coverage -v test/ cd test_app && rm -rf tmp/tarantool.log && TARANTOOL_LOG=tmp/tarantool.log ./.rocks/bin/luatest --coverage -v test/
...@@ -24,6 +24,6 @@ lint: ...@@ -24,6 +24,6 @@ lint:
build_test_app: build_test_app:
cd test_app && cartridge build cd test_app && cartridge build
cp -rf target/debug/$(SRC_LIB) test_app/.rocks/lib/tarantool/$(DEST_LIB) cp -rf target/release/$(SRC_LIB) test_app/.rocks/lib/tarantool/$(DEST_LIB)
test_all: test build build_test_app integration_test_app test_all: test build build_test_app integration_test_app
use crate::errors::QueryPlannerError; use crate::errors::QueryPlannerError;
use serde::ser::{Serialize, SerializeMap, Serializer}; use serde::ser::{Serialize, SerializeMap, Serializer};
use tarantool::hlua::{self, LuaRead}; use tarantool::tlua::{self, LuaRead};
use crate::ir::relation::Column; use crate::ir::relation::Column;
......
...@@ -6,7 +6,7 @@ use std::fmt::Formatter; ...@@ -6,7 +6,7 @@ use std::fmt::Formatter;
use serde::de::{Error, MapAccess, Visitor}; use serde::de::{Error, MapAccess, Visitor};
use serde::ser::{Serialize as SerSerialize, SerializeMap, Serializer}; use serde::ser::{Serialize as SerSerialize, SerializeMap, Serializer};
use serde::{Deserialize, Deserializer, Serialize}; use serde::{Deserialize, Deserializer, Serialize};
use tarantool::hlua::{self, LuaRead}; use tarantool::tlua::{self, LuaRead};
use crate::errors::QueryPlannerError; use crate::errors::QueryPlannerError;
......
use crate::executor::result::BoxExecuteFormat; use crate::executor::result::BoxExecuteFormat;
use tarantool::ffi::tarantool::luaT_state; use tarantool::tlua::{LuaError, LuaFunction};
use tarantool::hlua::{Lua, LuaError, LuaFunction};
/// Function get cartridge cluster schema /// Function get cartridge cluster schema
pub fn get_cluster_schema() -> Result<String, LuaError> { pub fn get_cluster_schema() -> Result<String, LuaError> {
let lua = unsafe { Lua::from_existing_state(luaT_state(), false) }; let lua = tarantool::lua_state();
let get_schema: LuaFunction<_> = lua.eval("return require('cartridge').get_schema")?; let get_schema: LuaFunction<_> = lua.eval("return require('cartridge').get_schema")?;
let res = get_schema.call()?; let res = get_schema.call()?;
...@@ -14,7 +13,7 @@ pub fn get_cluster_schema() -> Result<String, LuaError> { ...@@ -14,7 +13,7 @@ pub fn get_cluster_schema() -> Result<String, LuaError> {
/// Function execute sql query on selected node /// Function execute sql query on selected node
pub fn exec_query(bucket_id: u64, query: &str) -> Result<BoxExecuteFormat, LuaError> { pub fn exec_query(bucket_id: u64, query: &str) -> Result<BoxExecuteFormat, LuaError> {
let lua = unsafe { Lua::from_existing_state(luaT_state(), false) }; let lua = tarantool::lua_state();
lua.exec( lua.exec(
r#" r#"
...@@ -46,7 +45,7 @@ pub fn exec_query(bucket_id: u64, query: &str) -> Result<BoxExecuteFormat, LuaEr ...@@ -46,7 +45,7 @@ pub fn exec_query(bucket_id: u64, query: &str) -> Result<BoxExecuteFormat, LuaEr
/// Sends query to all instances and merges results after (map-reduce). /// Sends query to all instances and merges results after (map-reduce).
pub fn mp_exec_query(query: &str) -> Result<BoxExecuteFormat, LuaError> { pub fn mp_exec_query(query: &str) -> Result<BoxExecuteFormat, LuaError> {
let lua = unsafe { Lua::from_existing_state(luaT_state(), false) }; let lua = tarantool::lua_state();
lua.exec( lua.exec(
r#" r#"
...@@ -96,7 +95,7 @@ pub fn mp_exec_query(query: &str) -> Result<BoxExecuteFormat, LuaError> { ...@@ -96,7 +95,7 @@ pub fn mp_exec_query(query: &str) -> Result<BoxExecuteFormat, LuaError> {
/// Function get summary count of bucket from vshard /// Function get summary count of bucket from vshard
pub fn bucket_count() -> Result<u64, LuaError> { pub fn bucket_count() -> Result<u64, LuaError> {
let lua = unsafe { Lua::from_existing_state(luaT_state(), false) }; let lua = tarantool::lua_state();
let bucket_count_fn: LuaFunction<_> = let bucket_count_fn: LuaFunction<_> =
lua.eval("return require('vshard').router.bucket_count")?; lua.eval("return require('vshard').router.bucket_count")?;
......
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