Package s2.client
Class BasinClient
java.lang.Object
s2.client.BaseClient
s2.client.BasinClient
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
StreamClient
Client for basin-level operations.
-
Constructor Summary
ConstructorsConstructorDescriptionBasinClient
(String basin, Config config, io.grpc.ManagedChannel channel, ScheduledExecutorService executor) Instantiates a new Basin client.BasinClient
(String basin, Config config, ScheduledExecutorService executor) Instantiates a new Basin client. -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.util.concurrent.ListenableFuture<StreamInfo>
createStream
(CreateStreamRequest createStreamRequest) Create a new stream within this basin.com.google.common.util.concurrent.ListenableFuture<Void>
deleteStream
(String streamName) Delete a stream.com.google.common.util.concurrent.ListenableFuture<StreamConfig>
getStreamConfig
(String streamName) Get current config of a stream.com.google.common.util.concurrent.ListenableFuture<Paginated<StreamInfo>>
listStreams
(ListStreamsRequest listStreamsRequest) List streams within the basin.com.google.common.util.concurrent.ListenableFuture<StreamConfig>
reconfigureStream
(ReconfigureStreamRequest reconfigureStreamRequest) Reconfigure an existing stream.streamClient
(String streamName) Create a StreamClient for interacting with stream-level RPCs.Methods inherited from class s2.client.BaseClient
close
-
Constructor Details
-
BasinClient
Instantiates a new Basin client.Most users will prefer to use the
Client.basinClient(String)
method for construction.- Parameters:
basin
- the basinconfig
- the configexecutor
- the executor- See Also:
-
BasinClient
public BasinClient(String basin, Config config, io.grpc.ManagedChannel channel, ScheduledExecutorService executor) Instantiates a new Basin client.Most users will prefer to use the
Client.basinClient(String)
method for construction.- Parameters:
basin
- the basinconfig
- the configchannel
- the channelexecutor
- the executor- See Also:
-
-
Method Details
-
listStreams
public com.google.common.util.concurrent.ListenableFuture<Paginated<StreamInfo>> listStreams(ListStreamsRequest listStreamsRequest) List streams within the basin.- Parameters:
listStreamsRequest
- the list streams request- Returns:
- future of a paginated list of stream infos
-
createStream
public com.google.common.util.concurrent.ListenableFuture<StreamInfo> createStream(CreateStreamRequest createStreamRequest) Create a new stream within this basin.- Parameters:
createStreamRequest
- the create stream request- Returns:
- future of the resulting stream info
-
deleteStream
Delete a stream.Stream deletion is asynchronous, and may take a few minutes to complete.
- Parameters:
streamName
- the stream name- Returns:
- future representing the completion of this action
-
getStreamConfig
public com.google.common.util.concurrent.ListenableFuture<StreamConfig> getStreamConfig(String streamName) Get current config of a stream.- Parameters:
streamName
- the stream name- Returns:
- future of the stream config
-
reconfigureStream
public com.google.common.util.concurrent.ListenableFuture<StreamConfig> reconfigureStream(ReconfigureStreamRequest reconfigureStreamRequest) Reconfigure an existing stream.- Parameters:
reconfigureStreamRequest
- the reconfigure stream request- Returns:
- future of the resulting stream config
-
streamClient
Create a StreamClient for interacting with stream-level RPCs.- Parameters:
streamName
- the stream name- Returns:
- the stream client
-