Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
R
rust-rocksdb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangzongwu
rust-rocksdb
Commits
84881bab
Commit
84881bab
authored
May 31, 2017
by
siddontang
Committed by
GitHub
May 31, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use rustfmt 0.6.0 (#61)
parent
b196e4dd
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
37 additions
and
37 deletions
+37
-37
.travis.yml
.travis.yml
+2
-1
circle.yml
circle.yml
+1
-1
test_compaction_filter.rs
tests/test_compaction_filter.rs
+6
-6
test_iterator.rs
tests/test_iterator.rs
+4
-6
test_multithreaded.rs
tests/test_multithreaded.rs
+14
-14
test_rocksdb_options.rs
tests/test_rocksdb_options.rs
+3
-3
test_slice_transform.rs
tests/test_slice_transform.rs
+2
-4
test_statistics.rs
tests/test_statistics.rs
+2
-2
Makefile
travis-build/Makefile
+3
-0
No files found.
.travis.yml
View file @
84881bab
...
@@ -15,7 +15,7 @@ os:
...
@@ -15,7 +15,7 @@ os:
# - osx
# - osx
before_script
:
before_script
:
-
cargo install --force --vers 0.6.1 rustfmt ||
true
-
make -f travis-build/Makefile prepare-rustfmt
script
:
script
:
-
cargo fmt && git diff-index --quiet HEAD -- || (echo please make format and run tests before creating a pr!; exit 1)
-
cargo fmt && git diff-index --quiet HEAD -- || (echo please make format and run tests before creating a pr!; exit 1)
...
@@ -26,3 +26,4 @@ env:
...
@@ -26,3 +26,4 @@ env:
global
:
global
:
-
RUST_TEST_THREADS=1
-
RUST_TEST_THREADS=1
-
LD_LIBRARY_PATH
:
"
/usr/local/lib"
-
LD_LIBRARY_PATH
:
"
/usr/local/lib"
-
RUSTFMT_VERSION=v0.6.0
circle.yml
View file @
84881bab
...
@@ -41,7 +41,7 @@ dependencies:
...
@@ -41,7 +41,7 @@ dependencies:
else
else
rustup default "nightly-${RUSTC_DATE}";
rustup default "nightly-${RUSTC_DATE}";
fi
fi
-
cargo install --force --vers 0.6.1 rustfmt ||
true
-
make -f travis-build/Makefile prepare-rustfmt
-
|
-
|
if [[ ! -e $HOME/.local/lib/librocksdb.so ]]; then
if [[ ! -e $HOME/.local/lib/librocksdb.so ]]; then
export CPLUS_INCLUDE_PATH="${LOCAL_PREFIX}/include" && \
export CPLUS_INCLUDE_PATH="${LOCAL_PREFIX}/include" && \
...
...
tests/test_compaction_filter.rs
View file @
84881bab
...
@@ -47,9 +47,9 @@ fn test_compaction_filter() {
...
@@ -47,9 +47,9 @@ fn test_compaction_filter() {
opts
.set_compaction_filter
(
"test"
,
opts
.set_compaction_filter
(
"test"
,
false
,
false
,
Box
::
new
(
Filter
{
Box
::
new
(
Filter
{
drop_called
:
drop_called
.clone
(),
drop_called
:
drop_called
.clone
(),
filtered_kvs
:
filtered_kvs
.clone
(),
filtered_kvs
:
filtered_kvs
.clone
(),
}))
}))
.unwrap
();
.unwrap
();
opts
.create_if_missing
(
true
);
opts
.create_if_missing
(
true
);
let
db
=
DB
::
open
(
opts
,
path
.path
()
.to_str
()
.unwrap
())
.unwrap
();
let
db
=
DB
::
open
(
opts
,
path
.path
()
.to_str
()
.unwrap
())
.unwrap
();
...
@@ -77,9 +77,9 @@ fn test_compaction_filter() {
...
@@ -77,9 +77,9 @@ fn test_compaction_filter() {
opts
.set_compaction_filter
(
"test"
,
opts
.set_compaction_filter
(
"test"
,
true
,
true
,
Box
::
new
(
Filter
{
Box
::
new
(
Filter
{
drop_called
:
drop_called
.clone
(),
drop_called
:
drop_called
.clone
(),
filtered_kvs
:
filtered_kvs
.clone
(),
filtered_kvs
:
filtered_kvs
.clone
(),
}))
}))
.unwrap
();
.unwrap
();
assert
!
(
drop_called
.load
(
Ordering
::
Relaxed
));
assert
!
(
drop_called
.load
(
Ordering
::
Relaxed
));
drop_called
.store
(
false
,
Ordering
::
Relaxed
);
drop_called
.store
(
false
,
Ordering
::
Relaxed
);
...
...
tests/test_iterator.rs
View file @
84881bab
...
@@ -56,9 +56,8 @@ pub fn test_iterator() {
...
@@ -56,9 +56,8 @@ pub fn test_iterator() {
assert
!
(
p
.is_ok
());
assert
!
(
p
.is_ok
());
let
p
=
db
.put
(
k3
,
v3
);
let
p
=
db
.put
(
k3
,
v3
);
assert
!
(
p
.is_ok
());
assert
!
(
p
.is_ok
());
let
expected
=
vec!
[(
k1
.to_vec
(),
v1
.to_vec
()),
let
expected
=
(
k2
.to_vec
(),
v2
.to_vec
()),
vec!
[(
k1
.to_vec
(),
v1
.to_vec
()),
(
k2
.to_vec
(),
v2
.to_vec
()),
(
k3
.to_vec
(),
v3
.to_vec
())];
(
k3
.to_vec
(),
v3
.to_vec
())];
let
mut
iter
=
db
.iter
();
let
mut
iter
=
db
.iter
();
...
@@ -102,9 +101,8 @@ pub fn test_iterator() {
...
@@ -102,9 +101,8 @@ pub fn test_iterator() {
assert_eq!
(
iter
.collect
::
<
Vec
<
_
>>
(),
expected2
);
assert_eq!
(
iter
.collect
::
<
Vec
<
_
>>
(),
expected2
);
iter
.seek
(
SeekKey
::
Key
(
k2
));
iter
.seek
(
SeekKey
::
Key
(
k2
));
let
expected
=
vec!
[(
k2
.to_vec
(),
v2
.to_vec
()),
let
expected
=
(
k3
.to_vec
(),
v3
.to_vec
()),
vec!
[(
k2
.to_vec
(),
v2
.to_vec
()),
(
k3
.to_vec
(),
v3
.to_vec
()),
(
k4
.to_vec
(),
v4
.to_vec
())];
(
k4
.to_vec
(),
v4
.to_vec
())];
assert_eq!
(
iter
.collect
::
<
Vec
<
_
>>
(),
expected
);
assert_eq!
(
iter
.collect
::
<
Vec
<
_
>>
(),
expected
);
iter
.seek
(
SeekKey
::
Key
(
k2
));
iter
.seek
(
SeekKey
::
Key
(
k2
));
...
...
tests/test_multithreaded.rs
View file @
84881bab
...
@@ -29,27 +29,27 @@ pub fn test_multithreaded() {
...
@@ -29,27 +29,27 @@ pub fn test_multithreaded() {
let
db1
=
db
.clone
();
let
db1
=
db
.clone
();
let
j1
=
thread
::
spawn
(
move
||
for
_
in
1
..
N
{
let
j1
=
thread
::
spawn
(
move
||
for
_
in
1
..
N
{
db1
.put
(
b
"key"
,
b
"value1"
)
.unwrap
();
db1
.put
(
b
"key"
,
b
"value1"
)
.unwrap
();
});
});
let
db2
=
db
.clone
();
let
db2
=
db
.clone
();
let
j2
=
thread
::
spawn
(
move
||
for
_
in
1
..
N
{
let
j2
=
thread
::
spawn
(
move
||
for
_
in
1
..
N
{
db2
.put
(
b
"key"
,
b
"value2"
)
.unwrap
();
db2
.put
(
b
"key"
,
b
"value2"
)
.unwrap
();
});
});
let
db3
=
db
.clone
();
let
db3
=
db
.clone
();
let
j3
=
thread
::
spawn
(
move
||
for
_
in
1
..
N
{
let
j3
=
thread
::
spawn
(
move
||
for
_
in
1
..
N
{
match
db3
.get
(
b
"key"
)
{
match
db3
.get
(
b
"key"
)
{
Ok
(
Some
(
v
))
=>
{
Ok
(
Some
(
v
))
=>
{
if
&
v
[
..
]
!=
b
"value1"
&&
&
v
[
..
]
!=
b
"value2"
{
if
&
v
[
..
]
!=
b
"value1"
&&
&
v
[
..
]
!=
b
"value2"
{
assert
!
(
false
);
assert
!
(
false
);
}
}
}
}
_
=>
{
_
=>
{
assert
!
(
false
);
assert
!
(
false
);
}
}
}
}
});
});
j1
.join
()
.unwrap
();
j1
.join
()
.unwrap
();
j2
.join
()
.unwrap
();
j2
.join
()
.unwrap
();
...
...
tests/test_rocksdb_options.rs
View file @
84881bab
...
@@ -66,7 +66,7 @@ fn test_enable_statistics() {
...
@@ -66,7 +66,7 @@ fn test_enable_statistics() {
opts
.set_stats_dump_period_sec
(
60
);
opts
.set_stats_dump_period_sec
(
60
);
assert
!
(
opts
.get_statistics
()
.is_some
());
assert
!
(
opts
.get_statistics
()
.is_some
());
assert
!
(
opts
.get_statistics_histogram_string
(
HistogramType
::
DbSeekMicros
)
assert
!
(
opts
.get_statistics_histogram_string
(
HistogramType
::
DbSeekMicros
)
.is_some
());
.is_some
());
assert_eq!
(
opts
.get_statistics_ticker_count
(
TickerType
::
BlockCacheMiss
),
assert_eq!
(
opts
.get_statistics_ticker_count
(
TickerType
::
BlockCacheMiss
),
0
);
0
);
assert_eq!
(
opts
.get_and_reset_statistics_ticker_count
(
TickerType
::
BlockCacheMiss
),
assert_eq!
(
opts
.get_and_reset_statistics_ticker_count
(
TickerType
::
BlockCacheMiss
),
...
@@ -99,8 +99,8 @@ fn test_memtable_insert_hint_prefix_extractor() {
...
@@ -99,8 +99,8 @@ fn test_memtable_insert_hint_prefix_extractor() {
opts
.create_if_missing
(
true
);
opts
.create_if_missing
(
true
);
opts
.set_memtable_insert_hint_prefix_extractor
(
"FixedPrefixTransform"
,
opts
.set_memtable_insert_hint_prefix_extractor
(
"FixedPrefixTransform"
,
Box
::
new
(
FixedPrefixTransform
{
Box
::
new
(
FixedPrefixTransform
{
prefix_len
:
2
,
prefix_len
:
2
,
}))
}))
.unwrap
();
.unwrap
();
let
db
=
DB
::
open
(
opts
,
path
.path
()
.to_str
()
.unwrap
())
.unwrap
();
let
db
=
DB
::
open
(
opts
,
path
.path
()
.to_str
()
.unwrap
())
.unwrap
();
let
wopts
=
WriteOptions
::
new
();
let
wopts
=
WriteOptions
::
new
();
...
...
tests/test_slice_transform.rs
View file @
84881bab
...
@@ -58,10 +58,8 @@ fn test_slice_transform() {
...
@@ -58,10 +58,8 @@ fn test_slice_transform() {
let
mut
it
=
db
.iter
();
let
mut
it
=
db
.iter
();
let
invalid_seeks
=
vec!
[
b
"key_"
.to_vec
(),
let
invalid_seeks
=
b
"key_0"
.to_vec
(),
vec!
[
b
"key_"
.to_vec
(),
b
"key_0"
.to_vec
(),
b
"key_030"
.to_vec
(),
b
"key_03000"
.to_vec
()];
b
"key_030"
.to_vec
(),
b
"key_03000"
.to_vec
()];
for
key
in
invalid_seeks
{
for
key
in
invalid_seeks
{
it
.seek
(
SeekKey
::
Key
(
&
key
));
it
.seek
(
SeekKey
::
Key
(
&
key
));
...
...
tests/test_statistics.rs
View file @
84881bab
...
@@ -36,7 +36,7 @@ fn test_db_statistics() {
...
@@ -36,7 +36,7 @@ fn test_db_statistics() {
assert
!
(
db
.get_and_reset_statistics_ticker_count
(
TickerType
::
BlockCacheHit
)
>
0
);
assert
!
(
db
.get_and_reset_statistics_ticker_count
(
TickerType
::
BlockCacheHit
)
>
0
);
assert_eq!
(
db
.get_statistics_ticker_count
(
TickerType
::
BlockCacheHit
),
0
);
assert_eq!
(
db
.get_statistics_ticker_count
(
TickerType
::
BlockCacheHit
),
0
);
assert
!
(
db
.get_statistics_histogram_string
(
HistogramType
::
DbGetMicros
)
assert
!
(
db
.get_statistics_histogram_string
(
HistogramType
::
DbGetMicros
)
.is_some
());
.is_some
());
assert
!
(
db
.get_statistics_histogram
(
HistogramType
::
DbGetMicros
)
assert
!
(
db
.get_statistics_histogram
(
HistogramType
::
DbGetMicros
)
.is_some
());
.is_some
());
}
}
travis-build/Makefile
0 → 100644
View file @
84881bab
prepare-rustfmt
:
curl
-L
https://github.com/tennix/rustfmt/releases/download/v0.6/rustfmt-
${
RUSTFMT_VERSION
}
-linux-amd64
.tar.gz
-o
rustfmt-
${
RUSTFMT_VERSION
}
-linux-amd64
.tar.gz
&&
\
mkdir
-p
${
HOME
}
/.cargo/bin
&&
tar
xzf rustfmt-
${
RUSTFMT_VERSION
}
-linux-amd64
.tar.gz
-C
${
HOME
}
/.cargo/bin
--strip-components
=
1
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment