Skip to content

Commit aae7669

Browse files
committed
Use proto reader iterator when proto enabled
1 parent bfd9979 commit aae7669

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/dbnode/client/config.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828

2929
"github.com/m3db/m3/src/dbnode/encoding"
3030
"github.com/m3db/m3/src/dbnode/encoding/m3tsz"
31+
"github.com/m3db/m3/src/dbnode/encoding/proto"
3132
"github.com/m3db/m3/src/dbnode/environment"
3233
"github.com/m3db/m3/src/dbnode/namespace"
3334
"github.com/m3db/m3/src/dbnode/topology"
@@ -392,9 +393,11 @@ func (c Configuration) NewAdminClient(
392393
encodingOpts = encoding.NewOptions()
393394
}
394395

395-
v = v.SetReaderIteratorAllocate(func(r io.Reader, _ namespace.SchemaDescr) encoding.ReaderIterator {
396-
intOptimized := m3tsz.DefaultIntOptimizationEnabled
397-
return m3tsz.NewReaderIterator(r, intOptimized, encodingOpts)
396+
v = v.SetReaderIteratorAllocate(func(r io.Reader, descr namespace.SchemaDescr) encoding.ReaderIterator {
397+
if c.Proto != nil && c.Proto.Enabled {
398+
return proto.NewIterator(r, descr, encodingOpts)
399+
}
400+
return m3tsz.NewReaderIterator(r, m3tsz.DefaultIntOptimizationEnabled, encodingOpts)
398401
})
399402

400403
if c.Proto != nil && c.Proto.Enabled {

0 commit comments

Comments
 (0)