MCPcopy Create free account
hub / github.com/apache/arrow / LoadFileSystemFactories

Function LoadFileSystemFactories

cpp/src/arrow/filesystem/filesystem.cc:870–892  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

868} // namespace internal
869
870Status LoadFileSystemFactories(const char* libpath) {
871 using ::arrow::internal::GetSymbolAs;
872 using ::arrow::internal::LoadDynamicLibrary;
873
874 ARROW_ASSIGN_OR_RAISE(void* lib, LoadDynamicLibrary(libpath));
875 auto* get_instance =
876 GetSymbolAs<void*()>(lib, "arrow_filesystem_get_registry").ValueOr(nullptr);
877 if (get_instance == nullptr) {
878 // If a third party library is linked such that registry deduplication is not
879 // necessary (for example if built with `ARROW_BUILD_SHARED`), we do not require that
880 // library to export arrow_filesystem_get_registry() since that symbol is not used
881 // except for deduplication.
882 return Status::OK();
883 }
884
885 auto* lib_registry = static_cast<FileSystemFactoryRegistry*>(get_instance());
886 auto* main_registry = FileSystemFactoryRegistry::GetInstance();
887 if (lib_registry != main_registry) {
888 RETURN_NOT_OK(lib_registry->MergeInto(main_registry));
889 }
890
891 return Status::OK();
892}
893
894namespace {
895

Callers 3

ASSERT_OK_AND_ASSIGNFunction · 0.85
SetUpMethod · 0.85
ExecuteFunction · 0.85

Calls 3

ValueOrMethod · 0.80
MergeIntoMethod · 0.80
OKFunction · 0.50

Tested by 2

ASSERT_OK_AND_ASSIGNFunction · 0.68
SetUpMethod · 0.68