Skip to content

Commit

Permalink
move into a struct
Browse files Browse the repository at this point in the history
Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
  • Loading branch information
Lloyd-Pottiger committed Jan 12, 2024
1 parent 9772655 commit 7ff31ce
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
26 changes: 15 additions & 11 deletions proxy_components/proxy_ffi/src/encryption_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,21 @@ pub extern "C" fn ffi_handle_link_file(
}
}

//// The following functions will not be called, just for compatibility ////
// The CloudStorageEngineFFI contains dummy implementation of
// CloudStorageEngine-specific FFI, not used, just for tiflash compilation.
pub struct CloudStorageEngineFFI {}

// always return false
pub extern "C" fn ffi_get_keyspace_encryption(
_proxy_ptr: RaftStoreProxyPtr,
_keyspace_id: u32,
) -> bool {
return false;
}
impl CloudStorageEngineFFI {
// always return false
pub extern "C" fn ffi_get_keyspace_encryption(
_proxy_ptr: RaftStoreProxyPtr,
_keyspace_id: u32,
) -> bool {
return false;
}

// always return empty string
pub extern "C" fn ffi_get_master_key(_proxy_ptr: RaftStoreProxyPtr) -> RawCppStringPtr {
get_engine_store_server_helper().gen_cpp_string(b"")
// always return empty string
pub extern "C" fn ffi_get_master_key(_proxy_ptr: RaftStoreProxyPtr) -> RawCppStringPtr {
get_engine_store_server_helper().gen_cpp_string(b"")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ impl RaftStoreProxyFFIHelper {
fn_handle_new_file: Some(ffi_handle_new_file),
fn_handle_delete_file: Some(ffi_handle_delete_file),
fn_handle_link_file: Some(ffi_handle_link_file),
fn_get_keyspace_encryption: Some(ffi_get_keyspace_encryption),
fn_get_master_key: Some(ffi_get_master_key),
fn_get_keyspace_encryption: Some(CloudStorageEngineFFI::ffi_get_keyspace_encryption),
fn_get_master_key: Some(CloudStorageEngineFFI::ffi_get_master_key),
fn_handle_batch_read_index: Some(ffi_batch_read_index),
sst_reader_interfaces: SSTReaderInterfaces {
fn_get_sst_reader: Some(ffi_make_sst_reader),
Expand Down

0 comments on commit 7ff31ce

Please sign in to comment.