-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
VAULT-14733: SegmentReader interface for reading activity log segments #19934
Conversation
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 work! Some minor comments, otherwise looks very good!
|
||
// writeSegment writes a single segment file with the given time and index | ||
// the correct path is inferred from the datatype of `item` | ||
func writeSegment(t *testing.T, core *Core, ts time.Time, index int, item proto.Message) { |
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 you think instead of having a generic function in which we would need to add logic to distinguish which item type we are dealing with, having two functions writeTokenSegment
and writeEntitySegment
would be more readable? This way, we could also remove the makeSegmentPath
function as well, as that could be reduced to just a fmt.Sprintf
call.
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 good!
#19934) * create a segment reader for activity log segment * fix imports * updates based on comments
#19934) * create a segment reader for activity log segment * fix imports * updates based on comments
… log segments into release/1.11.x (#20016) * VAULT-14733: SegmentReader interface for reading activity log segments (#19934) * create a segment reader for activity log segment * fix imports * updates based on comments * format * add missing import --------- Co-authored-by: miagilepner <mia.epner@hashicorp.com>
This PR adds a SegmentReader interface and an implementation to read segment files from storage for use in the activity log.
This makes it easier to allow new inputs (such as mock data) to the precomputed query worker.