Commit 6d50a900 authored by Michael Davis's avatar Michael Davis
Browse files

[os-failedrequests] Adds some missing job fields to result set

parent 5f38f6ef
......@@ -485,6 +485,10 @@ void CtaAdminCmd::print(const cta::admin::FailedRequestLsItem &frls_item)
<< std::setfill(' ') << std::setw(6) << std::right << frls_item.requester().groupname() << ' '
<< frls_item.af().df().path()
<< std::endl;
for(auto &errLogMsg : frls_item.failurelogs()) {
std::cout << errLogMsg << std::endl;
}
}
void CtaAdminCmd::printFrLsSummaryHeader()
......
......@@ -206,11 +206,9 @@ getQueueJobs(const jobQueue_t &jobQueueChunk)
if(tf.second.vid == m_jobQueuesQueueIt->vid) {
auto job = cta::common::dataStructures::RetrieveJob();
job.tapeCopies[tf.second.vid].first = tf.second.copyNb;
job.tapeCopies[tf.second.vid].second = tf.second;
job.request.dstURL = osrr.first.getSchedulerRequest().dstURL;
job.request.archiveFileID = osrr.first.getArchiveFile().archiveFileID;
job.fileSize = osrr.first.getArchiveFile().fileSize;
job.request = osrr.first.getSchedulerRequest();
job.fileSize = osrr.first.getArchiveFile().fileSize;
job.tapeCopies[tf.second.vid] = std::make_pair(tf.second.copyNb, tf.second);
m_jobCache.push_back(job);
}
......
......@@ -98,13 +98,13 @@ private:
* Add a record to the stream
*
* @param[in] streambuf XRootD SSI stream object to push records to
* @param[in] requestType The type of failed request (archive or retrieve)
* @param[in] item Archive or Retrieve Job (used for template specialisation)
*
* @retval true Stream buffer is full and ready to send
* @retval false Stream buffer is not full
*/
template<typename QueueType>
bool pushRecord(XrdSsiPb::OStreamBuffer<Data> *streambuf, const std::string &qid, const QueueType &item);
bool pushRecord(XrdSsiPb::OStreamBuffer<Data> *streambuf, const QueueType &item);
// Member variables
......@@ -124,18 +124,24 @@ private:
* pushRecord ArchiveJob specialisation
*/
template<> bool FailedRequestLsStream::
pushRecord(XrdSsiPb::OStreamBuffer<Data> *streambuf, const std::string &tapepool,
const common::dataStructures::ArchiveJob &item)
pushRecord(XrdSsiPb::OStreamBuffer<Data> *streambuf, const common::dataStructures::ArchiveJob &item)
{
Data record;
record.mutable_frls_item()->set_request_type(admin::RequestType::ARCHIVE_REQUEST);
record.mutable_frls_item()->set_tapepool(tapepool);
record.mutable_frls_item()->set_tapepool(m_archiveQueueItorPtr->qid());
record.mutable_frls_item()->set_copy_nb(item.copyNumber);
record.mutable_frls_item()->mutable_requester()->set_username(item.request.requester.name);
record.mutable_frls_item()->mutable_requester()->set_groupname(item.request.requester.group);
record.mutable_frls_item()->mutable_af()->mutable_df()->set_path(item.request.diskFileInfo.path);
//record.mutable_frls()->set_failurelogs(...
if(m_isLogEntries) {
#if 0
for(auto &errLogMsg : item.failurelogs) {
record.mutable_frls_item()->mutable_failurelogs()->Add(errLogMsg);
}
#endif
}
return streambuf->Push(record);
}
......@@ -146,9 +152,10 @@ pushRecord(XrdSsiPb::OStreamBuffer<Data> *streambuf, const std::string &tapepool
* pushRecord RetrieveJob specialisation
*/
template<> bool FailedRequestLsStream::
pushRecord(XrdSsiPb::OStreamBuffer<Data> *streambuf, const std::string &vid,
const common::dataStructures::RetrieveJob &item)
pushRecord(XrdSsiPb::OStreamBuffer<Data> *streambuf, const common::dataStructures::RetrieveJob &item)
{
auto &vid = m_retrieveQueueItorPtr->qid();
Data record;
record.mutable_frls_item()->set_request_type(admin::RequestType::RETRIEVE_REQUEST);
......@@ -190,13 +197,13 @@ XrdSsiStream::Buffer* FailedRequestLsStream::GetBuff(XrdSsiErrInfo &eInfo, int &
// List failed archive requests
if(isArchiveJobs) {
for(bool is_buffer_full = false; !m_archiveQueueItorPtr->end() && !is_buffer_full; ++*m_archiveQueueItorPtr) {
is_buffer_full = pushRecord(streambuf, m_archiveQueueItorPtr->qid(), **m_archiveQueueItorPtr);
is_buffer_full = pushRecord(streambuf, **m_archiveQueueItorPtr);
}
}
// List failed retrieve requests
if(isRetrieveJobs) {
for(bool is_buffer_full = false; !m_retrieveQueueItorPtr->end() && !is_buffer_full; ++*m_retrieveQueueItorPtr) {
is_buffer_full = pushRecord(streambuf, m_retrieveQueueItorPtr->qid(), **m_retrieveQueueItorPtr);
is_buffer_full = pushRecord(streambuf, **m_retrieveQueueItorPtr);
}
}
}
......
Supports Markdown
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