コード例 #1
0
ファイル: pooling.py プロジェクト: xglhjk6/zaqar
    def _list(self, project=None, marker=None,
              limit=storage.DEFAULT_QUEUES_PER_PAGE, detailed=False):

        def all_pages():
            yield next(self._mgt_queue_ctrl.list(
                project=project,
                marker=marker,
                limit=limit,
                detailed=detailed))

        # make a heap compared with 'name'
        ls = heapq.merge(*[
            utils.keyify('name', page)
            for page in all_pages()
        ])

        marker_name = {}

        # limit the iterator and strip out the comparison wrapper
        def it():
            for queue_cmp in itertools.islice(ls, limit):
                marker_name['next'] = queue_cmp.obj['name']
                yield queue_cmp.obj

        yield it()
        yield marker_name and marker_name['next']
コード例 #2
0
ファイル: pooling.py プロジェクト: AvnishPal/zaqar
    def _list(self, project=None, marker=None,
              limit=storage.DEFAULT_QUEUES_PER_PAGE, detailed=False):

        def all_pages():
            pool = self._pool_catalog.get_default_pool()
            if pool is None:
                raise errors.NoPoolFound()
            yield next(pool.queue_controller.list(
                project=project,
                marker=marker,
                limit=limit,
                detailed=detailed))

        # make a heap compared with 'name'
        ls = heapq.merge(*[
            utils.keyify('name', page)
            for page in all_pages()
        ])

        marker_name = {}

        # limit the iterator and strip out the comparison wrapper
        def it():
            for queue_cmp in itertools.islice(ls, limit):
                marker_name['next'] = queue_cmp.obj['name']
                yield queue_cmp.obj

        yield it()
        yield marker_name and marker_name['next']
コード例 #3
0
ファイル: pooling.py プロジェクト: wenchma/zaqar
    def _list(self, project=None, marker=None,
              limit=storage.DEFAULT_QUEUES_PER_PAGE, detailed=False):

        def all_pages():
            cursor = self._pool_catalog._pools_ctrl.list(limit=0)
            for pool in next(cursor):
                yield next(self._pool_catalog.get_driver(pool['name'])
                           .queue_controller.list(
                               project=project,
                               marker=marker,
                               limit=limit,
                               detailed=detailed))

        # make a heap compared with 'name'
        ls = heapq.merge(*[
            utils.keyify('name', page)
            for page in all_pages()
        ])

        marker_name = {}

        # limit the iterator and strip out the comparison wrapper
        def it():
            for queue_cmp in itertools.islice(ls, limit):
                marker_name['next'] = queue_cmp.obj['name']
                yield queue_cmp.obj

        yield it()
        yield marker_name and marker_name['next']
コード例 #4
0
    def _list(self,
              project=None,
              marker=None,
              limit=storage.DEFAULT_QUEUES_PER_PAGE,
              detailed=False):
        def all_pages():
            cursor = self._pool_catalog._pools_ctrl.list(limit=0)
            pools_list = list(next(cursor))
            anypool = pools_list and pools_list[0]
            if anypool:
                yield next(
                    self._pool_catalog.get_driver(
                        anypool['name']).queue_controller.list(
                            project=project,
                            marker=marker,
                            limit=limit,
                            detailed=detailed))

        # make a heap compared with 'name'
        ls = heapq.merge(*[utils.keyify('name', page) for page in all_pages()])

        marker_name = {}

        # limit the iterator and strip out the comparison wrapper
        def it():
            for queue_cmp in itertools.islice(ls, limit):
                marker_name['next'] = queue_cmp.obj['name']
                yield queue_cmp.obj

        yield it()
        yield marker_name and marker_name['next']
コード例 #5
0
    def _list(self,
              project=None,
              marker=None,
              limit=storage.DEFAULT_QUEUES_PER_PAGE,
              detailed=False):
        def all_pages():
            pool = self._pool_catalog.get_default_pool()
            if pool is None:
                raise errors.NoPoolFound()
            yield next(
                pool.queue_controller.list(project=project,
                                           marker=marker,
                                           limit=limit,
                                           detailed=detailed))

        # make a heap compared with 'name'
        ls = heapq.merge(*[utils.keyify('name', page) for page in all_pages()])

        marker_name = {}

        # limit the iterator and strip out the comparison wrapper
        def it():
            for queue_cmp in itertools.islice(ls, limit):
                marker_name['next'] = queue_cmp.obj['name']
                yield queue_cmp.obj

        yield it()
        yield marker_name and marker_name['next']
コード例 #6
0
ファイル: pooling.py プロジェクト: openstack/zaqar
    def _list(self, project=None, kfilter={}, marker=None,
              limit=storage.DEFAULT_TOPICS_PER_PAGE, detailed=False,
              name=None):

        def all_pages():
            yield next(self._mgt_topic_ctrl.list(
                project=project,
                kfilter=kfilter,
                marker=marker,
                limit=limit,
                detailed=detailed,
                name=name))

        # make a heap compared with 'name'
        ls = heapq.merge(*[
            utils.keyify('name', page)
            for page in all_pages()
        ])

        marker_name = {}

        # limit the iterator and strip out the comparison wrapper
        def it():
            for topic_cmp in itertools.islice(ls, limit):
                marker_name['next'] = topic_cmp.obj['name']
                yield topic_cmp.obj

        yield it()
        yield marker_name and marker_name['next']