Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TimestreamMetaIterator分页会取出所有数据 #26

Open
hunanxinhua opened this issue Jul 9, 2021 · 0 comments
Open

TimestreamMetaIterator分页会取出所有数据 #26

hunanxinhua opened this issue Jul 9, 2021 · 0 comments

Comments

@hunanxinhua
Copy link

hunanxinhua commented Jul 9, 2021

参考该地址实现:https://help.aliyun.com/document_detail/114347.html?spm=a2c4g.11186623.6.615.17132345T3bKeQ

TimestreamMetaIterator iter1 = db.metaTable()
                .filter(filter)
                .identifierOnly()       // 只返回identifer
                .fetchAll();
        System.out.print(iterator.getTotalCount());   //获取命中的时间线条数
        while (iter1.hasNext()) {
            System.out.print(iterator.next().toString());
        }
    public boolean hasNext() {
        if (isBufferHasData()) {
            return true;
        }
        byte[] token = response.getNextToken();

        while (token != null) {
            request.getSearchQuery().setToken(response.getNextToken());
            request.getSearchQuery().setOffset(0);
            fetchData(request);
            if (isBufferHasData()) {
                return true;
            }
            token = response.getNextToken();
        }
        return false;
    }

上述实现会取出所有数据,是否需要把isBufferHasData提出公共方法出来。目前实现分页,不能用这个方法,只能自己写实现

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant