Skip to content

refactor: move take() impl to SeriesBufferGuard#145

Open
KevinWMatthews wants to merge 1 commit intonominal-io:mainfrom
KevinWMatthews:kevin/impl-take-on-series-buffer-guard
Open

refactor: move take() impl to SeriesBufferGuard#145
KevinWMatthews wants to merge 1 commit intonominal-io:mainfrom
KevinWMatthews:kevin/impl-take-on-series-buffer-guard

Conversation

@KevinWMatthews
Copy link
Contributor

This PR moves the bulk of the implementation of take() from SeriesBuffer to SeriesBufferGuard. The intent is to consolidate the responsibility for updating the point count in the SeriesBufferGuard.

Specifically, this ensures that take() can only update count through SeriesBufferGuard.

Comment on lines +642 to +644
let result_count = self
.count
.fetch_update(Ordering::Release, Ordering::Acquire, |_| Some(0))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Write access to the count now must occur through SeriesBufferGuard, as SeriesBuffer is not in scope.

Comment on lines 694 to 696
UNIX_EPOCH.elapsed().unwrap().as_nanos() as u64,
Ordering::Release,
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unlike count, flush_time is not considered in this PR.

The mechanics of how these two values are accessed are a little bit different, and I haven't considered flush_time deeply.

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.

1 participant