Package io.pravega.client.admin
Interface ReaderGroupManager
-
- All Superinterfaces:
java.lang.AutoCloseable
- All Known Implementing Classes:
ReaderGroupManagerImpl
public interface ReaderGroupManager extends java.lang.AutoCloseable
Used to create and manage reader groups.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Close this manager class.boolean
createReaderGroup(java.lang.String groupName, ReaderGroupConfig config)
Creates a new ReaderGroup.void
deleteReaderGroup(java.lang.String groupName)
Deletes a reader group, removing any state associated with it.ReaderGroup
getReaderGroup(java.lang.String groupName)
Returns the requested reader group.static ReaderGroupManager
withScope(java.lang.String scope, ClientConfig clientConfig)
Creates a new instance of ReaderGroupManager.static ReaderGroupManager
withScope(java.lang.String scope, java.net.URI controllerUri)
Creates a new instance of ReaderGroupManager.
-
-
-
Method Detail
-
withScope
static ReaderGroupManager withScope(java.lang.String scope, java.net.URI controllerUri)
Creates a new instance of ReaderGroupManager.- Parameters:
scope
- The Scope string.controllerUri
- The Controller URI.- Returns:
- Instance of Stream Manager implementation.
-
withScope
static ReaderGroupManager withScope(java.lang.String scope, ClientConfig clientConfig)
Creates a new instance of ReaderGroupManager.- Parameters:
scope
- The Scope string.clientConfig
- Configuration for the client.- Returns:
- Instance of Stream Manager implementation.
-
createReaderGroup
boolean createReaderGroup(java.lang.String groupName, ReaderGroupConfig config) throws ConfigMismatchException
Creates a new ReaderGroup. Readers will be able to join the group by callingEventStreamClientFactory.createReader(String, String, Serializer, ReaderConfig)
. Once this is done they will start receiving events from the point defined in the config passed here.Note: This method is idempotent assuming called with the same name and config. This method may block.
- Parameters:
groupName
- The name of the group to be created.config
- The configuration for the new ReaderGroup.- Returns:
- True if ReaderGroup was created.
- Throws:
ConfigMismatchException
- If the reader group already exists with a different configuration. UseReaderGroup.resetReaderGroup(io.pravega.client.stream.ReaderGroupConfig)
to change the reader group configuration.
-
deleteReaderGroup
void deleteReaderGroup(java.lang.String groupName)
Deletes a reader group, removing any state associated with it. There should be no reader left on the group when this is called. If there are any, the group will be deleted from underneath them and they will encounter exceptions.- Parameters:
groupName
- The group to be deleted.
-
getReaderGroup
ReaderGroup getReaderGroup(java.lang.String groupName) throws ReaderGroupNotFoundException
Returns the requested reader group.- Parameters:
groupName
- The name of the group- Returns:
- Reader group with the given name
- Throws:
ReaderGroupNotFoundException
- If the reader group does not exist.
-
close
void close()
Close this manager class. This will close any connections created through it.- Specified by:
close
in interfacejava.lang.AutoCloseable
- See Also:
AutoCloseable.close()
-
-