Skip to content

Commit

Permalink
Allow viewing of next dataflow-unique identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
frankmcsherry committed Oct 16, 2024
1 parent 8388802 commit 0d453df
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions timely/src/dataflow/scopes/child.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ where
fn new_identifier(&mut self) -> usize {
self.parent.new_identifier()
}
fn peek_identifier(&self) -> usize {
self.parent.peek_identifier()
}
fn log_register(&self) -> ::std::cell::RefMut<crate::logging_core::Registry<crate::logging::WorkerIdentifier>> {
self.parent.log_register()
}
Expand Down
8 changes: 8 additions & 0 deletions timely/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ pub trait AsWorker : Scheduler {

/// Allocates a new worker-unique identifier.
fn new_identifier(&mut self) -> usize;
/// The next worker-unique identifier to be allocated.
fn peek_identifier(&self) -> usize;
/// Provides access to named logging streams.
fn log_register(&self) -> ::std::cell::RefMut<crate::logging_core::Registry<crate::logging::WorkerIdentifier>>;
/// Provides access to the timely logging stream.
Expand Down Expand Up @@ -247,6 +249,7 @@ impl<A: Allocate> AsWorker for Worker<A> {
}

fn new_identifier(&mut self) -> usize { self.new_identifier() }
fn peek_identifier(&self) -> usize { self.peek_identifier() }
fn log_register(&self) -> RefMut<crate::logging_core::Registry<crate::logging::WorkerIdentifier>> {
self.log_register()
}
Expand Down Expand Up @@ -526,6 +529,11 @@ impl<A: Allocate> Worker<A> {
*self.identifiers.borrow() - 1
}

/// The next worker-unique identifier to be allocated.
pub fn peek_identifier(&self) -> usize {
*self.identifiers.borrow()
}

/// Access to named loggers.
///
/// # Examples
Expand Down

0 comments on commit 0d453df

Please sign in to comment.