public class InMemoryStreamAdmin extends InMemoryQueueAdmin implements StreamAdmin
queueService| Constructor and Description |
|---|
InMemoryStreamAdmin(InMemoryQueueService queueService,
UsageRegistry usageRegistry,
LineageWriter lineageWriter,
StreamMetaStore streamMetaStore,
MetadataStore metadataStore,
ViewAdmin viewAdmin) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAccess(Id.Run run,
Id.Stream streamId,
AccessType accessType)
Record access of stream by a program run for lineage computation.
|
void |
configureGroups(Id.Stream streamId,
Map<Long,Integer> groupInfo)
Sets the consumer groups information for the given stream.
|
void |
configureInstances(Id.Stream streamId,
long groupId,
int instances)
Sets the number of consumer instances for the given consumer group in a stream.
|
StreamConfig |
create(Id.Stream streamId)
Creates stream if doesn't exist.
|
StreamConfig |
create(Id.Stream streamId,
Properties props)
Creates stream if doesn't exist.
|
boolean |
createOrUpdateView(Id.Stream.View viewId,
ViewSpecification spec)
Creates or updates a stream view.
|
void |
deleteView(Id.Stream.View viewId)
Deletes a stream view.
|
void |
drop(Id.Stream streamId)
Deletes stream from the system completely.
|
void |
dropAllInNamespace(Id.Namespace namespace)
Deletes all queues in a namespace
|
boolean |
exists(Id.Stream streamId) |
StreamConfig |
getConfig(Id.Stream streamId)
Returns the configuration of the given stream.
|
ViewSpecification |
getView(Id.Stream.View viewId)
Gets the details of a stream view.
|
List<Id.Stream.View> |
listViews(Id.Stream streamId)
Lists views associated with a stream.
|
void |
register(Iterable<? extends Id> owners,
Id.Stream streamId)
Register stream used by program.
|
void |
truncate(Id.Stream streamId)
Wipes out stream data.
|
void |
updateConfig(Id.Stream streamId,
StreamProperties properties)
Overwrites existing configuration for the given stream.
|
boolean |
viewExists(Id.Stream.View viewId)
Checks if the view exists
|
clearAllForFlow, create, create, dropAllForFlow, exists, getQueueConfigurer, truncate, upgradeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitupgrade@Inject public InMemoryStreamAdmin(InMemoryQueueService queueService, UsageRegistry usageRegistry, LineageWriter lineageWriter, StreamMetaStore streamMetaStore, MetadataStore metadataStore, ViewAdmin viewAdmin)
public void dropAllInNamespace(Id.Namespace namespace) throws Exception
QueueAdmindropAllInNamespace in interface QueueAdmindropAllInNamespace in interface StreamAdmindropAllInNamespace in class InMemoryQueueAdminnamespace - the namespace to delete flows inExceptionpublic void configureInstances(Id.Stream streamId, long groupId, int instances) throws Exception
StreamAdminconfigureInstances in interface StreamAdminstreamId - Id of the stream.groupId - The consumer group to alter.instances - Number of instances.Exceptionpublic void configureGroups(Id.Stream streamId, Map<Long,Integer> groupInfo) throws Exception
StreamAdminconfigureGroups in interface StreamAdminstreamId - Id of the stream.groupInfo - A map from groupId to number of instances of each group.Exceptionpublic StreamConfig getConfig(Id.Stream streamId)
StreamAdmingetConfig in interface StreamAdminstreamId - Id of the stream.StreamConfig instance.public void updateConfig(Id.Stream streamId, StreamProperties properties) throws IOException
StreamAdminupdateConfig in interface StreamAdminstreamId - Id of the stream whose properties are being updatedproperties - New configuration of the stream.IOExceptionpublic boolean exists(Id.Stream streamId) throws Exception
exists in interface StreamAdminstreamId - Id of the stream.Exception - if check failspublic StreamConfig create(Id.Stream streamId) throws Exception
StreamAdmincreate in interface StreamAdminstreamId - Id of the stream to createStreamConfig associated with the new streamException - if creation failspublic StreamConfig create(Id.Stream streamId, @Nullable Properties props) throws Exception
StreamAdmincreate in interface StreamAdminstreamId - Id of the stream to createprops - additional propertiesStreamConfig associated with the new streamException - if creation failspublic void truncate(Id.Stream streamId) throws Exception
StreamAdmintruncate in interface StreamAdminstreamId - Id of the stream to truncateException - if cleanup failspublic void drop(Id.Stream streamId) throws Exception
StreamAdmindrop in interface StreamAdminstreamId - Id of the stream to deleteException - if deletion failspublic boolean createOrUpdateView(Id.Stream.View viewId, ViewSpecification spec) throws Exception
StreamAdmincreateOrUpdateView in interface StreamAdminviewId - the viewspec - specification for the viewExceptionpublic void deleteView(Id.Stream.View viewId) throws Exception
StreamAdmindeleteView in interface StreamAdminviewId - the viewExceptionpublic List<Id.Stream.View> listViews(Id.Stream streamId) throws Exception
StreamAdminlistViews in interface StreamAdminstreamId - the streamExceptionpublic ViewSpecification getView(Id.Stream.View viewId) throws Exception
StreamAdmingetView in interface StreamAdminviewId - the viewExceptionpublic boolean viewExists(Id.Stream.View viewId) throws Exception
StreamAdminviewExists in interface StreamAdminviewId - the viewExceptionpublic void register(Iterable<? extends Id> owners, Id.Stream streamId)
StreamAdminregister in interface StreamAdminowners - the ids that are using the streamstreamId - the stream being usedpublic void addAccess(Id.Run run, Id.Stream streamId, AccessType accessType)
StreamAdminaddAccess in interface StreamAdminrun - program runstreamId - stream being accessedaccessType - type of accessCopyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.