Commit b0d809a5 authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Pass 'tapeHSMFilesystem' param to recall method to optimize recall operations from tape library.

parent ba934d30
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -273,7 +273,7 @@ class RetrieveExecutor(TaskExecutor):
                # if the storage type is 'cold'
                if self.storageType == "cold":
                    self.tapeClient.connect()
                    self.tapeClient.recall([ f["fullPath"] for f in blockFileList ], self.jobId)
                    self.tapeClient.recall([ f["fullPath"] for f in blockFileList ], self.tapeHSMFilesystem, self.jobId)
                    self.tapeClient.disconnect()

                # Loop on files in a block
+4 −3
Original line number Diff line number Diff line
@@ -143,11 +143,12 @@ class TapeClient(object):
                    raise TapeClientException(cmd, exitCode, stderr)
                return exitCode

    def recall(self, fileList, jobId):
    def recall(self, fileList, tapeHSMFilesystem, jobId):
        """
        Recalls from tape all files whose absolute path is
        contained in 'fileList'.
        A VOSpace job ID is also required as parameter.
        A HSM filesystem and a VOSpace jobId are also
        required as parameters.
        """
        self.logger.info("Starting RECALL operation...")
        recallFileList = f"vos_recall-{jobId}.lst"
@@ -161,7 +162,7 @@ class TapeClient(object):
            fp.close()
            self.copy(f"./{recallFileList}", f"{self.VOSPACE_WD}/{recallFileList}")
            os.remove(f"./{recallFileList}")
            cmd = f"{self.DSMRECALL} -filelist={self.VOSPACE_WD}/{recallFileList} > /dev/null 2>&1"
            cmd = f"{self.DSMRECALL} -filelist={self.VOSPACE_WD}/{recallFileList} {tapeHSMFilesystem} > /dev/null 2>&1"
            try:
                stdin, stdout, stderr = self.client.exec_command(cmd)
            except Exception: