diff --git a/src/cmd/tools/read_data_files/main/main.go b/src/cmd/tools/read_data_files/main/main.go index eaab18e5bb..9100f2c1c3 100644 --- a/src/cmd/tools/read_data_files/main/main.go +++ b/src/cmd/tools/read_data_files/main/main.go @@ -136,7 +136,8 @@ func main() { BlockStart: time.Unix(0, *optBlockstart), VolumeIndex: int(*volume), }, - FileSetType: fileSetType, + FileSetType: fileSetType, + StreamingEnabled: true, } err = reader.Open(openOpts) @@ -145,7 +146,7 @@ func main() { } for { - id, _, data, _, err := reader.Read() + entry, err := reader.StreamingRead() if err == io.EOF { break } @@ -153,14 +154,17 @@ func main() { log.Fatalf("err reading metadata: %v", err) } + var ( + id = entry.ID + data = entry.Data + ) + if *idFilter != "" && !strings.Contains(id.String(), *idFilter) { continue } if benchMode != benchmarkSeries { - data.IncRef() - - iter := m3tsz.NewReaderIterator(xio.NewBytesReader64(data.Bytes()), true, encodingOpts) + iter := m3tsz.NewReaderIterator(xio.NewBytesReader64(data), true, encodingOpts) for iter.Next() { dp, _, annotation := iter.Current() if benchMode == benchmarkNone { @@ -179,11 +183,8 @@ func main() { log.Fatalf("unable to iterate original data: %v", err) } iter.Close() - - data.DecRef() } - data.Finalize() seriesCount++ }