def __init__(self, client, cache_info, page_size, partitions, local):
        """
        :param client: Synchronous Apache Ignite client.
        :param cache_info: Cache meta info.
        :param page_size: page size.
        :param partitions: number of partitions to query (negative to query entire cache).
        :param local: pass True if this query should be executed on local node only.
        """
        super().__init__(client, cache_info, page_size, partitions, local)

        self.connection = self.client.random_node
        result = scan(self.connection, self.cache_info, self._page_size,
                      self._partitions, self._local)
        self._finalize_init(result)
Exemplo n.º 2
0
def test_close_resource(client, cache):

    page_size = 10

    result = cache_put_all(client, cache, {
        'key_{}'.format(v): v for v in range(page_size * 2)
    })
    assert result.status == 0

    result = scan(client, cache, page_size)
    assert result.status == 0
    assert len(result.value['data']) == page_size
    assert result.value['more'] is True

    cursor = result.value['cursor']

    result = resource_close(client, cursor)
    assert result.status == 0

    result = scan_cursor_get_page(client, cursor)
    assert result.status != 0
Exemplo n.º 3
0
def test_close_resource(client, cache):

    page_size = 10

    result = cache_put_all(
        client, cache, {'key_{}'.format(v): v
                        for v in range(page_size * 2)})
    assert result.status == 0

    result = scan(client, cache, page_size)
    assert result.status == 0
    assert len(result.value['data']) == page_size
    assert result.value['more'] is True

    cursor = result.value['cursor']

    result = resource_close(client, cursor)
    assert result.status == 0

    result = scan_cursor_get_page(client, cursor)
    assert result.status != 0