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

Unify event, data and state handling in filebeat #4171

Merged
merged 1 commit into from
May 2, 2017

Conversation

ruflin
Copy link
Contributor

@ruflin ruflin commented May 2, 2017

The data and event handling has grown over time in filebeat. One the one hand meta data and event data was mixed and different structure to handle the data existed. The structures which existed were focused in the log prospector. This change brings a unified data handling with a data object which separates event, meta data and state. This new model should allow to add new prospector types and use the same data objects.

The reason it ended up in util package is because data is taken by the data folder and common would lead to too many conflicts with common package in libbeat.

@ruflin ruflin added Filebeat Filebeat refactoring review in progress Pull request is currently in progress. labels May 2, 2017
@ruflin
Copy link
Contributor Author

ruflin commented May 2, 2017

jenkins, retest it

@ruflin ruflin removed the in progress Pull request is currently in progress. label May 2, 2017
The data and event handling has grown over time in filebeat. One the one hand meta data and event data was mixed and different structure to handle the data existed. The structures which existed were focused in the log prospector. This change brings a unified data handling with a data object which separates event, meta data and state. This new model should allow to add new prospector types and use the same data objects.

The reason it ended up in `util` package is because `data` is taken by the data folder and `common` would lead to too many conflicts with `common` package in libbeat.
@@ -42,7 +42,7 @@ func (o *Outlet) SetSignal(signal <-chan struct{}) {
o.signal = signal
}

func (o *Outlet) OnEvent(event *input.Data) bool {
func (o *Outlet) OnEvent(data *util.Data) bool {
Copy link
Collaborator

Choose a reason for hiding this comment

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

[golint] reported by reviewdog 🐶
exported method Outlet.OnEvent should have comment or be unexported

"github.com/elastic/beats/libbeat/common"
)

type Data struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

[golint] reported by reviewdog 🐶
exported type Data should have comment or be unexported

Meta Meta
}

type Meta struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

[golint] reported by reviewdog 🐶
exported type Meta should have comment or be unexported

Module string
}

func NewData() *Data {
Copy link
Collaborator

Choose a reason for hiding this comment

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

[golint] reported by reviewdog 🐶
exported function NewData should have comment or be unexported

@7AC 7AC merged commit 4fddfd4 into elastic:master May 2, 2017
@ruflin ruflin mentioned this pull request May 10, 2017
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants