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

add ReadStreamByKey rpc #1529

Merged
merged 5 commits into from
Jul 27, 2023
Merged

add ReadStreamByKey rpc #1529

merged 5 commits into from
Jul 27, 2023

Conversation

YangKian
Copy link
Contributor

@YangKian YangKian commented Jul 26, 2023

PR Description

Type of change

  • New feature

Summary of the change and which issue is fixed

Main changes:
pseudocode for main read loop

while {
    nextRoundReads <- streamRecv
  
    if (nextRoundReads == 0) break
  
    // send cached records fist
    if (cachedRecords not empty) {
        streamSend cachedRecords
        nextRoundReads -= cachedSize
    }

    while (nextRoundReads > 0) {
        records <- decompress <$> logdeviceReader read
        (needSend, cached) <- split nextRoundReads records
        streamSend needSend
        nextRoundReads -= sendRecordSize
        update cache
    }
}

Checklist

  • I have run format.sh under script
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes

@YangKian YangKian changed the title Bi reader add ReasStreamByKey rpc Jul 26, 2023
@YangKian YangKian changed the title add ReasStreamByKey rpc add ReadStreamByKey rpc Jul 26, 2023
@daleiz daleiz merged commit c3173b7 into hstreamdb:main Jul 27, 2023
7 checks passed
@YangKian YangKian deleted the bi-reader branch July 27, 2023 05:02
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.

2 participants