Exemplo n.º 1
0
 def _get_io_buffers(self, settings):
     specific_buffers = settings.specific_io_buffers.all()
     if len(specific_buffers) == 0:
         specific_buffers = [hs for hs in \
             ss.Host.objects.filter(role__name='io buffer', active=True)]
     hf = HostFactory()
     return [hf.create_host(hs) for hs in specific_buffers]
Exemplo n.º 2
0
    def __init__(self, timeslot, area, host=None, logger=None, callback=None):
        '''
        Inputs:

            timeslot - A datetime.datetime object

            area - A string with the name of the area

            host - A systemsettings.models.Host object. If None, the
                current host will be used.
        '''

        if callback is None:
            def cb(*args):
                pass
            self.callback = cb
        else:
            self.callback = callback
        self.logger = logger
        self.timeslot = timeslot
        self.source = G2Source(area, timeslot)
        #hf = HostFactory()
        hf = HostFactory(logger=self.logger)
        self.host = hf.create_host(host)
        # a random number for generating unique working dirs
        self.random = randint(0, 100)
Exemplo n.º 3
0
 def _get_io_buffers(self, settings):
     specific_buffers = settings.specific_io_buffers.all()
     if len(specific_buffers) == 0:
         specific_buffers = [hs for hs in \
             ss.Host.objects.filter(role__name='io buffer', active=True)]
     hf = HostFactory()
     return [hf.create_host(hs) for hs in specific_buffers]
Exemplo n.º 4
0
    def _get_archives(self, settings):
        '''
        Return a list of G2Host instances that are the archives for this file.

        The G2Host list is created from the specificArchives attribute. If
        there are no specificArchives defined, then all the hosts that have
        the 'archive' role and are 'active' will be used.
        '''

        specific_archives = settings.specificArchives.all()
        if len(specific_archives) == 0:
            specific_archives = [hs for hs in \
                ss.Host.objects.filter(role__name='archive', active=True)]
        hf = HostFactory(logger=self.logger)
        return [hf.create_host(hs) for hs in specific_archives]
Exemplo n.º 5
0
    def _get_archives(self, settings):
        '''
        Return a list of G2Host instances that are the archives for this file.

        The G2Host list is created from the specificArchives attribute. If
        there are no specificArchives defined, then all the hosts that have
        the 'archive' role and are 'active' will be used.
        '''

        specific_archives = settings.specificArchives.all()
        if len(specific_archives) == 0:
            specific_archives = [hs for hs in \
                ss.Host.objects.filter(role__name='archive', active=True)]
        hf = HostFactory(logger=self.logger)
        return [hf.create_host(hs) for hs in specific_archives]