Skip to content

Commit 5304752

Browse files
Allow viewing of next dataflow-unique identifier (#593)
1 parent 2f32359 commit 5304752

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

timely/src/dataflow/scopes/child.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ where
6767
fn new_identifier(&mut self) -> usize {
6868
self.parent.new_identifier()
6969
}
70+
fn peek_identifier(&self) -> usize {
71+
self.parent.peek_identifier()
72+
}
7073
fn log_register(&self) -> ::std::cell::RefMut<crate::logging_core::Registry<crate::logging::WorkerIdentifier>> {
7174
self.parent.log_register()
7275
}

timely/src/worker.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ pub trait AsWorker : Scheduler {
200200

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

249251
fn new_identifier(&mut self) -> usize { self.new_identifier() }
252+
fn peek_identifier(&self) -> usize { self.peek_identifier() }
250253
fn log_register(&self) -> RefMut<crate::logging_core::Registry<crate::logging::WorkerIdentifier>> {
251254
self.log_register()
252255
}
@@ -526,6 +529,11 @@ impl<A: Allocate> Worker<A> {
526529
*self.identifiers.borrow() - 1
527530
}
528531

532+
/// The next worker-unique identifier to be allocated.
533+
pub fn peek_identifier(&self) -> usize {
534+
*self.identifiers.borrow()
535+
}
536+
529537
/// Access to named loggers.
530538
///
531539
/// # Examples

0 commit comments

Comments
 (0)