Skip to content

Commit

Permalink
Add documentation to multiScanNode
Browse files Browse the repository at this point in the history
  • Loading branch information
islamaliev committed Aug 22, 2024
1 parent 4f7a741 commit d2e6590
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/planner/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,10 @@ func (p *Planner) Scan(
// If we have two readers on our multiScanNode, then
// we call Next() on the underlying scanNode only
// once every 2 Next() calls on the multiScan
//
// NOTE: calling Init() on multiScanNode is subject to counting as well and as such
// doesn't not provide idempotency guarantees. Counting is purely for performance
// reasons and removing it should be safe.
type multiScanNode struct {
scanNode *scanNode
numReaders int
Expand All @@ -334,6 +338,10 @@ type multiScanNode struct {
err error
}

// Init initializes the multiScanNode.
// NOTE: this function is subject to counting based on the number of readers and as such
// doesn't not provide idempotency guarantees. Counting is purely for performance
// reasons and removing it should be safe.
func (n *multiScanNode) Init() error {
n.countAndCall(&n.initCount, func() error {
return n.scanNode.Init()
Expand Down

0 comments on commit d2e6590

Please sign in to comment.