Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
picodata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
picodata
Commits
e7de965c
Unverified
Commit
e7de965c
authored
3 years ago
by
Sergey V
Browse files
Options
Downloads
Patches
Plain Diff
refactor: cosmetics
parent
61ea1dfe
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!24
refactor: cosmetics
Pipeline
#3458
passed
3 years ago
Stage: build
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
picolib/lib.rs
+3
-3
3 additions, 3 deletions
picolib/lib.rs
picolib/tarantool.rs
+1
-0
1 addition, 0 deletions
picolib/tarantool.rs
picolib/traft/storage.rs
+6
-5
6 additions, 5 deletions
picolib/traft/storage.rs
with
10 additions
and
8 deletions
picolib/lib.rs
+
3
−
3
View file @
e7de965c
...
...
@@ -117,7 +117,7 @@ fn main_run() {
..
Default
::
default
()
};
std
::
env
::
var
(
"PICODATA_DATA_DIR"
)
.ok
()
.
and_then
(|
v
|
{
std
::
env
::
var
(
"PICODATA_DATA_DIR"
)
.ok
()
.
map
(|
v
|
{
std
::
fs
::
create_dir_all
(
&
v
)
.unwrap
();
cfg
.wal_dir
=
v
.clone
();
cfg
.memtx_dir
=
v
.clone
();
...
...
@@ -135,7 +135,7 @@ fn main_run() {
let
node
=
traft
::
Node
::
new
(
&
raft_cfg
,
handle_committed_data
)
.unwrap
();
stash
.set_raft_node
(
node
);
std
::
env
::
var
(
"PICODATA_LISTEN"
)
.ok
()
.
and_then
(|
v
|
{
std
::
env
::
var
(
"PICODATA_LISTEN"
)
.ok
()
.
map
(|
v
|
{
cfg
.listen
=
Some
(
v
.clone
());
Some
(
v
)
});
...
...
@@ -166,7 +166,7 @@ fn handle_committed_data(data: &[u8]) {
match
Message
::
try_from
(
data
)
{
Ok
(
x
)
=>
match
x
{
EvalLua
{
code
}
=>
crate
::
tarantool
::
eval
(
&
code
),
Info
{
msg
}
=>
tlog!
(
Info
,
"{
}"
,
msg
),
Info
{
msg
}
=>
tlog!
(
Info
,
"{msg
}"
),
Empty
=>
{}
},
Err
(
why
)
=>
tlog!
(
Error
,
"cannot decode raft entry data: {}"
,
why
),
...
...
This diff is collapsed.
Click to expand it.
picolib/tarantool.rs
+
1
−
0
View file @
e7de965c
use
std
::
ffi
::
CStr
;
use
tarantool
::
global_lua
;
use
tarantool
::
tlua
::{
self
,
LuaFunction
};
...
...
This diff is collapsed.
Click to expand it.
picolib/traft/storage.rs
+
6
−
5
View file @
e7de965c
use
std
::
convert
::
TryFrom
;
use
::
raft
::
prelude
as
raft
;
use
::
raft
::
Error
as
RaftError
;
use
::
raft
::
StorageError
;
use
::
tarantool
::
index
::
IteratorType
;
use
::
tarantool
::
space
::
Space
;
use
::
tarantool
::
tuple
::
Tuple
;
use
std
::
convert
::
TryFrom
;
use
serde
::
de
::
DeserializeOwned
;
use
serde
::
Serialize
;
use
crate
::
tlog
;
use
crate
::
traft
::
row
;
use
serde
::
de
::
DeserializeOwned
;
use
serde
::
Serialize
;
pub
struct
Storage
;
pub
const
SPACE_RAFT_STATE
:
&
'static
str
=
"raft_state"
;
pub
const
SPACE_RAFT_LOG
:
&
'static
str
=
"raft_log"
;
pub
const
SPACE_RAFT_STATE
:
&
str
=
"raft_state"
;
pub
const
SPACE_RAFT_LOG
:
&
str
=
"raft_log"
;
impl
Storage
{
pub
fn
init_schema
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment