diff --git a/proxy_components/proxy_ffi/src/encryption_impls.rs b/proxy_components/proxy_ffi/src/encryption_impls.rs index 3b82de30487..6350cecfb6d 100644 --- a/proxy_components/proxy_ffi/src/encryption_impls.rs +++ b/proxy_components/proxy_ffi/src/encryption_impls.rs @@ -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"") + } } diff --git a/proxy_components/proxy_ffi/src/raftstore_proxy_helper_impls.rs b/proxy_components/proxy_ffi/src/raftstore_proxy_helper_impls.rs index e7f66135017..32b533dccd4 100644 --- a/proxy_components/proxy_ffi/src/raftstore_proxy_helper_impls.rs +++ b/proxy_components/proxy_ffi/src/raftstore_proxy_helper_impls.rs @@ -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),