MCPcopy Create free account
hub / github.com/apache/impala / MapToDebugString

Method MapToDebugString

be/src/kudu/util/file_cache.cc:725–751  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

723
724template <class FileType>
725string FileCache::MapToDebugString(const DescriptorMap<FileType>& descs,
726 const string& prefix) {
727 string ret;
728 for (const auto& e : descs) {
729 bool strong = false;
730 bool deleted = false;
731 bool opened = false;
732 shared_ptr<internal::Descriptor<FileType>> d = e.second.lock();
733 if (d) {
734 strong = true;
735 if (d->base_.deleted()) {
736 deleted = true;
737 }
738 internal::ScopedOpenedDescriptor<FileType> sod(d->base_.LookupFromCache());
739 if (sod.opened()) {
740 opened = true;
741 }
742 }
743 if (strong) {
744 ret += Substitute("$0: $1 (S$2$3)\n", prefix, e.first,
745 deleted ? "D" : "", opened ? "O" : "");
746 } else {
747 ret += Substitute("$0: $1\n", prefix, e.first);
748 }
749 }
750 return ret;
751}
752
753template <class FileType>
754shared_ptr<internal::Descriptor<FileType>> FileCache::FindDescriptorUnlocked(

Callers

nothing calls this directly

Calls 5

SubstituteFunction · 0.85
deletedMethod · 0.80
LookupFromCacheMethod · 0.80
lockMethod · 0.45
openedMethod · 0.45

Tested by

no test coverage detected