Skip to content

[c++] Add bounded RecordBatch log reader APIs - #3988

Open
naivedogger wants to merge 2 commits into
apache:mainfrom
naivedogger:feature/cpp-bounded-log-reader
Open

[c++] Add bounded RecordBatch log reader APIs#3988
naivedogger wants to merge 2 commits into
apache:mainfrom
naivedogger:feature/cpp-bounded-log-reader

Conversation

@naivedogger

@naivedogger naivedogger commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Purpose

Linked issue: close #3987

Expose bounded RecordBatchLogReader APIs through the C++ binding.

API example

fluss::RecordBatchLogReader reader;
check("create_bounded_reader",
      table.NewScan().CreateRecordBatchLogReader(
          admin,
          assigned_buckets,
          fluss::TimestampRange{
              starting_timestamp_ms,
              stopping_timestamp_ms,
          },
          reader));

while (true) {
    fluss::RecordBatchReadResult result;
    check("next_batch", reader.NextBatch(1000, result));

    if (result.status == fluss::BoundedReadStatus::TimedOut) {
        continue;
    }
    if (result.status == fluss::BoundedReadStatus::Finished) {
        break;
    }

    process(result.batch->GetArrowRecordBatch());
}

The API also supports:

  • explicit starting and stopping offsets for each bucket;
  • starting offsets configured through scanner subscriptions;
  • stopping at explicit or latest offsets;
  • partitioned and non-partitioned tables.

TimedOut allows callers to check cancellation or deadlines before retrying. Finished means all assigned buckets have reached their stopping offsets.

Tests

  • cargo test -p fluss-rs --lib client::table::reader
  • cargo test -p fluss-cpp --lib
  • cargo clippy -p fluss-rs -p fluss-cpp --lib -- -D warnings
  • cargo fmt --check
  • CMake C++ build
  • Docker-backed C++ integration tests for explicit offsets, latest offsets,
    timestamp ranges, and partitioned tables

API and Format

This PR adds backward-compatible public C++ APIs.

Documentation

Updated the C++ README, API reference, log table guide, and example program.

@naivedogger

Copy link
Copy Markdown
Contributor Author

@fresh-borzoni @charlesdong1991 @leekeiabstraction Appreciate a review here when you have time 🙏

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

Successfully merging this pull request may close these issues.

[c++] Support bounded RecordBatch log reads

1 participant