From 9f962fc42ab01c8e0de305602cc8e542d7ad0da0 Mon Sep 17 00:00:00 2001
From: Michael Davis <michael.davis@cern.ch>
Date: Mon, 4 Jun 2018 16:38:05 +0200
Subject: [PATCH] [lpa-stream] Displays fSeq and blockId

---
 cmdline/CtaAdminCmd.cpp                  |  6 ++---
 xroot_plugins/XrdCtaListPendingQueue.hpp | 32 ++++++------------------
 xrootd-ssi-protobuf-interface            |  2 +-
 3 files changed, 11 insertions(+), 29 deletions(-)

diff --git a/cmdline/CtaAdminCmd.cpp b/cmdline/CtaAdminCmd.cpp
index 63bb07a036..cdf8a8f792 100644
--- a/cmdline/CtaAdminCmd.cpp
+++ b/cmdline/CtaAdminCmd.cpp
@@ -473,11 +473,11 @@ void CtaAdminCmd::printLprHeader()
 
 void CtaAdminCmd::printLprItem(const cta::admin::ArchiveFileItem &af_item)
 {
-   std::cout << std::setfill(' ') << std::setw(13) << std::right << af_item.vid()             << ' '
+   std::cout << std::setfill(' ') << std::setw(13) << std::right << af_item.tf().vid()        << ' '
              << std::setfill(' ') << std::setw(7)  << std::right << af_item.af().archive_id() << ' '
              << std::setfill(' ') << std::setw(7)  << std::right << af_item.copy_nb()         << ' '
-             << std::setfill(' ') << std::setw(7)  << std::right << "fseq"                    << ' '
-             << std::setfill(' ') << std::setw(9)  << std::right << "block id"                << ' '
+             << std::setfill(' ') << std::setw(7)  << std::right << af_item.tf().f_seq()      << ' '
+             << std::setfill(' ') << std::setw(9)  << std::right << af_item.tf().block_id()   << ' '
              << std::setfill(' ') << std::setw(12) << std::right << af_item.af().size()       << ' '
              << std::setfill(' ') << std::setw(8)  << std::right << af_item.af().df().owner() << ' '
              << std::setfill(' ') << std::setw(8)  << std::right << af_item.af().df().group() << ' '
diff --git a/xroot_plugins/XrdCtaListPendingQueue.hpp b/xroot_plugins/XrdCtaListPendingQueue.hpp
index 1f8a37f87e..9a7335e8f0 100644
--- a/xroot_plugins/XrdCtaListPendingQueue.hpp
+++ b/xroot_plugins/XrdCtaListPendingQueue.hpp
@@ -218,7 +218,6 @@ template<>
 bool ListPendingQueue<OStoreDB::RetrieveQueueItor_t>::pushRecord(XrdSsiPb::OStreamBuffer<Data> *streambuf,
    const std::string &vid, const common::dataStructures::RetrieveJob &job)
 {
-
 #if 0
    if(vid) {
       std::list<cta::common::dataStructures::RetrieveJob> list = m_scheduler.getPendingRetrieveJobs(vid.value(), m_lc);
@@ -226,17 +225,6 @@ bool ListPendingQueue<OStoreDB::RetrieveQueueItor_t>::pushRecord(XrdSsiPb::OStre
    } else {
       result = m_scheduler.getPendingRetrieveJobs(m_lc);
    }
-
-         for(auto it = result.cbegin(); it != result.cend(); it++)
-         {
-            for(auto jt = it->second.cbegin(); jt != it->second.cend(); jt++)
-            {
-               currentRow.push_back(jt->request.requester.name);
-               currentRow.push_back(jt->request.requester.group);
-               currentRow.push_back(jt->request.diskFileInfo.path);
-               responseTable.push_back(currentRow);
-            }
-         }
 #endif
 
    bool is_buffer_full = false;
@@ -253,33 +241,27 @@ bool ListPendingQueue<OStoreDB::RetrieveQueueItor_t>::pushRecord(XrdSsiPb::OStre
       // Response type
       record.mutable_af_item()->set_type(cta::admin::ArchiveFileItem::LISTPENDINGRETRIEVES);
 
-      // VID
-      record.mutable_af_item()->set_vid(tape_it->first);
-
       // Copy number
       record.mutable_af_item()->set_copy_nb(tape_it->second.first);
 
-      // Retrieve file
+      // Archive file
       auto af = record.mutable_af_item()->mutable_af();
       af->set_archive_id(job.request.archiveFileID);
       af->set_size(tape_it->second.second.compressedSize);
 #if 0
                cta::common::dataStructures::ArchiveFile file = m_catalogue.getArchiveFileById(jt->request.archiveFileID);
-               currentRow.push_back(std::to_string(static_cast<unsigned long long>((jt->tapeCopies.at(it->first).first))));
-               currentRow.push_back(std::to_string(static_cast<unsigned long long>((jt->tapeCopies.at(it->first).second.fSeq))));
-               currentRow.push_back(std::to_string(static_cast<unsigned long long>((jt->tapeCopies.at(it->first).second.blockId))));
                currentRow.push_back(std::to_string(static_cast<unsigned long long>(file.fileSize)));
-   af->set_disk_instance(job.instanceName);
-   af->set_disk_id(job.request.diskFileID);
-   af->set_size(job.request.fileSize);
-   af->mutable_cs()->set_type(job.request.checksumType);
-   af->mutable_cs()->set_value(job.request.checksumValue);         
-   af->set_storage_class(job.request.storageClass);
 #endif
       af->mutable_df()->set_owner(job.request.requester.name);
       af->mutable_df()->set_group(job.request.requester.group);
       af->mutable_df()->set_path(job.request.diskFileInfo.path);
 
+      // Tape file
+      auto tf = record.mutable_af_item()->mutable_tf();
+      tf->set_vid(tape_it->first);
+      tf->set_f_seq(tape_it->second.second.fSeq);
+      tf->set_block_id(tape_it->second.second.blockId);
+
       is_buffer_full = streambuf->Push(record);
    }
 
diff --git a/xrootd-ssi-protobuf-interface b/xrootd-ssi-protobuf-interface
index 3ce8079aec..36cf1ea86e 160000
--- a/xrootd-ssi-protobuf-interface
+++ b/xrootd-ssi-protobuf-interface
@@ -1 +1 @@
-Subproject commit 3ce8079aec20aa77b3a4773e6caa02b36bb0a749
+Subproject commit 36cf1ea86e6f6cd0843a9a90521b36c3948d2937
-- 
GitLab