Package io.pravega.client.admin
Interface StreamManager
- 
- All Superinterfaces:
- java.lang.AutoCloseable
 
 public interface StreamManager extends java.lang.AutoCloseableUsed to create, delete, and manage Streams and ReaderGroups.
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancheckScopeExists(java.lang.String scopeName)Checks if a scope exists.booleancheckStreamExists(java.lang.String scopeName, java.lang.String streamName)Checks if a stream exists in scope.voidclose()Closes the stream manager.static StreamManagercreate(ClientConfig clientConfig)Creates a new instance of StreamManager.static StreamManagercreate(java.net.URI controller)Creates a new instance of StreamManager.booleancreateScope(java.lang.String scopeName)Creates a new scope.booleancreateStream(java.lang.String scopeName, java.lang.String streamName, StreamConfiguration config)Creates a new streambooleandeleteScope(java.lang.String scopeName)Deletes an existing scope.booleandeleteScope(java.lang.String scopeName, boolean deleteStreams)Deletes scope by listing and deleting all streams in scope.booleandeleteStream(java.lang.String scopeName, java.lang.String toDelete)Deletes the provided stream.StreamInfogetStreamInfo(java.lang.String scopeName, java.lang.String streamName)Get information about a given Stream,StreamInfo.java.util.Iterator<java.lang.String>listScopes()Gets an iterator for all scopes.java.util.Iterator<Stream>listStreams(java.lang.String scopeName)Gets an iterator for all streams in scope.booleansealStream(java.lang.String scopeName, java.lang.String streamName)Seal an existing stream.booleantruncateStream(java.lang.String scopeName, java.lang.String streamName, StreamCut streamCut)Truncate stream at given stream cut.booleanupdateStream(java.lang.String scopeName, java.lang.String streamName, StreamConfiguration config)Change the configuration for an existing stream.
 
- 
- 
- 
Method Detail- 
createstatic StreamManager create(java.net.URI controller) Creates a new instance of StreamManager.- Parameters:
- controller- The Controller URI.
- Returns:
- Instance of Stream Manager implementation.
 
 - 
createstatic StreamManager create(ClientConfig clientConfig) Creates a new instance of StreamManager.- Parameters:
- clientConfig- Configuration for the client connection to Pravega.
- Returns:
- Instance of Stream Manager implementation.
 
 - 
createStreamboolean createStream(java.lang.String scopeName, java.lang.String streamName, StreamConfiguration config)Creates a new streamNote: This method is idempotent assuming called with the same name and config. This method may block. - Parameters:
- scopeName- The name of the scope to create this stream in.
- streamName- The name of the stream to be created.
- config- The configuration the stream should use.
- Returns:
- True if stream is created
 
 - 
updateStreamboolean updateStream(java.lang.String scopeName, java.lang.String streamName, StreamConfiguration config)Change the configuration for an existing stream.Note: This method is idempotent assuming called with the same name and config. This method may block. - Parameters:
- scopeName- The name of the scope to create this stream in.
- streamName- The name of the stream who's config is to be changed.
- config- The new configuration.
- Returns:
- True if stream configuration is updated
 
 - 
truncateStreamboolean truncateStream(java.lang.String scopeName, java.lang.String streamName, StreamCut streamCut)Truncate stream at given stream cut. This method may block.- Parameters:
- scopeName- The name of the scope to create this stream in.
- streamName- The name of the stream who's config is to be changed.
- streamCut- The stream cut to truncate at.
- Returns:
- True if stream is truncated at given truncation stream cut.
 
 - 
sealStreamboolean sealStream(java.lang.String scopeName, java.lang.String streamName)Seal an existing stream.- Parameters:
- scopeName- The name of the scope to create this stream in.
- streamName- The name of the stream which has to be sealed.
- Returns:
- True if stream is sealed
 
 - 
deleteStreamboolean deleteStream(java.lang.String scopeName, java.lang.String toDelete)Deletes the provided stream. No more events may be written or read. Resources used by the stream will be freed.- Parameters:
- scopeName- The name of the scope to create this stream in.
- toDelete- The name of the stream to be deleted.
- Returns:
- True if stream is deleted
 
 - 
listScopesjava.util.Iterator<java.lang.String> listScopes() Gets an iterator for all scopes.- Returns:
- Iterator to iterate over all scopes.
 
 - 
createScopeboolean createScope(java.lang.String scopeName) Creates a new scope.- Parameters:
- scopeName- The name of the scope to create this stream in.
- Returns:
- True if scope is created
 
 - 
checkScopeExistsboolean checkScopeExists(java.lang.String scopeName) Checks if a scope exists.- Parameters:
- scopeName- The name of the scope to check.
- Returns:
- True if scope exists.
 
 - 
listStreamsjava.util.Iterator<Stream> listStreams(java.lang.String scopeName) Gets an iterator for all streams in scope.- Parameters:
- scopeName- The name of the scope for which to list streams in.
- Returns:
- Iterator of Stream to iterator over all streams in scope.
 
 - 
checkStreamExistsboolean checkStreamExists(java.lang.String scopeName, java.lang.String streamName)Checks if a stream exists in scope.- Parameters:
- scopeName- The name of the scope to check the stream in.
- streamName- The name of the stream to check.
- Returns:
- True if stream exists.
 
 - 
deleteScopeboolean deleteScope(java.lang.String scopeName) Deletes an existing scope. The scope must contain no stream. This is same as callingdeleteScope(String, boolean)with deleteStreams flag set to false.- Parameters:
- scopeName- The name of the scope to delete.
- Returns:
- True if scope is deleted
 
 - 
deleteScopeboolean deleteScope(java.lang.String scopeName, boolean deleteStreams) throws DeleteScopeFailedExceptionDeletes scope by listing and deleting all streams in scope. This method is not atomic and if new streams are added to the scope concurrently, the attempt to delete the scope may fail. Deleting scope is idempotent and failure to delete scope is retry-able.- Parameters:
- scopeName- The name of the scope to delete.
- deleteStreams- To list and delete streams in scope before attempting to delete scope.
- Returns:
- True if scope is deleted, false otherwise.
- Throws:
- DeleteScopeFailedException- is thrown if this method is unable to seal and delete a stream.
 
 - 
getStreamInfo@Beta StreamInfo getStreamInfo(java.lang.String scopeName, java.lang.String streamName) Get information about a given Stream,StreamInfo. This includesStreamCuts pointing to the current HEAD and TAIL of the Stream.- Parameters:
- scopeName- The scope of the stream.
- streamName- The stream name.
- Returns:
- stream information.
 
 - 
closevoid close() Closes the stream manager.- Specified by:
- closein interface- java.lang.AutoCloseable
- See Also:
- AutoCloseable.close()
 
 
- 
 
-