forked from Velocidex/velociraptor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Large refactor to use a path manager (Velocidex#331)
In the process of adding support to the mysql data store it is becoming clear that in order to utilize the best intrinsic features of each data store technology we can not rely on a pure filesystem like abstraction. It is useful to hint to different implementations the likely access pattern so better optimizations can be undertaken. Previously the layout of the different objects stored in the filestore was hard coded throughout the code in various path construction statements. This change introduces a path manager - an object responsible for mapping a particular entity into the filestore. The path manager is the perfect way we can hint to the data store how to treat different objects. For example, the FlowPathManager is responsible for store various flow related items. Therefore we can use it to build paths like flow_path_manager.Log() for the result set storing flow logs, etc. A path manager is responsible for accessing a result set in the filestore (similar to a path but smarter). In the future all file store operations will be made using path managers. The filestore is now also responsible for storing and reading result set (i.e. rows) as well as just bulk files. This makes it easier for other code to use because we dont need to csv serialization/deserialization by hand now. Filestore's interface is: * PushRows() -> pushes rows into the result set specified by the path manager. We dont actually care exactly where they are stored. * GetTimeRange() -> Gets those rows that were inserted in the time range specified (or all times) Therefore callers do not need to worry about managing the data themselves - and the specific datastore can now use e.g. timestamp indexes to read data more efficiently. Queuing is also moved to the file store: * Watch() -> registers interest in a queue name (usually an artifact name) and watches for new events. Filestores may implement any message passing technique to make it work. Directory based file store is designed to work in a single process. Therefore for directory based file store we use internal thread based notification mechanism (extremely low latency). This is a somewhat breaking change is that some of the layout of objects in the file store has changed. Velociraptor now uses line delimited json internally instead of CSV although we try to read csv files as a fallback for backward compatibility. If you upgrade you might need to reset the file store.
- Loading branch information
Showing
85 changed files
with
2,700 additions
and
1,680 deletions.
There are no files selected for viewing
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.