|
|
|
@ -65,6 +65,7 @@ using rocksdb::Range; |
|
|
|
|
using rocksdb::ReadOptions; |
|
|
|
|
using rocksdb::SequentialFile; |
|
|
|
|
using rocksdb::Slice; |
|
|
|
|
using rocksdb::SliceParts; |
|
|
|
|
using rocksdb::SliceTransform; |
|
|
|
|
using rocksdb::Snapshot; |
|
|
|
|
using rocksdb::Status; |
|
|
|
@ -1077,6 +1078,43 @@ void rocksdb_writebatch_put_cf( |
|
|
|
|
b->rep.Put(column_family->rep, Slice(key, klen), Slice(val, vlen)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void rocksdb_writebatch_putv( |
|
|
|
|
rocksdb_writebatch_t* b, |
|
|
|
|
size_t num_keys, const char* const* keys_list, |
|
|
|
|
const size_t* keys_list_sizes, |
|
|
|
|
size_t num_values, const char* const* values_list, |
|
|
|
|
const size_t* values_list_sizes) { |
|
|
|
|
Slice key_slices[num_keys]; |
|
|
|
|
for (size_t i = 0; i < num_keys; i++) { |
|
|
|
|
key_slices[i] = Slice(keys_list[i], keys_list_sizes[i]); |
|
|
|
|
} |
|
|
|
|
Slice value_slices[num_values]; |
|
|
|
|
for (size_t i = 0; i < num_values; i++) { |
|
|
|
|
value_slices[i] = Slice(values_list[i], values_list_sizes[i]); |
|
|
|
|
} |
|
|
|
|
b->rep.Put(SliceParts(key_slices, num_keys), |
|
|
|
|
SliceParts(value_slices, num_values)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void rocksdb_writebatch_putv_cf( |
|
|
|
|
rocksdb_writebatch_t* b, |
|
|
|
|
rocksdb_column_family_handle_t* column_family, |
|
|
|
|
size_t num_keys, const char* const* keys_list, |
|
|
|
|
const size_t* keys_list_sizes, |
|
|
|
|
size_t num_values, const char* const* values_list, |
|
|
|
|
const size_t* values_list_sizes) { |
|
|
|
|
Slice key_slices[num_keys]; |
|
|
|
|
for (size_t i = 0; i < num_keys; i++) { |
|
|
|
|
key_slices[i] = Slice(keys_list[i], keys_list_sizes[i]); |
|
|
|
|
} |
|
|
|
|
Slice value_slices[num_values]; |
|
|
|
|
for (size_t i = 0; i < num_values; i++) { |
|
|
|
|
value_slices[i] = Slice(values_list[i], values_list_sizes[i]); |
|
|
|
|
} |
|
|
|
|
b->rep.Put(column_family->rep, SliceParts(key_slices, num_keys), |
|
|
|
|
SliceParts(value_slices, num_values)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void rocksdb_writebatch_merge( |
|
|
|
|
rocksdb_writebatch_t* b, |
|
|
|
|
const char* key, size_t klen, |
|
|
|
@ -1092,6 +1130,43 @@ void rocksdb_writebatch_merge_cf( |
|
|
|
|
b->rep.Merge(column_family->rep, Slice(key, klen), Slice(val, vlen)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void rocksdb_writebatch_mergev( |
|
|
|
|
rocksdb_writebatch_t* b, |
|
|
|
|
size_t num_keys, const char* const* keys_list, |
|
|
|
|
const size_t* keys_list_sizes, |
|
|
|
|
size_t num_values, const char* const* values_list, |
|
|
|
|
const size_t* values_list_sizes) { |
|
|
|
|
Slice key_slices[num_keys]; |
|
|
|
|
for (size_t i = 0; i < num_keys; i++) { |
|
|
|
|
key_slices[i] = Slice(keys_list[i], keys_list_sizes[i]); |
|
|
|
|
} |
|
|
|
|
Slice value_slices[num_values]; |
|
|
|
|
for (size_t i = 0; i < num_values; i++) { |
|
|
|
|
value_slices[i] = Slice(values_list[i], values_list_sizes[i]); |
|
|
|
|
} |
|
|
|
|
b->rep.Merge(SliceParts(key_slices, num_keys), |
|
|
|
|
SliceParts(value_slices, num_values)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void rocksdb_writebatch_mergev_cf( |
|
|
|
|
rocksdb_writebatch_t* b, |
|
|
|
|
rocksdb_column_family_handle_t* column_family, |
|
|
|
|
size_t num_keys, const char* const* keys_list, |
|
|
|
|
const size_t* keys_list_sizes, |
|
|
|
|
size_t num_values, const char* const* values_list, |
|
|
|
|
const size_t* values_list_sizes) { |
|
|
|
|
Slice key_slices[num_keys]; |
|
|
|
|
for (size_t i = 0; i < num_keys; i++) { |
|
|
|
|
key_slices[i] = Slice(keys_list[i], keys_list_sizes[i]); |
|
|
|
|
} |
|
|
|
|
Slice value_slices[num_values]; |
|
|
|
|
for (size_t i = 0; i < num_values; i++) { |
|
|
|
|
value_slices[i] = Slice(values_list[i], values_list_sizes[i]); |
|
|
|
|
} |
|
|
|
|
b->rep.Merge(column_family->rep, SliceParts(key_slices, num_keys), |
|
|
|
|
SliceParts(value_slices, num_values)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void rocksdb_writebatch_delete( |
|
|
|
|
rocksdb_writebatch_t* b, |
|
|
|
|
const char* key, size_t klen) { |
|
|
|
@ -1105,6 +1180,29 @@ void rocksdb_writebatch_delete_cf( |
|
|
|
|
b->rep.Delete(column_family->rep, Slice(key, klen)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void rocksdb_writebatch_deletev( |
|
|
|
|
rocksdb_writebatch_t* b, |
|
|
|
|
size_t num_keys, const char* const* keys_list, |
|
|
|
|
const size_t* keys_list_sizes) { |
|
|
|
|
Slice key_slices[num_keys]; |
|
|
|
|
for (size_t i = 0; i < num_keys; i++) { |
|
|
|
|
key_slices[i] = Slice(keys_list[i], keys_list_sizes[i]); |
|
|
|
|
} |
|
|
|
|
b->rep.Delete(SliceParts(key_slices, num_keys)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void rocksdb_writebatch_deletev_cf( |
|
|
|
|
rocksdb_writebatch_t* b, |
|
|
|
|
rocksdb_column_family_handle_t* column_family, |
|
|
|
|
size_t num_keys, const char* const* keys_list, |
|
|
|
|
const size_t* keys_list_sizes) { |
|
|
|
|
Slice key_slices[num_keys]; |
|
|
|
|
for (size_t i = 0; i < num_keys; i++) { |
|
|
|
|
key_slices[i] = Slice(keys_list[i], keys_list_sizes[i]); |
|
|
|
|
} |
|
|
|
|
b->rep.Delete(column_family->rep, SliceParts(key_slices, num_keys)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void rocksdb_writebatch_iterate( |
|
|
|
|
rocksdb_writebatch_t* b, |
|
|
|
|
void* state, |
|
|
|
|