public interface StreamCoordinatorClient
extends com.google.common.util.concurrent.Service
| Modifier and Type | Method and Description |
|---|---|
Cancellable |
addListener(Id.Stream streamId,
StreamPropertyListener listener)
Receives event for changes in stream properties.
|
StreamConfig |
createStream(Id.Stream streamId,
Callable<StreamConfig> action)
Creates a stream by performing the given action.
|
void |
deleteStream(Id.Stream streamId,
Runnable action)
Deletes a stream by performing the given action.
|
<T> T |
exclusiveAction(Id.Stream streamId,
Callable<T> action)
Performs an action on a stream while holding the lock for the stream.
|
void |
updateProperties(Id.Stream streamId,
Callable<CoordinatorStreamProperties> action)
Updates the stream properties by performing the given action.
|
Cancellable addListener(Id.Stream streamId, StreamPropertyListener listener)
streamId - name of the streamlistener - listener to get called when there is change in stream properties.Cancellable to cancel the watch@Nullable StreamConfig createStream(Id.Stream streamId, Callable<StreamConfig> action) throws Exception
streamId - name of the streamaction - action to perform. If a new stream is created, it should returns a StreamConfig representing
the configuration of the new stream; otherwise null should be returned.StreamConfig as returned by the actionException - if the action throws Exceptionvoid updateProperties(Id.Stream streamId, Callable<CoordinatorStreamProperties> action) throws Exception
streamId - name of the streamaction - action to perform. It should returns a CoordinatorStreamProperties containing information
about the update properties.Exception - if failed to update propertiesvoid deleteStream(Id.Stream streamId, Runnable action) throws Exception
streamId - name of the streamaction - action to perform.Exception - if the action throws ExceptionCopyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.