-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Introduce skeleton of memlog store #19261
Conversation
This changes introduces the skeleton and documentation of the memlog store. The addition of the statestore package is split up into multiple changeset to ease review. The final version of the package can be found [here](https://github.com/urso/beats/tree/fb-input-v2-combined/libbeat/statestore). Once finalized, the libbeat/statestore package contains: - The statestore frontend and interface for use within Beats - Interfaces for the store backend - A common set of tests store backends need to support - a storetest package for testing new features that require a store. The testing helpers use map[string]interface{} that can be initialized or queried after the test run for validation purposes. - The default memlog backend + tests This change introduces the skeleton and internal documentation of the memlog store for review and discussion, but not the full implementation yet to ease review. The final implementation and unit tests will be added later. The file doc.go documents how the final implementation works.
Pinging @elastic/integrations-services (Team:Services) |
💔 Tests FailedExpand to view the summary
Build stats
Test stats 🧪
Test errorsExpand to view the tests failures
--------------------- >> end captured stdout << ---------------------- Steps errorsExpand to view the steps failures
Log outputExpand to view the last 100 lines of log output
|
Pinging @elastic/integrations-platforms (Team:Platforms) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice documentation for this!
Co-authored-by: Andrew Kroh <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks excellent! The comments were very helpful. Found some typos and minor suggestions, but nothing that would need another pass, so approved.
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
// Package memlog implements the memlog statestore backend. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to put this content in a README.md instead? That would have the additional benefit that it would be automatically rendered when browsing this package directory on github, which helps discoverability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, interesting point. I have put it here, because I use go docs :)
// The data files filenames do include the change sequence number. Which allows | ||
// us to sort them by name. The checkpoint operation of memlog, writes the full state | ||
// into a new data file, that consists of an JSON array with all known key-value pairs. | ||
// All fields of an entry are store top-level in the object. The `_key` field |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what this sentence ("All fields...") means: it sounds like it's saying the object has a flat structure, but the description above says that map[string]interface{}
can be included, so I think I'm misunderstanding what "entry" is referring to here, could that be clarified?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will try. It's indeed an object that supports nesting (map[string]interface{}
)
Introduce skeleton of memlog store This changes introduces the skeleton and documentation of the memlog store. The addition of the statestore package is split up into multiple changeset to ease review. The final version of the package can be found [here](https://github.com/urso/beats/tree/fb-input-v2-combined/libbeat/statestore). Once finalized, the libbeat/statestore package contains: - The statestore frontend and interface for use within Beats - Interfaces for the store backend - A common set of tests store backends need to support - a storetest package for testing new features that require a store. The testing helpers use map[string]interface{} that can be initialized or queried after the test run for validation purposes. - The default memlog backend + tests This change introduces the skeleton and internal documentation of the memlog store for review and discussion, but not the full implementation yet to ease review. The final implementation and unit tests will be added later. The file doc.go documents how the final implementation works. (cherry picked from commit c0f1b75)
Introduce skeleton of memlog store This changes introduces the skeleton and documentation of the memlog store. The addition of the statestore package is split up into multiple changeset to ease review. The final version of the package can be found [here](https://github.com/urso/beats/tree/fb-input-v2-combined/libbeat/statestore). Once finalized, the libbeat/statestore package contains: - The statestore frontend and interface for use within Beats - Interfaces for the store backend - A common set of tests store backends need to support - a storetest package for testing new features that require a store. The testing helpers use map[string]interface{} that can be initialized or queried after the test run for validation purposes. - The default memlog backend + tests This change introduces the skeleton and internal documentation of the memlog store for review and discussion, but not the full implementation yet to ease review. The final implementation and unit tests will be added later. The file doc.go documents how the final implementation works. (cherry picked from commit c0f1b75)
Introduce skeleton of memlog store This changes introduces the skeleton and documentation of the memlog store. The addition of the statestore package is split up into multiple changeset to ease review. The final version of the package can be found [here](https://github.com/urso/beats/tree/fb-input-v2-combined/libbeat/statestore). Once finalized, the libbeat/statestore package contains: - The statestore frontend and interface for use within Beats - Interfaces for the store backend - A common set of tests store backends need to support - a storetest package for testing new features that require a store. The testing helpers use map[string]interface{} that can be initialized or queried after the test run for validation purposes. - The default memlog backend + tests This change introduces the skeleton and internal documentation of the memlog store for review and discussion, but not the full implementation yet to ease review. The final implementation and unit tests will be added later. The file doc.go documents how the final implementation works.
What does this PR do?
This changes introduces the skeleton and documentation of the memlog
store.
The addition of the statestore package is split up into multiple
changeset to ease review. The final version of the package can be found
here.
Once finalized, the libbeat/statestore package contains:
testing helpers use map[string]interface{} that can be initialized or
queried after the test run for validation purposes.
This change introduces the skeleton and internal documentation of the
memlog store for review and discussion, but not the full implementation
yet to ease review. The final implementation and unit tests will be
added later.
The file doc.go documents how the final implementation works. When reviewing please have a look at this file first to get an idea how the structures fit together.
Why is it important?
The statestore introduces a simple key-value store to Beats. The statestore will be used to replace the registry in filebeat in the future.
Checklist
- [ ] I have made corresponding changes to the documentation- [ ] I have made corresponding change to the default configuration files- [ ] I have added tests that prove my fix is effective or that my feature works- [ ] I have added an entry inCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Author's Checklist
Related issues