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
f748faa5
Commit
f748faa5
authored
Dec 19, 2016
by
siddontang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename len to data_size
parent
95300161
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
11 deletions
+13
-11
rocksdb.rs
src/rocksdb.rs
+7
-7
test_compact_range.rs
test/test_compact_range.rs
+2
-1
test_compaction_filter.rs
test/test_compaction_filter.rs
+2
-1
test_rocksdb_options.rs
test/test_rocksdb_options.rs
+2
-2
No files found.
src/rocksdb.rs
View file @
f748faa5
...
...
@@ -892,11 +892,11 @@ impl WriteBatch {
self
.count
()
==
0
}
pub
fn
len
(
&
self
)
->
usize
{
pub
fn
data_size
(
&
self
)
->
usize
{
unsafe
{
let
mut
length
:
usize
=
0
;
let
_
=
rocksdb_ffi
::
rocksdb_writebatch_data
(
self
.inner
,
&
mut
length
);
return
length
;
let
mut
data_size
:
usize
=
0
;
let
_
=
rocksdb_ffi
::
rocksdb_writebatch_data
(
self
.inner
,
&
mut
data_size
);
return
data_size
;
}
}
...
...
@@ -1118,11 +1118,11 @@ mod test {
assert
!
(
db
.get
(
b
"k1"
)
.unwrap
()
.is_none
());
let
batch
=
WriteBatch
::
new
();
let
prev_
len
=
batch
.len
();
let
prev_
size
=
batch
.data_size
();
let
_
=
batch
.delete
(
b
"k1"
);
assert
!
(
batch
.
len
()
>
0
);
assert
!
(
batch
.
data_size
()
>
prev_size
);
batch
.clear
();
assert_eq!
(
batch
.
len
(),
prev_len
);
assert_eq!
(
batch
.
data_size
(),
prev_size
);
}
#[test]
...
...
test/test_compact_range.rs
View file @
f748faa5
use
rocksdb
::{
DB
,
Options
,
Range
,
Writable
};
use
tempdir
::
TempDir
;
use
rocksdb
::{
DB
,
Options
,
Range
,
Writable
};
use
tempdir
::
TempDir
;
#[test]
...
...
test/test_compaction_filter.rs
View file @
f748faa5
...
...
@@ -2,7 +2,8 @@
use
rocksdb
::{
Writable
,
DB
,
CompactionFilter
,
Options
};
use
std
::
sync
::{
Arc
,
RwLock
};
use
std
::
sync
::
atomic
::{
AtomicBool
,
Ordering
};
use
tempdir
::
TempDir
;
use
std
::
sync
::
atomic
::{
AtomicBool
,
Ordering
};
use
tempdir
::
TempDir
;
struct
Filter
{
drop_called
:
Arc
<
AtomicBool
>
,
...
...
test/test_rocksdb_options.rs
View file @
f748faa5
use
rocksdb
::{
DB
,
Options
};
use
tempdir
::
TempDir
;
use
rocksdb
::{
DB
,
Options
};
use
tempdir
::
TempDir
;
#[test]
...
...
@@ -22,4 +23,3 @@ fn test_log_file_opt() {
let
db
=
DB
::
open
(
opts
,
path
.path
()
.to_str
()
.unwrap
())
.unwrap
();
drop
(
db
);
}
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