Skip to content

Commit cd0a1bc

Browse files
committed
address PR comments
1 parent cd2ec08 commit cd0a1bc

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

query_executor.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ type ExecutableStatement interface {
5151
// (currently Query and Batch via Session.Query and Session.Batch)
5252
type Statement interface {
5353
Iter() *Iter
54+
IterContext(ctx context.Context) *Iter
5455
Exec() error
56+
ExecContext(ctx context.Context) error
5557
}
5658

5759
type internalRequest interface {
@@ -339,7 +341,6 @@ type internalQuery struct {
339341
qryOpts *queryOptions
340342
pageState []byte
341343
metrics *queryMetrics
342-
refCount uint32
343344
conn *Conn
344345
consistency uint32
345346
session *Session
@@ -563,6 +564,7 @@ func newInternalBatch(batch *Batch, ctx context.Context) *internalBatch {
563564
metrics: &queryMetrics{m: make(map[string]*hostMetrics)},
564565
routingInfo: &queryRoutingInfo{},
565566
session: batch.session,
567+
consistency: uint32(batch.GetConsistency()),
566568
}
567569
}
568570

session.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -752,9 +752,9 @@ func (b *Batch) ExecContext(ctx context.Context) error {
752752

753753
// Iter executes a batch operation and returns an Iter object
754754
// that can be used to access properties related to the execution like Iter.Attempts and Iter.Latency
755-
func (b *Batch) Iter() *Iter { return b.session.executeBatch(b, nil) }
755+
func (b *Batch) Iter() *Iter { return b.IterContext(nil) }
756756

757-
// Iter executes a batch operation with the provided context and returns an Iter object
757+
// IterContext executes a batch operation with the provided context and returns an Iter object
758758
// that can be used to access properties related to the execution like Iter.Attempts and Iter.Latency
759759
func (b *Batch) IterContext(ctx context.Context) *Iter {
760760
return b.session.executeBatch(b, ctx)

0 commit comments

Comments
 (0)