| 40 | file_system_{std::move(file_system)} {} |
| 41 | |
| 42 | std::shared_ptr<FileSystemKeyMaterialStore> FileSystemKeyMaterialStore::Make( |
| 43 | std::string parquet_file_path, std::shared_ptr<::arrow::fs::FileSystem> file_system, |
| 44 | bool use_tmp_prefix) { |
| 45 | if (parquet_file_path.empty()) { |
| 46 | throw ParquetException( |
| 47 | "The Parquet file path must be specified when using external key material"); |
| 48 | } |
| 49 | if (file_system == nullptr) { |
| 50 | throw ParquetException( |
| 51 | "A file system must be specified when using external key material"); |
| 52 | } |
| 53 | |
| 54 | ::arrow::fs::FileInfo file_info(std::move(parquet_file_path)); |
| 55 | std::stringstream key_material_file_name; |
| 56 | if (use_tmp_prefix) { |
| 57 | key_material_file_name << FileSystemKeyMaterialStore::kTempFilePrefix; |
| 58 | } |
| 59 | key_material_file_name << FileSystemKeyMaterialStore::kKeyMaterialFilePrefix |
| 60 | << file_info.base_name() |
| 61 | << FileSystemKeyMaterialStore::kKeyMaterialFileSuffix; |
| 62 | |
| 63 | std::string key_material_file_path = ::arrow::fs::internal::ConcatAbstractPath( |
| 64 | file_info.dir_name(), key_material_file_name.str()); |
| 65 | return std::make_shared<FileSystemKeyMaterialStore>(std::move(key_material_file_path), |
| 66 | std::move(file_system)); |
| 67 | } |
| 68 | |
| 69 | void FileSystemKeyMaterialStore::LoadKeyMaterialMap() { |
| 70 | std::shared_ptr<::arrow::io::RandomAccessFile> input; |
nothing calls this directly
no test coverage detected