Split List() call to external Xrootd plugin into multiple Stat() calls. Xrootd...

Split List() call to external Xrootd plugin into multiple Stat() calls. Xrootd Stat is very slow and causes timeout. Maybe this or similar solution should be moved directly into DataPointDelegate class.
parent b0787e31
......@@ -49,6 +49,24 @@ namespace ArcDMCXrootd {
return true;
}
DataStatus DataPointXrootdDelegate::List(std::list<FileInfo>& files, DataPoint::DataPointInfoType verb) {
// Xrootd is slow when quering with higher verbosity. Here we simulate internal behavior of the
// plugin by performing Stat externally. Proper solution would be to push obtaineed infomation
// about eah file as soon as it is obtained. But so far quick hack shuld be enough.
if (verb <= INFO_TYPE_NAME)
return DataPointDelegate::List(files, verb);
DataStatus result = DataPointDelegate::List(files, INFO_TYPE_NAME);
if (!result) return result;
URL url_orig = url;
for(std::list<FileInfo>::iterator f = files.begin(); f != files.end(); ++f) {
std::string name = f->GetName();
url = Arc::URL(url_orig.plainstr() + '/' + name);
Stat(*f, verb);
f->SetName(name);
}
return result;
}
} // namespace ArcDMCGridFTP
extern Arc::PluginDescriptor const ARC_PLUGINS_TABLE_NAME[] = {
......
......@@ -25,6 +25,8 @@ namespace ArcDMCXrootd {
virtual bool RequiresCredentials() const;
virtual bool RequiresCredentialsInFile() const;
virtual bool SupportsTransfer() const;
virtual DataStatus List(std::list<FileInfo>& files, DataPoint::DataPointInfoType verb = INFO_TYPE_ALL);
};
} // namespace ArcDMCGridFTP
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment