public final class ZKMessages extends Object
Modifier and Type | Method and Description |
---|---|
static <V> void |
sendMessage(ZKClient zkClient,
String messagePathPrefix,
org.apache.twill.internal.state.Message message,
com.google.common.util.concurrent.SettableFuture<V> completion,
V completionResult)
Creates a message node in zookeeper.
|
static <V> com.google.common.util.concurrent.ListenableFuture<V> |
sendMessage(ZKClient zkClient,
String messagePathPrefix,
org.apache.twill.internal.state.Message message,
V completionResult)
Creates a message node in zookeeper.
|
public static <V> com.google.common.util.concurrent.ListenableFuture<V> sendMessage(ZKClient zkClient, String messagePathPrefix, org.apache.twill.internal.state.Message message, V completionResult)
V
- Type of the completion result.zkClient
- The ZooKeeper client for interacting with ZooKeeper.messagePathPrefix
- ZooKeeper path prefix for the message node.message
- The Message
object for the content of the message node.completionResult
- Object to set to the result future when the message is processed.ListenableFuture
that will be completed when the message is consumed, which indicated
by deletion of the node. If there is exception during the process, it will be reflected
to the future returned.public static <V> void sendMessage(ZKClient zkClient, String messagePathPrefix, org.apache.twill.internal.state.Message message, com.google.common.util.concurrent.SettableFuture<V> completion, V completionResult)
V
- Type of the completion result.zkClient
- The ZooKeeper client for interacting with ZooKeeper.messagePathPrefix
- ZooKeeper path prefix for the message node.message
- The Message
object for the content of the message node.completion
- A SettableFuture
to reflect the result of message process completion.completionResult
- Object to set to the result future when the message is processed.Copyright © 2013-2020 The Apache Software Foundation. All rights reserved.