Beispiel #1
0
    def __init__(self, name, configFile):
        """
        Initializer for the object.
        """
        Service.__init__(self, name, configFile)

        # Hourly purge
        self.PURGE_INTERVAL = 3600

        # DB Table where to store the messages
        self.transfers_db_table = self.param('transfersDBTable')
        self.transfers_db_table_rejected = self.param('rejectedDBTable')
        # Maximum number of messages in the buffer when making a bulk insert 
        self.buffer_size = int(self.param('bufferSize'))

        self.id = self.param('id')
        self.dbsection = self.param('dbsection')  

        self._next_purge = time.time() + self.PURGE_INTERVAL

        # Try to read the local queue
        try:
            self.localQueue = DQS(path = self.param('localQueue'))
        except Exception as e:
            self._logger.error("connection to the local queue failed")
Beispiel #2
0
    def __init__(self, name, configFile):
        """
        Initializer for the object.
        """
        Service.__init__(self, name, configFile)
        
        self.id = self.param('id')
        self.udp_port = int(self.param('udp_port'))
        self.udp_host = self.param('udp_host')
        if self.udp_host == 'hostname':
            self.udp_host = socket.gethostname()

        try:
            global gmq
            gmq = DQS(path = self.param('localQueue'))
            self._logger.info( "Created connection to local queue %s" % self.param('localQueue'))
        except Exception as  err :
            self._logger.error( "Failing connection to local queue %s" % (err))
            raise Exception

        self._logger.info('UDP listener on %s:%s'%(self.udp_host,self.udp_port))
        self.server = ThreadedUDPServer((self.udp_host,self.udp_port),CMSSWUDPHandler)   

        self._logger.info('created server. going to serve_forever in thread')
        self.server_thread = threading.Thread(target=self.server.serve_forever)

        self.server_thread.start()
        self._logger.info('Server loop running in thread: %s' % self.server_thread.name )
Beispiel #3
0
    def __init__(self, name, configFile):
        """
        Initializer for the object.
        """
        Service.__init__(self, name, configFile)

        self.id = self.param('id')
        self.udp_port = int(self.param('udp_port'))
        self.udp_host = self.param('udp_host')
        if self.udp_host == 'hostname':
            self.udp_host = socket.gethostname()

        try:
            global gmq
            gmq = DQS(path=self.param('localQueue'))
            self._logger.info("Created connection to local queue %s" %
                              self.param('localQueue'))
        except Exception as err:
            self._logger.error("Failing connection to local queue %s" % (err))
            raise Exception

        self._logger.info('UDP listener on %s:%s' %
                          (self.udp_host, self.udp_port))
        self.server = ThreadedUDPServer((self.udp_host, self.udp_port),
                                        CMSSWUDPHandler)

        self._logger.info('created server. going to serve_forever in thread')
        self.server_thread = threading.Thread(target=self.server.serve_forever)

        self.server_thread.start()
        self._logger.info('Server loop running in thread: %s' %
                          self.server_thread.name)
    def __init__(self, name, configFile):
        """
        Initializer for the object.
        """
        Service.__init__(self, name, configFile)

        # Hourly purge
        self.PURGE_INTERVAL = 3600

        # DB Table where to store the messages
        self.transfers_db_table = self.param('transfersDBTable')
        self.transfers_db_table_rejected = self.param('rejectedDBTable')
        # Maximum number of messages in the buffer when making a bulk insert 
        self.buffer_size = int(self.param('bufferSize'))

        self.id = self.param('id')
        self.dbsection = self.param('dbsection')  

        self._next_purge = time.time() + self.PURGE_INTERVAL

        # Try to read the local queue
        try:
            self.localQueue = DQS(path = self.param('localQueue'))
        except Exception as e:
            self._logger.error("connection to the local queue failed")
Beispiel #5
0
 def __init__(self, name, configFile):
     """
     Initializer for the object.
     """
     Service.__init__(self, name, configFile)
     
     # Load info from the configuration parameters
     self._param1 = self.param("param1")
     self._param2 = self.param("param2")
Beispiel #6
0
    def __init__(self, name, configFile):
        """
        Initializer for the object.
        """
        Service.__init__(self, name, configFile)
        
        self.id = self.param('id')
        self.udp_port = int(self.param('udp_port'))
        self.udp_host = self.param('udp_host')
        if self.udp_host == 'hostname':
            self.udp_host = socket.gethostname()

        try:
            global gmq
            gmq = DQS(path = self.param('localQueue'))
            self._logger.info( "Created connection to local queue %s" % self.param('localQueue'))
        except Exception,  err :
            self._logger.error( "Failing connection to local queue %s" % (err))
            raise Exception