Struct strymon_job::Coordinator
[−]
[src]
pub struct Coordinator { /* fields omitted */ }
Handle to communicate with the Strymon coordinator.
The methods of this object can be used to publish or subscribe to
topics available in the catalog. In order to obtain a Coordinator
instance,
users must register the current process with strymon_job::execute
.
Methods
impl Coordinator
[src]
pub fn publish<S, D>(
&self,
name: &str,
stream: &Stream<S, D>,
partition: Partition
) -> Result<Stream<S, D>, PublicationError> where
D: ExchangeData + Serialize + TypeName,
S: Scope,
S::Timestamp: RemoteTimestamp,
<S::Timestamp as RemoteTimestamp>::Remote: TypeName,
[src]
&self,
name: &str,
stream: &Stream<S, D>,
partition: Partition
) -> Result<Stream<S, D>, PublicationError> where
D: ExchangeData + Serialize + TypeName,
S: Scope,
S::Timestamp: RemoteTimestamp,
<S::Timestamp as RemoteTimestamp>::Remote: TypeName,
Publishes a local stream and creates a topic in the catalog.
This will block the current worker until the coordinator has processed the publication request.
Each published stream must have a globally unique name, which used to
create a topic in the catalog. This method injects a publisher operator
into the Timely dataflow which forwards all data and progress messages
put into stream
. The created topic is deregistered when the frontier
of the input stream becomes empty. Upon deregisteration, the current
worker is blocked until the queues of any still connected subscribers
are drained.
If the Partition::Merge
strategy is used, a single topic is created
whose name is specified in name
. If a Partition::PerWorker
partitioning
scheme is used, one topic is created for each worker, with the worker's
index appended, e.g. foobar.1
.
impl Coordinator
[src]
pub fn subscribe<T, D>(
&self,
name: &str,
blocking: bool
) -> Result<Subscription<T, D>, SubscriptionError> where
T: RemoteTimestamp,
D: DeserializeOwned + TypeName,
T::Remote: TypeName,
[src]
&self,
name: &str,
blocking: bool
) -> Result<Subscription<T, D>, SubscriptionError> where
T: RemoteTimestamp,
D: DeserializeOwned + TypeName,
T::Remote: TypeName,
Creates a new subscription for a single topic.
This method requests a subscription for a topic called name
from
the coordinator. The requested topic must be published with the same
data and timestamp types T
and D
respectively.
In to obtain progress tracking information from the upstream
Timely computation(s), the subscription handle exposes a frontier()
method which allows inspection of the current frontier.
When blocking
is true, this call blocks until a remote publisher
creates a topic with a suitable name. If blocking
is false, the call
returns with an error if the catalog does not contain a topic with a
matching name.
pub fn subscribe_group<T, D, I>(
&self,
prefix: &str,
partitions: I,
blocking: bool
) -> Result<Subscription<T, D>, SubscriptionError> where
T: RemoteTimestamp,
D: DeserializeOwned + TypeName,
T::Remote: TypeName,
I: IntoIterator<Item = usize>,
[src]
&self,
prefix: &str,
partitions: I,
blocking: bool
) -> Result<Subscription<T, D>, SubscriptionError> where
T: RemoteTimestamp,
D: DeserializeOwned + TypeName,
T::Remote: TypeName,
I: IntoIterator<Item = usize>,
Create a new subscription for a partitioned topic.
This method requests a subscription for each provided partition and
merges their stream. The partition number is attached to each topic name,
e.g. for prefix = "foo"
and partitions = [0, 2, 5]
, the resulting
subscriptions are for "foo.0", "foo.2", "foo.5"
.
See the subscribe
method for more details.
impl Coordinator
[src]
pub fn announce_service<N: Name + TypeName>(
&self,
name: &str
) -> Result<Service<N>, PublicationError>
[src]
&self,
name: &str
) -> Result<Service<N>, PublicationError>
Creates a new request service and announces it in the catalog.
Given a service interface definition and a name, creates a new server for receiving incoming requests. A topic is created under the specified name which is used by clients to bind to the service.
pub fn bind_service<N: Name + TypeName>(
&self,
name: &str,
blocking: bool
) -> Result<Client<N>, SubscriptionError>
[src]
&self,
name: &str,
blocking: bool
) -> Result<Client<N>, SubscriptionError>
Creates a binding to a service topic for sending requests.
Returns a handle for submitting requests to the given server. The
binding created by this invocation is also stored in the catalog as
a Subscription
. The subscription is revoked once the Client
handle
is dropped.
When blocking
is true, this call blocks until a remote job registers
a service with the matching name. If blocking
is false, the call
returns with an error if the topic does not exist.
Trait Implementations
impl Clone for Coordinator
[src]
fn clone(&self) -> Coordinator
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more