Skip to content

Use proto reader iterator when proto enabled#2375

Open
justinjc wants to merge 2 commits intomasterfrom
juchan/proto-iter
Open

Use proto reader iterator when proto enabled#2375
justinjc wants to merge 2 commits intomasterfrom
juchan/proto-iter

Conversation

@justinjc
Copy link
Copy Markdown
Collaborator

What this PR does / why we need it:

Use the proto encoding.ReaderIterator when proto is enabled.

Special notes for your reviewer: N/A

Does this PR introduce a user-facing and/or backwards incompatible change?:

NONE

Does this PR require updating code package or user-facing documentation?:

NONE

@justinjc justinjc force-pushed the juchan/proto-iter branch from aae7669 to d1fe6aa Compare June 2, 2020 23:12
Comment thread src/dbnode/client/config.go Outdated
intOptimized := m3tsz.DefaultIntOptimizationEnabled
return m3tsz.NewReaderIterator(r, intOptimized, encodingOpts)
v = v.SetReaderIteratorAllocate(func(r io.Reader, descr namespace.SchemaDescr) encoding.ReaderIterator {
if c.Proto != nil && c.Proto.Enabled {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm instead of this if/else here, can you just entirely override with:

v = v.SetReaderIteratorAllocate(func(r io.Reader, descr namespace.SchemaDescr) encoding.ReaderIterator {
  return proto.NewIterator(r, descr, encodingOpts)
})

From within the block below?

if c.Proto != nil && c.Proto.Enabled {
  v = v.SetXyz(...)
 // ..
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

})

if c.Proto != nil && c.Proto.Enabled {
v = v.SetReaderIteratorAllocate(func(r io.Reader, descr namespace.SchemaDescr) encoding.ReaderIterator {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed in chat--let's add a unittest for this and then I'm good.

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 11, 2023

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.7%. Comparing base (fb31c2e) to head (213630d).
⚠️ Report is 1435 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #2375     +/-   ##
========================================
- Coverage    71.7%   71.7%   -0.1%     
========================================
  Files        1051    1051             
  Lines       92476   92479      +3     
========================================
- Hits        66383   66381      -2     
- Misses      21655   21658      +3     
- Partials     4438    4440      +2     
Flag Coverage Δ
aggregator 76.4% <ø> (ø)
cluster 84.8% <ø> (ø)
collector 82.8% <ø> (ø)
dbnode 79.1% <0.0%> (-0.1%) ⬇️
m3em 74.4% <ø> (ø)
m3ninx 73.1% <ø> (+<0.1%) ⬆️
m3nsch 51.1% <ø> (ø)
metrics 17.3% <ø> (ø)
msg 75.1% <ø> (ø)
query 68.5% <ø> (ø)
x 81.9% <ø> (+0.1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fb31c2e...213630d. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants