From adda8ea30ec455bdc82277627ac33e8c45fff88b Mon Sep 17 00:00:00 2001 From: tengu-alt Date: Wed, 13 Nov 2024 14:40:10 +0200 Subject: [PATCH] Remove global NewBatch function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Batch should behave like Query, and need to be created from a session. patch by Oleksandr Luzhniy; reviewed by João Reis, Danylo Savchenko, Jackson Fleming, for CASSGO-15 --- CHANGELOG.md | 2 ++ session.go | 12 ------------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20da746a0..c990ef682 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Don't restrict server authenticator unless PasswordAuthentictor.AllowedAuthenticators is provided (CASSGO-19) +- Remove global NewBatch function (CASSGO-15) + ### Fixed ## [1.7.0] - 2024-09-23 diff --git a/session.go b/session.go index a600b95f3..b884735c2 100644 --- a/session.go +++ b/session.go @@ -1747,18 +1747,6 @@ type Batch struct { routingInfo *queryRoutingInfo } -// NewBatch creates a new batch operation without defaults from the cluster -// -// Deprecated: use session.NewBatch instead -func NewBatch(typ BatchType) *Batch { - return &Batch{ - Type: typ, - metrics: &queryMetrics{m: make(map[string]*hostMetrics)}, - spec: &NonSpeculativeExecution{}, - routingInfo: &queryRoutingInfo{}, - } -} - // NewBatch creates a new batch operation using defaults defined in the cluster func (s *Session) NewBatch(typ BatchType) *Batch { s.mu.RLock()