Exemplo n.º 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()
Exemplo n.º 2
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:
      self.log.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()

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


    return S_OK()