Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(http): Extract write handler logic for re-use elsewhere #18507

Merged
merged 7 commits into from
Jun 17, 2020

Conversation

brettbuddin
Copy link
Contributor

@brettbuddin brettbuddin commented Jun 15, 2020

This is the first PR in a 3-part story to deliver an API for 1.x writes.

This shuffles the structure of the existing /api/v2/write endpoint to allow the /write (1.x) endpoint to share the point parse and writing code. Code that was originally placed directly in the main HTTP handler has been moved out into other supporting structures for re-use.

📎 influxdata/idpe#6948

Copy link
Contributor

@stuartcarnie stuartcarnie left a comment

Choose a reason for hiding this comment

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

Really great improvements to overall code structure in the PR. I had a single question regarding the LimitedReadCloser, and I recognize the behavior is the same, as you've just shuffled code around.

Free to merge if that question is of no concern.

Comment on lines +212 to +211
WithParserOptions(
models.WithParserMaxBytes(b.WriteParserMaxBytes),
models.WithParserMaxLines(b.WriteParserMaxLines),
models.WithParserMaxValues(b.WriteParserMaxValues),
),
Copy link
Contributor

Choose a reason for hiding this comment

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

👏

kit/io/limited_read_closer.go Show resolved Hide resolved
@brettbuddin brettbuddin force-pushed the bb/extract-write-logic branch from c4ce13a to cb8d38d Compare June 16, 2020 22:03
@brettbuddin brettbuddin force-pushed the bb/extract-write-logic branch from cb8d38d to e1f063c Compare June 17, 2020 17:14
@brettbuddin brettbuddin merged commit 954939f into master Jun 17, 2020
@brettbuddin brettbuddin deleted the bb/extract-write-logic branch June 17, 2020 19:22
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.

2 participants