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

Method Unregister

cpp/src/arrow/filesystem/filesystem.cc:722–743  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

720 }
721
722 Status Unregister(const std::string& scheme) {
723 std::shared_lock lock{mutex_};
724 RETURN_NOT_OK(CheckValid());
725
726 auto it = scheme_to_factory_.find(scheme);
727 if (it == scheme_to_factory_.end()) {
728 return Status::KeyError("No factories found for scheme ", scheme,
729 ", can't unregister");
730 }
731
732 std::function<void()> finalizer;
733 if (it->second.ok()) {
734 finalizer = it->second.ValueOrDie().finalizer;
735 }
736 scheme_to_factory_.erase(it);
737 lock.unlock();
738
739 if (finalizer) {
740 finalizer();
741 }
742 return Status::OK();
743 }
744
745 Result<const FileSystemFactory*> FactoryForScheme(const std::string& scheme) {
746 std::shared_lock lock{mutex_};

Callers 1

Calls 6

KeyErrorFunction · 0.85
ValueOrDieMethod · 0.80
OKFunction · 0.50
findMethod · 0.45
endMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected