Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add level region accessor interface #616

Open
wants to merge 54 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
ab347d2
Level Region Accessor interface that allows to compact by region size…
CheneyDing Mar 10, 2021
ea4d34f
convert from rust to c
CheneyDing Mar 12, 2021
eacac65
fix compile bug
CheneyDing Mar 12, 2021
e05182a
update submodule rocksdb
CheneyDing Mar 13, 2021
b02b072
resolve conflict
CheneyDing Mar 13, 2021
45199d2
fix bug
CheneyDing Mar 13, 2021
67ff078
fix compile bug
CheneyDing Mar 15, 2021
4c647a1
fix compile bug
CheneyDing Mar 17, 2021
32fcbec
resovle conflict
CheneyDing Mar 17, 2021
b3054e4
redefine struct
CheneyDing Mar 17, 2021
f32e7d8
fix compile bug
CheneyDing Mar 17, 2021
61d8b52
fix compile bug
CheneyDing Mar 17, 2021
19ae8f9
fix compile bug
CheneyDing Mar 17, 2021
bb8ade9
fix compile bug
CheneyDing Mar 17, 2021
b389ffc
fix compile bug
CheneyDing Mar 17, 2021
b57e01f
fix compile bug
CheneyDing Mar 17, 2021
51a37a6
new compaction pri
CheneyDing Mar 18, 2021
b6ae5b0
update submodule rocksdb
CheneyDing Mar 18, 2021
43c3145
generate bindings
CheneyDing Mar 19, 2021
4a30f4b
add unit test
CheneyDing Mar 19, 2021
aa1839e
add unit test
CheneyDing Mar 19, 2021
1947375
fix compile bug
CheneyDing Mar 19, 2021
d72f316
fix compile bug
CheneyDing Mar 20, 2021
9674845
fix compile bug
CheneyDing Mar 20, 2021
fa4a95a
fix compile bug
CheneyDing Mar 20, 2021
8f32671
modify unit test
CheneyDing Mar 20, 2021
b84ac32
modify unit test
CheneyDing Mar 20, 2021
4e31ccd
update submodule rocksdb
CheneyDing Mar 20, 2021
a6a6421
update submodule
CheneyDing Mar 20, 2021
0fdc95f
update submodule rocksdb
CheneyDing Mar 20, 2021
87d0cdc
update submodule rocksdb
CheneyDing Mar 22, 2021
a8f5e59
update submodule rocksdb
CheneyDing Mar 22, 2021
abdf497
update submodule rocksdb
CheneyDing Mar 22, 2021
8210d31
update submodule rocksdb
CheneyDing Mar 22, 2021
e4a3357
update submodule rocksdb
CheneyDing Mar 22, 2021
833b29e
update submodule rocksdb
CheneyDing Mar 23, 2021
42ecf43
update submodule rocksdb
CheneyDing Mar 24, 2021
32d5566
update submodule rocksdb
CheneyDing Mar 24, 2021
5a823ea
update submodule rocksdb
CheneyDing Mar 24, 2021
962ff76
update submodule rocksdb
CheneyDing Mar 24, 2021
5e0d9a5
update submodule rocksdb
CheneyDing Mar 24, 2021
bde1828
update rust-rocksdb
CheneyDing Mar 25, 2021
cb067d8
update submodule rocksdb
CheneyDing Mar 25, 2021
b688a17
update submodule rocksdb
CheneyDing Mar 25, 2021
474ce1c
debug
CheneyDing Mar 25, 2021
9802741
update submodule rocksdb
CheneyDing Mar 26, 2021
ae51d63
update submodule rocksdb
CheneyDing Mar 27, 2021
c552850
update submodule rocksdb
CheneyDing Mar 29, 2021
8f2e300
update submodule rocksdb
CheneyDing Mar 29, 2021
32a81a7
update submodule rocksdb
CheneyDing Mar 29, 2021
c58f0bc
update submodule rocksdb
CheneyDing Mar 29, 2021
635b463
update submodule rocksdb
CheneyDing Mar 29, 2021
1c1c557
update submodule rocksdb
CheneyDing Mar 29, 2021
cb1734e
update submodule rocksdb
CheneyDing Apr 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[submodule "rocksdb"]
path = librocksdb_sys/rocksdb
url = https://github.com/tikv/rocksdb.git
branch = 6.4.tikv
url = https://github.com/CheneyDing/rocksdb.git
branch = size-ratio-compaction

[submodule "titan"]
path = librocksdb_sys/libtitan_sys/titan
Expand Down
238 changes: 117 additions & 121 deletions librocksdb_sys/bindings/x86_64-unknown-linux-gnu-bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
pub const __GNUC_VA_LIST: u32 = 1;
pub const _STDINT_H: u32 = 1;
pub const _FEATURES_H: u32 = 1;
pub const __USE_ANSI: u32 = 1;
pub const _BSD_SOURCE: u32 = 1;
pub const _SVID_SOURCE: u32 = 1;
pub const __USE_ISOC11: u32 = 1;
pub const __USE_ISOC99: u32 = 1;
pub const __USE_ISOC95: u32 = 1;
pub const _POSIX_SOURCE: u32 = 1;
Expand All @@ -30,12 +30,15 @@ pub const __STDC_ISO_10646__: u32 = 201103;
pub const __STDC_NO_THREADS__: u32 = 1;
pub const __GNU_LIBRARY__: u32 = 6;
pub const __GLIBC__: u32 = 2;
pub const __GLIBC_MINOR__: u32 = 18;
pub const __GLIBC_MINOR__: u32 = 17;
pub const __GLIBC_HAVE_LONG_LONG: u32 = 1;
pub const _SYS_CDEFS_H: u32 = 1;
pub const __WORDSIZE: u32 = 64;
pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1;
pub const __SYSCALL_WORDSIZE: u32 = 64;
pub const _BITS_WCHAR_H: u32 = 1;
pub const __WCHAR_MIN: i32 = -2147483648;
pub const __WCHAR_MAX: u32 = 2147483647;
pub const INT8_MIN: i32 = -128;
pub const INT16_MIN: i32 = -32768;
pub const INT32_MIN: i32 = -2147483648;
Expand Down Expand Up @@ -71,56 +74,13 @@ pub const PTRDIFF_MAX: u64 = 9223372036854775807;
pub const SIG_ATOMIC_MIN: i32 = -2147483648;
pub const SIG_ATOMIC_MAX: u32 = 2147483647;
pub const SIZE_MAX: i32 = -1;
pub const WCHAR_MIN: i32 = -2147483648;
pub const WCHAR_MAX: u32 = 2147483647;
pub const WINT_MIN: u32 = 0;
pub const WINT_MAX: u32 = 4294967295;
pub type va_list = __builtin_va_list;
pub type __gnuc_va_list = __builtin_va_list;
pub type wchar_t = libc::c_int;
#[repr(C)]
#[repr(align(16))]
#[derive(Debug, Copy, Clone)]
pub struct max_align_t {
pub __clang_max_align_nonce1: libc::c_longlong,
pub __bindgen_padding_0: u64,
pub __clang_max_align_nonce2: u128,
}
#[test]
fn bindgen_test_layout_max_align_t() {
assert_eq!(
::std::mem::size_of::<max_align_t>(),
32usize,
concat!("Size of: ", stringify!(max_align_t))
);
assert_eq!(
::std::mem::align_of::<max_align_t>(),
16usize,
concat!("Alignment of ", stringify!(max_align_t))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<max_align_t>())).__clang_max_align_nonce1 as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(max_align_t),
"::",
stringify!(__clang_max_align_nonce1)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<max_align_t>())).__clang_max_align_nonce2 as *const _ as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(max_align_t),
"::",
stringify!(__clang_max_align_nonce2)
)
);
}
pub type int_least8_t = libc::c_schar;
pub type int_least16_t = libc::c_short;
pub type int_least32_t = libc::c_int;
Expand Down Expand Up @@ -507,6 +467,21 @@ pub struct crocksdb_sst_partitioner_context_t {
pub struct crocksdb_sst_partitioner_factory_t {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct crocksdb_level_region_accessor_t {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct crocksdb_level_region_accessor_request_t {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct crocksdb_level_region_accessor_result_t {
_unused: [u8; 0],
}
pub const crocksdb_table_property_t_kDataSize: crocksdb_table_property_t = 1;
pub const crocksdb_table_property_t_kIndexSize: crocksdb_table_property_t = 2;
pub const crocksdb_table_property_t_kFilterSize: crocksdb_table_property_t = 3;
Expand Down Expand Up @@ -2224,6 +2199,17 @@ extern "C" {
arg2: *mut crocksdb_sst_partitioner_factory_t,
);
}
extern "C" {
pub fn crocksdb_options_get_level_region_accessor(
arg1: *mut crocksdb_options_t,
) -> *mut crocksdb_level_region_accessor_t;
}
extern "C" {
pub fn crocksdb_options_set_level_region_accessor(
arg1: *mut crocksdb_options_t,
arg2: *mut crocksdb_level_region_accessor_t,
);
}
extern "C" {
pub fn crocksdb_options_enable_statistics(arg1: *mut crocksdb_options_t, arg2: libc::c_uchar);
}
Expand Down Expand Up @@ -4621,6 +4607,90 @@ extern "C" {
context: *mut crocksdb_sst_partitioner_context_t,
) -> *mut crocksdb_sst_partitioner_t;
}
extern "C" {
pub fn crocksdb_level_region_accessor_request_create(
) -> *mut crocksdb_level_region_accessor_request_t;
}
extern "C" {
pub fn crocksdb_level_region_accessor_request_destroy(
req: *mut crocksdb_level_region_accessor_request_t,
);
}
extern "C" {
pub fn crocksdb_level_region_accessor_request_smallest_user_key(
req: *mut crocksdb_level_region_accessor_request_t,
len: *mut usize,
) -> *const libc::c_char;
}
extern "C" {
pub fn crocksdb_level_region_accessor_request_largest_user_key(
req: *mut crocksdb_level_region_accessor_request_t,
len: *mut usize,
) -> *const libc::c_char;
}
extern "C" {
pub fn crocksdb_level_region_accessor_req_set_smallest_user_key(
req: *mut crocksdb_level_region_accessor_request_t,
key: *const libc::c_char,
len: usize,
);
}
extern "C" {
pub fn crocksdb_level_region_accessor_req_set_largest_user_key(
req: *mut crocksdb_level_region_accessor_request_t,
key: *const libc::c_char,
len: usize,
);
}
pub type crocksdb_level_region_accessor_name_cb = ::std::option::Option<
unsafe extern "C" fn(underlying: *mut libc::c_void) -> *const libc::c_char,
>;
pub type crocksdb_level_region_accessor_level_regions_cb = ::std::option::Option<
unsafe extern "C" fn(
underlying: *mut libc::c_void,
requests: *mut crocksdb_level_region_accessor_request_t,
) -> *mut crocksdb_level_region_accessor_result_t,
>;
extern "C" {
pub fn crocksdb_level_region_accessor_create(
underlying: *mut libc::c_void,
destructor: ::std::option::Option<unsafe extern "C" fn(arg1: *mut libc::c_void)>,
name_cb: crocksdb_level_region_accessor_name_cb,
level_regions_cb: crocksdb_level_region_accessor_level_regions_cb,
) -> *mut crocksdb_level_region_accessor_t;
}
extern "C" {
pub fn crocksdb_level_region_accessor_destroy(accessor: *mut crocksdb_level_region_accessor_t);
}
extern "C" {
pub fn crocksdb_level_region_accessor_name(
accessor: *mut crocksdb_level_region_accessor_t,
) -> *const libc::c_char;
}
extern "C" {
pub fn crocksdb_level_region_accessor_result_create(
) -> *mut crocksdb_level_region_accessor_result_t;
}
extern "C" {
pub fn crocksdb_level_region_accessor_result_destory(
result: *mut crocksdb_level_region_accessor_result_t,
);
}
extern "C" {
pub fn crocksdb_level_region_accessor_result_equal(
result1: *mut crocksdb_level_region_accessor_result_t,
result2: *mut crocksdb_level_region_accessor_result_t,
) -> libc::c_uchar;
}
extern "C" {
pub fn crocksdb_level_region_accessor_result_append(
dest: *mut crocksdb_level_region_accessor_result_t,
s: *const libc::c_char,
slen: usize,
e: *const libc::c_char,
elen: usize,
);
}
extern "C" {
pub fn crocksdb_run_ldb_tool(
argc: libc::c_int,
Expand Down Expand Up @@ -4654,40 +4724,6 @@ fn bindgen_test_layout_ctitandb_blob_index_t() {
8usize,
concat!("Alignment of ", stringify!(ctitandb_blob_index_t))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<ctitandb_blob_index_t>())).file_number as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(ctitandb_blob_index_t),
"::",
stringify!(file_number)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<ctitandb_blob_index_t>())).blob_offset as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(ctitandb_blob_index_t),
"::",
stringify!(blob_offset)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ctitandb_blob_index_t>())).blob_size as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(ctitandb_blob_index_t),
"::",
stringify!(blob_size)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
Expand Down Expand Up @@ -5000,44 +5036,4 @@ fn bindgen_test_layout___va_list_tag() {
8usize,
concat!("Alignment of ", stringify!(__va_list_tag))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<__va_list_tag>())).gp_offset as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(__va_list_tag),
"::",
stringify!(gp_offset)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<__va_list_tag>())).fp_offset as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(__va_list_tag),
"::",
stringify!(fp_offset)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<__va_list_tag>())).overflow_arg_area as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(__va_list_tag),
"::",
stringify!(overflow_arg_area)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<__va_list_tag>())).reg_save_area as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(__va_list_tag),
"::",
stringify!(reg_save_area)
)
);
}
Loading