-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* make file sink parts declare their type Instead of dealing with bundles of Vec<u8> each file sink and client will be paired over any type that can be turned into bytes. * ingest: type all FileSinkClients * boost_manager: type all FileSinkClients * iot_packet_verifier: type all FileSinkClients * mobile_packet_verifier: type all FileSinkClients * price: type all FileSinkClients * poc_entropy: type all FileSinkClients * iot_verifier: type all FileSinkClients * mobile_verifier: type all FileSinkClients * Rename trait FileStoreAsBytes -> MsgBytes to follow convention for prost traits To keep from dealing with Vec<u8> and String auto implementations for prost::Message that disallows using a file sync with anything but a prost::Message. We're going to follow the other Msg* trait conventions where we implement them only for the types we are using. This allows someone to make a file sync for whatever type they may have, and convenience for proto types we write reports about. * create file sinks directly from the message * rename file sink trait to writer The abstraction comes in two parts. The first we can get a file sink from a type if it implements the FileSinkWrite trait. The second is a type being able to be written to a file sink if it can be turned into bytes. This separates the convenience from the actual functionality. * file sink metric from static str to String this allows us to attach the metric name to the file type implementation, and only have to pass in the calling crate for the prefix. FileSinks are really only created once, and there are not so many of them that owning a string introduces a crazy amount of overhead. * ingest iot/mobile servers to use convenience file_sink method * iot_verifier to use file_sink convenience method * boost manager to use file_sink convenience method * mobile packet verifier use file_sink convenience methods * mobile_verifier to use file_sink convenience methods * poc_entropy to use file_sink convenience method * price to use file_sink convenience method * move MsgBytes trait back out of FileSinkWrite The FileSinkWrite trait is a convenience method for creating file sinks, but it should not be tied to being able to use a file sink. The only requirement for that is being able to turn your message into bytes. * autocommit=false is already the default * msg is no longer bytes in test * stick with single style of reference * combine auto_commit and roll_time into 1 argument This is a specialized helper function, every crate using it was only using these two options. We can provide the base functionality with a single option. Ideally the Builder would be updated to take some sort of enum for the commit type as it doesn't make a lot of sense to auto_commit on every write _and_ roll the file at a certain interval. * fixup after rebase * fixup after rebase - include new verified mapper code - update deps - fix botched rebase conflicts * uncouple FileSinkWriteExt from FileType enum Taking a static string allows FileSinkWriteExt to be implemented by users outside the oracles codebase, and starts the journey of moving away from the FileType enum.
- Loading branch information
1 parent
0cced21
commit ca12bb6
Showing
54 changed files
with
820 additions
and
586 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.