Skip to content

Commit d98028f

Browse files
committed
Merge branch 'master' into topic-adapters
# Conflicts: # topic/topicreader/reader_example_test.go
2 parents 571a604 + f6e35cf commit d98028f

File tree

12 files changed

+44
-378
lines changed

12 files changed

+44
-378
lines changed

.github/workflows/check-codegen.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
matrix:
1212
os: [ ubuntu-latest ]
13-
go: [1.18.x]
13+
go: [1.18.x, 1.19.x]
1414
runs-on: ${{ matrix.os }}
1515
steps:
1616
- name: Checkout

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
name: golangci-lint
1111
strategy:
1212
matrix:
13-
go-version: [1.14.x, 1.15.x, 1.16.x, 1.17.x, 1.18.x]
13+
go-version: [1.14.x, 1.18.x, 1.19.x]
1414
os: [ubuntu-latest]
1515
env:
1616
OS: ${{ matrix.os }}

.github/workflows/tests.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
unit:
1010
strategy:
1111
matrix:
12-
go-version: [1.14.x, 1.15.x, 1.16.x, 1.17.x, 1.18.x]
12+
go-version: [1.14.x, 1.18.x, 1.19.x]
1313
os: [ubuntu-latest, windows-latest, macOS-latest]
1414
env:
1515
OS: ${{ matrix.os }}
@@ -33,7 +33,7 @@ jobs:
3333
table:
3434
strategy:
3535
matrix:
36-
go-version: [1.18.x]
36+
go-version: [1.18.x, 1.19.x]
3737
os: [ubuntu-latest]
3838
services:
3939
ydb:
@@ -76,7 +76,7 @@ jobs:
7676
ratelimiter:
7777
strategy:
7878
matrix:
79-
go-version: [1.18.x]
79+
go-version: [1.18.x, 1.19.x]
8080
os: [ubuntu-latest]
8181
services:
8282
ydb:
@@ -118,7 +118,7 @@ jobs:
118118
scripting:
119119
strategy:
120120
matrix:
121-
go-version: [1.18.x]
121+
go-version: [1.18.x, 1.19.x]
122122
os: [ubuntu-latest]
123123
services:
124124
ydb:
@@ -159,7 +159,7 @@ jobs:
159159
topic:
160160
strategy:
161161
matrix:
162-
go-version: [1.18.x]
162+
go-version: [1.18.x, 1.19.x]
163163
os: [ubuntu-latest]
164164
services:
165165
ydb:
@@ -200,7 +200,7 @@ jobs:
200200
discovery:
201201
strategy:
202202
matrix:
203-
go-version: [1.18.x]
203+
go-version: [1.18.x, 1.19.x]
204204
os: [ubuntu-latest]
205205
services:
206206
ydb:
@@ -241,7 +241,7 @@ jobs:
241241
connection:
242242
strategy:
243243
matrix:
244-
go-version: [1.18.x]
244+
go-version: [1.18.x, 1.19.x]
245245
os: [ubuntu-latest]
246246
services:
247247
ydb:

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
* Allow read and commit messages in parallel
1+
* Fixed signature/name of helpers in topic/topicsugar package
2+
* Allowed read and commit messages in parallel
23

34
## v3.31.0
45
* Extended the ydb.Connection interface with experimental db.Topic() client (control plane and reader API)

internal/topic/topicreaderinternal/batch.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ func newBatchFromStream(decoders decoderMap, session *partitionSession, sb rawto
9494
return newBatch(session, messages)
9595
}
9696

97-
// Context is cancelled when partition of message will stop to read.
97+
// Context is cancelled when code should stop to process messages batch
98+
// for example - lost connection to server or receive stop partition signal without graceful flag
9899
//
99100
// Experimental
100101
//

topic/reader_e2e_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ func TestReadMessages(t *testing.T) {
4242
t.Logf("msg: %#v", msg)
4343

4444
require.NoError(t, err)
45-
err = msg.UnmarshalTo(topicsugar.ConsumeWithCallback(func(data []byte) error {
45+
err = topicsugar.ReadMessageDataWithCallback(msg, func(data []byte) error {
4646
t.Log("Content:", string(data))
4747
return nil
48-
}))
48+
})
4949
require.NoError(t, err)
5050

5151
sendCDCMessage(ctx, t, db)

topic/topicoptions/topicoptions_reader.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ func WithCommitCountTrigger(count int) ReaderOption {
101101
}
102102

103103
// WithBatchReadMinCount
104+
// prefer min count messages in batch
105+
// sometimes batch can contain fewer messages, for example if local buffer is full and SDK can't receive more messages
104106
//
105107
// Experimental
106108
//

topic/topicreader/doc.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Package topicreader provide Reader to receive messages from YDB topics
2+
// More examples in examples repository
3+
//
4+
// https://github.com/ydb-platform/ydb-go-examples/tree/master/topic/topicreader
5+
package topicreader

topic/topicreader/reader.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ type Message = topicreaderinternal.PublicMessage
6868
type MessageContentUnmarshaler = topicreaderinternal.PublicMessageContentUnmarshaler
6969

7070
// Commit receive Message, Batch of single offset
71+
// It can be fast (by default) or sync and waite response from server
72+
// see topicoptions.CommitMode for details
7173
//
7274
// Experimental
7375
//

topic/topicreader/reader_exampl_own_type_unmarshal_test.go

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)