aliyun / aliyun/aliyun-tablestore-java-sdk

TimestreamMetaIterator分页会取出所有数据

Open
#26 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
57
Forks
29
PR merge metrics
No merged PRs in 30d

Description

参考该地址实现: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提出公共方法出来。目前实现分页,不能用这个方法,只能自己写实现

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at TimestreamMetaIterator.hasNext and inspect isBufferHasData, response.getNextToken, and fetchData. Reproduce the paginated fetch described in the issue, then verify that iteration respects pagination instead of continuing until all data is retrieved; no test or source file is named in the report.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.