Skip to content

Conversation

@Noeda
Copy link

@Noeda Noeda commented Oct 3, 2017

Most important performance improvement in this PR is sharing of cursors in TrailDB.trails() call. Cursors are relatively heavy so this can be a massive improvement in some workloads.

Also cleaned up a whole bunch of documentation and added some sphinx configuration for that.

@CLAassistant
Copy link

CLAassistant commented Oct 3, 2017

CLA assistant check
All committers have signed the CLA.

@Noeda
Copy link
Author

Noeda commented Oct 3, 2017

Travis tests seem broken but tests do complete successfully when I run them locally.


if self.event_filter_obj:
if lib.tdb_cursor_set_event_filter(self.cursor, event_filter_obj.flt):
raise TrailDBError("cursor_set_event_filter failed")
Copy link

Choose a reason for hiding this comment

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

This indentation looks wrong. How is it possible to reach this code immediately after raising an exception? @knutin

Copy link
Author

Choose a reason for hiding this comment

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

It's probably just misindented. I'll pull that indentation back a bit.

if lib.tdb_cursor_set_event_filter(cursor, event_filter_obj.flt):
raise TrailDBError("cursor_set_event_filter failed")
else:
self.event_filter_obj = None
Copy link

Choose a reason for hiding this comment

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

Indentation uses 3 spaces on this line

Copy link
Author

Choose a reason for hiding this comment

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

😱 I shall fix this.

raise TrailDBError("Failed to initalize trail in cursor")

if self.event_filter_obj:
if lib.tdb_cursor_set_event_filter(self.cursor, event_filter_obj.flt):
Copy link

Choose a reason for hiding this comment

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

event_filter_obj should be self.event_filter_obj

Apply a whitelist of the given uuids so that only
events with the given uuids are returned by the
cursor. (Empty trails are still returned for other uuids.)
Applies a whitelist UUIDs to TrailDB so that further calls to

Choose a reason for hiding this comment

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

I think we're missing an of in this sentence

Apply a blacklist of the given uuids so that
only events without the given uuids are returned by the
cursor. (Empty trails are still returned for the given uuids.)
Applies a blacklist UUIDs to TrailDB so that further calls to

Choose a reason for hiding this comment

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

Same here about having an of

The selected_uuids keyword argument can be used to select a subset
of trails to iterate over. Missing uuids are skipped over.
:param selected_uuids: If passed, only go through the UUIDs passed in
this argument. It should be an iterable that yields hex UUIDs.

Choose a reason for hiding this comment

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

Should we add an explicit check of each UUID as we iterate over it? (Or do we check already?) If performance is a concern there, then I guess any bad strings just won't be matched and a trail won't be returned for them. Maybe we need to add a comment that entries that aren't found are silently skipped and no error is raised then?

@derekleverenz
Copy link
Collaborator

Travis is failing to install libarchive-dev apparently

@Noeda Noeda merged commit fcec49d into master Aug 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants