Skip to content

Commit 8e67aec

Browse files
committed
rename experimental method
1 parent 054669f commit 8e67aec

File tree

9 files changed

+26
-24
lines changed

9 files changed

+26
-24
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
* Renamed method at experimental API reader.PopBatchTx to reader.PopMessagesBatchTx
2+
13
## v3.80.5
24
* Fixed connections pool leak on failed `ydb.Open` call
35

examples/topic/topicreader/topic_reader_transaction.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func CommitMessagesToTransaction(ctx context.Context, db *ydb.Driver, reader *to
1515
}
1616

1717
err := db.Query().DoTx(ctx, func(ctx context.Context, tx query.TxActor) error {
18-
batch, err := reader.PopBatchTx(ctx, tx) // the batch will be committed with commit the tx
18+
batch, err := reader.PopMessagesBatchTx(ctx, tx) // the batch will be committed with commit the tx
1919
if err != nil {
2020
return err
2121
}
@@ -51,7 +51,7 @@ func PopWithTransaction(ctx context.Context, db *ydb.Driver, reader *topicreader
5151
}
5252

5353
err := db.Query().DoTx(ctx, func(ctx context.Context, tx query.TxActor) error {
54-
batch, err := reader.PopBatchTx(ctx, tx)
54+
batch, err := reader.PopMessagesBatchTx(ctx, tx)
5555
if err != nil {
5656
return err
5757
}
@@ -102,7 +102,7 @@ func PopWithTransactionRecreateReader(
102102
return err
103103
}
104104

105-
batch, err := reader.PopBatchTx(ctx, tx)
105+
batch, err := reader.PopMessagesBatchTx(ctx, tx)
106106
if err != nil {
107107
return err
108108
}

internal/topic/topicreaderinternal/batched_stream_reader_interface.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ type batchedStreamReader interface {
1414
ReadMessageBatch(ctx context.Context, opts ReadMessageBatchOptions) (*topicreadercommon.PublicBatch, error)
1515
Commit(ctx context.Context, commitRange topicreadercommon.CommitRange) error
1616
CloseWithError(ctx context.Context, err error) error
17-
PopBatchTx(ctx context.Context, tx tx.Transaction, opts ReadMessageBatchOptions) (*topicreadercommon.PublicBatch, error) //nolint:lll
17+
PopMessagesBatchTx(ctx context.Context, tx tx.Transaction, opts ReadMessageBatchOptions) (*topicreadercommon.PublicBatch, error) //nolint:lll
1818
}

internal/topic/topicreaderinternal/batched_stream_reader_mock_test.go

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/topic/topicreaderinternal/reader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func (r *Reader) PopBatchTx(
128128
) (*topicreadercommon.PublicBatch, error) {
129129
batchOptions := r.getBatchOptions(opts)
130130

131-
return r.reader.PopBatchTx(ctx, tx, batchOptions)
131+
return r.reader.PopMessagesBatchTx(ctx, tx, batchOptions)
132132
}
133133

134134
// ReadMessage read exactly one message

internal/topic/topicreaderinternal/stream_reader_impl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ func (r *topicStreamReaderImpl) WaitInit(_ context.Context) error {
185185
return nil
186186
}
187187

188-
func (r *topicStreamReaderImpl) PopBatchTx(
188+
func (r *topicStreamReaderImpl) PopMessagesBatchTx(
189189
ctx context.Context,
190190
tx tx.Transaction,
191191
opts ReadMessageBatchOptions,

internal/topic/topicreaderinternal/stream_reconnector.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func newReaderReconnector(
7878
return res
7979
}
8080

81-
func (r *readerReconnector) PopBatchTx(
81+
func (r *readerReconnector) PopMessagesBatchTx(
8282
ctx context.Context,
8383
tx tx.Transaction,
8484
opts ReadMessageBatchOptions,
@@ -95,7 +95,7 @@ func (r *readerReconnector) PopBatchTx(
9595
*topicreadercommon.PublicBatch,
9696
error,
9797
) {
98-
return stream.PopBatchTx(ctx, tx, opts)
98+
return stream.PopMessagesBatchTx(ctx, tx, opts)
9999
},
100100
)
101101
}

tests/integration/topic_transactions_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func TestTopicReadInTransaction(t *testing.T) {
3030
require.NoError(t, scope.Driver().Query().DoTx(ctx, func(ctx context.Context, tx query.TxActor) error {
3131
reader := scope.TopicReaderNamed("first")
3232
scope.Logf("trying to pop a batch")
33-
batch, err := reader.PopBatchTx(ctx, tx)
33+
batch, err := reader.PopMessagesBatchTx(ctx, tx)
3434
scope.Logf("pop a batch result: %v", err)
3535
if err != nil {
3636
return err
@@ -55,7 +55,7 @@ func TestTopicReadInTransaction(t *testing.T) {
5555
}
5656

5757
scope.Logf("trying second pop batch")
58-
batch, err := reader.PopBatchTx(ctx, tx)
58+
batch, err := reader.PopMessagesBatchTx(ctx, tx)
5959
scope.Logf("second pop batch result: %v", err)
6060
if err != nil {
6161
return err

topic/topicreader/reader.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func (r *Reader) Commit(ctx context.Context, obj CommitRangeGetter) error {
7474
return r.reader.Commit(ctx, obj)
7575
}
7676

77-
// PopBatchTx read messages batch and commit them within tx.
77+
// PopMessagesBatchTx read messages batch and commit them within tx.
7878
// If tx failed - the batch will be received again.
7979
//
8080
// Now it means reconnect to the server and re-read messages from the server to the readers buffer.
@@ -83,7 +83,7 @@ func (r *Reader) Commit(ctx context.Context, obj CommitRangeGetter) error {
8383
// The reconnect is implementation detail and may be changed in the future.
8484
//
8585
// Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental
86-
func (r *Reader) PopBatchTx(
86+
func (r *Reader) PopMessagesBatchTx(
8787
ctx context.Context,
8888
transaction tx.Identifier,
8989
opts ...ReadBatchOption,

0 commit comments

Comments
 (0)