MCPcopy
hub / github.com/grafana/tempo / setPage

Method setPage

pkg/parquetquery/iters.go:891–922  ·  view source on GitHub ↗
(pg pq.Page)

Source from the content-addressed store, hash-verified

889}
890
891func (c *SyncIterator) setPage(pg pq.Page) {
892 // Handle an outgoing page
893 if c.currPage != nil {
894 c.curr = c.currPageMax.Preceding() // Reposition current row number to end of this page.
895 pq.Release(c.currPage)
896 c.currPage = nil
897 }
898
899 // Reset value buffers
900 c.currValues = nil
901 c.currPageMax = EmptyRowNumber()
902 c.currPageMin = EmptyRowNumber()
903 c.currBufN = 0
904 c.currPageN = 0
905
906 // If we don't immediately have a new incoming page
907 // then return the buffer to the pool.
908 if pg == nil && c.currBuf != nil {
909 syncIteratorPoolPut(c.currBuf)
910 c.currBuf = nil
911 }
912
913 // Handle an incoming page
914 if pg != nil {
915 rn := c.curr
916 rn.Skip(pg.NumRows() + 1) // Exclusive upper bound, points at the first rownumber in the next page
917 c.currPage = pg
918 c.currPageMin = c.curr
919 c.currPageMax = rn
920 c.currValues = pg.Values()
921 }
922}
923
924func (c *SyncIterator) closeCurrRowGroup() {
925 if c.currChunk != nil {

Callers 4

seekPagesMethod · 0.95
nextMethod · 0.95
closeCurrRowGroupMethod · 0.95
nextMethod · 0.80

Calls 6

EmptyRowNumberFunction · 0.85
syncIteratorPoolPutFunction · 0.85
PrecedingMethod · 0.80
SkipMethod · 0.80
ReleaseMethod · 0.65
ValuesMethod · 0.45

Tested by

no test coverage detected