예제 #1
0
    def initialize(self):
        """
    Start a ThreadPool object to process transfers
    """
        #Define the shifter proxy needed
        self.am_setModuleParam("shifterProxy", "DataManager")

        self.__outDataExecutor = OutputDataExecutor()
        return S_OK()
예제 #2
0
  def initialize( self ):
    """
    Start a ThreadPool object to process transfers
    """
    #Define the shifter proxy needed
    self.am_setModuleParam( "shifterProxy", "DataManager" )

    self.__outDataExecutor = OutputDataExecutor()
    return S_OK()
예제 #3
0
class OutputDataAgent(AgentModule):
    def initialize(self):
        """
    Start a ThreadPool object to process transfers
    """
        #Define the shifter proxy needed
        self.am_setModuleParam("shifterProxy", "DataManager")

        self.__outDataExecutor = OutputDataExecutor()
        return S_OK()

    def execute(self):
        """
    Loop over InputPath and OutputPath pairs
    """
        self.__outDataExecutor.checkForTransfers()

        maxCycles = self.am_getMaxCycles()
        if maxCycles > 0 and maxCycles - self.am_getCyclesDone() == 1:
            gLogger.info(
                "Waiting to all transfers to finish before ending the last cycle"
            )
            #We are in the last cycle. Need to purge the thread pool
            self.__outDataExecutor.processAllPendingTransfers()

        gLogger.info("Transferred %d files" %
                     self.__outDataExecutor.getNumOKTransferredFiles())
        gLogger.info("Transferred %d bytes" %
                     self.__outDataExecutor.getNumOKTransferredBytes())

        return S_OK()
예제 #4
0
class OutputDataAgent( AgentModule ):

  def initialize( self ):
    """
    Start a ThreadPool object to process transfers
    """
    #Define the shifter proxy needed
    self.am_setModuleParam( "shifterProxy", "DataManager" )

    self.__outDataExecutor = OutputDataExecutor()
    return S_OK()

  def execute( self ):
    """
    Loop over InputPath and OutputPath pairs
    """
    self.__outDataExecutor.checkForTransfers()

    maxCycles = self.am_getMaxCycles()
    if maxCycles > 0 and maxCycles - self.am_getCyclesDone() == 1:
      gLogger.info( "Waiting to all transfers to finish before ending the last cycle" )
      #We are in the last cycle. Need to purge the thread pool
      self.__outDataExecutor.processAllPendingTransfers()

    gLogger.info( "Transferred %d files" % self.__outDataExecutor.getNumOKTransferredFiles() )
    gLogger.info( "Transferred %d bytes" % self.__outDataExecutor.getNumOKTransferredBytes() )


    return S_OK()