Skip to content
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

publicly expose the capability module #512

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion timely/src/dataflow/operators/capability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ use crate::scheduling::Activations;
use crate::dataflow::channels::pullers::counter::ConsumedGuard;

/// An internal trait expressing the capability to send messages with a given timestamp.
pub trait CapabilityTrait<T: Timestamp> {
pub trait CapabilityTrait<T: Timestamp>: private::Sealed {
/// The timestamp associated with the capability.
fn time(&self) -> &T;
/// Checks if this capability is valid for the output port associated with `query_buffer`
fn valid_for_output(&self, query_buffer: &Rc<RefCell<ChangeBatch<T>>>) -> bool;
}

Expand All @@ -53,6 +54,18 @@ impl<'a, T: Timestamp, C: CapabilityTrait<T>> CapabilityTrait<T> for &'a mut C {
}
}

mod private {
use crate::progress::Timestamp;

pub trait Sealed {}

impl<'a, C: Sealed> Sealed for &'a C { }
impl<'a, C: Sealed> Sealed for &'a mut C { }
impl<T: Timestamp> Sealed for super::Capability<T> { }
impl<T: Timestamp> Sealed for super::InputCapability<T> { }
impl<T: Timestamp> Sealed for super::ActivateCapability<T> { }
}

/// The capability to send data with a certain timestamp on a dataflow edge.
///
/// Capabilities are used by timely dataflow's progress tracking machinery to restrict and track
Expand Down
3 changes: 1 addition & 2 deletions timely/src/dataflow/operators/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,5 @@ pub mod generic;
pub mod reclock;
pub mod count;

// keep "mint" module-private
mod capability;
pub mod capability;
pub use self::capability::{ActivateCapability, Capability, InputCapability, CapabilitySet, DowngradeError};