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 processors and readers #2088

Merged
merged 1 commit into from
Jul 25, 2016
Merged

Refactor processors and readers #2088

merged 1 commit into from
Jul 25, 2016

Conversation

ruflin
Copy link
Collaborator

@ruflin ruflin commented Jul 25, 2016

  • Rename all processors to readers
  • Rename line struct to Message
  • Remove "reader" from all structs inside reader package

No logic changes are done in this change.

@ruflin ruflin added in progress Pull request is currently in progress. Filebeat Filebeat labels Jul 25, 2016
@ruflin
Copy link
Collaborator Author

ruflin commented Jul 25, 2016

@urso We are currently using a mix of reader and processor. I see processor as a superset of reader, means I plan to rename all readers to processors and group them in one package. Any thoughts?

@urso
Copy link

urso commented Jul 25, 2016

+1 for consistent naming. At some point I intended to all 'LineReader's to be a processor. On the other, we already got processors (generic?) in libbeat.

@ruflin
Copy link
Collaborator Author

ruflin commented Jul 25, 2016

Alternatively we could rename everything to a reader? Looking at the readers / processors we have, reader would also be accurate I think.

@urso
Copy link

urso commented Jul 25, 2016

I think I'd prefer Reader here, to not get confused with libbeat processors.

@ruflin
Copy link
Collaborator Author

ruflin commented Jul 25, 2016

Agree. I will migrate everything to reader. How should be call the struct? Read ?

@ruflin ruflin force-pushed the reader-cleanup branch 2 times, most recently from 7e4ab8f to ecc3726 Compare July 25, 2016 13:29
@ruflin ruflin changed the title Cleanup Reader / Processor Refactor processors and readers Jul 25, 2016
@ruflin ruflin added review and removed in progress Pull request is currently in progress. labels Jul 25, 2016

// Encode reader produces lines by reading lines from an io.Reader
// through a decoder converting the reader it's encoding to utf-8.
type Encode struct {
Copy link

Choose a reason for hiding this comment

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

hm... I think we should name the Decode, Conver or Transform. This reader converts input encoding into utf8

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think Encode is still correct, but we could name it EncodeUTF8 to make it more clear?

Copy link

Choose a reason for hiding this comment

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

nah, rather use Encode or Encoding then EncodeUTF8

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah right, we pass the codec, so it could be anything not only uft-8 if configured differently. In this case I would stick with reader.Encode?

Copy link

Choose a reason for hiding this comment

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

ok, let's still with it then.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We can still renamed it in combination with #2089 if something else becomes obvious.

* Rename all processors to readers
* Rename line struct to Message
* Remove "reader" from all structs inside reader package

No logic changes are done in this change.
@ruflin
Copy link
Collaborator Author

ruflin commented Jul 25, 2016

@urso requested changes pushed.

@urso
Copy link

urso commented Jul 25, 2016

LGTM. waiting for travis.

@urso urso merged commit b3ec2d9 into elastic:master Jul 25, 2016
@ruflin ruflin deleted the reader-cleanup branch July 25, 2016 15:42
tsg pushed a commit to tsg/beats that referenced this pull request Jul 26, 2016
I realized that when rebasing elastic#2091 on top of elastic#2088 a JSON test was
lost. This resurrects it.
ruflin pushed a commit that referenced this pull request Jul 26, 2016
I realized that when rebasing #2091 on top of #2088 a JSON test was
lost. This resurrects it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants