Package com.mapr.kafka.eventstreams
Interface Admin
-
- All Superinterfaces:
java.lang.AutoCloseable
- All Known Implementing Classes:
MarlinAdminImpl
public interface Admin extends java.lang.AutoCloseable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.common.protocol.Errors>alterConsumerGroupOffsets(java.lang.String streamPath, java.lang.String groupId, java.util.Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.clients.consumer.OffsetAndMetadata> offsets)Alter the consumer group offsets for group with group id.voidclose()OverrideAutoCloseable.close()to avoid declaring a checked exception.voidclose(long duration, java.util.concurrent.TimeUnit unit)voidclose(java.time.Duration duration)voidcompactTopicNow(java.lang.String streamPath, java.lang.String topicName)intcountTopics(java.lang.String streamPath)Count the number of topics in a stream.voidcreateStream(java.lang.String streamPath, StreamDescriptor desc)Create a stream.voidcreateTopic(java.lang.String streamPath, java.lang.String topicName)Create a topic with the default number of partitions.voidcreateTopic(java.lang.String streamPath, java.lang.String topicName, int npartitions)Create a topic with the specified number of partitions.voidcreateTopic(java.lang.String streamPath, java.lang.String topicName, TopicDescriptor desc)Create a topic with the default number of partitions.voiddeleteStream(java.lang.String streamPath)Delete a stream.voiddeleteTopic(java.lang.String streamPath, java.lang.String topicName)Delete a topic.voideditStream(java.lang.String streamPath, StreamDescriptor desc)Modify the attributes of a stream.voideditTopic(java.lang.String streamPath, java.lang.String topicName, int npartitions)Modify the number of partitions for a topic.voideditTopic(java.lang.String streamPath, java.lang.String topicName, TopicDescriptor desc)Create a topic with the default number of partitions.StreamDescriptorgetStreamDescriptor(java.lang.String streamPath)Get the StreamDescriptor for a stream.TopicDescriptorgetTopicDescriptor(java.lang.String streamPath, java.lang.String topicName)java.util.Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.clients.consumer.OffsetAndMetadata>listConsumerGroupOffsets(java.lang.String streamPath, java.lang.String groupId)List all the consumer group offsets within a stream and group id.java.util.Collection<java.lang.Object>listConsumerGroups(java.lang.String streamPath)List all the consumer groups within a stream.java.util.List<java.lang.String>listTopics(java.lang.String streamPath)List all the topics within a stream.java.util.Map<java.lang.String,java.util.List<TopicFeedInfo>>listTopicsForStream(java.lang.String streamPath)List all the topics within a stream.booleanstreamExists(java.lang.String streamPath)
-
-
-
Method Detail
-
createStream
void createStream(java.lang.String streamPath, StreamDescriptor desc) throws java.io.IOException, java.lang.IllegalArgumentExceptionCreate a stream.- Parameters:
streamPath- absolute path of the stream in MapR-FSdesc- descriptor for stream attributes- Throws:
java.io.IOExceptionjava.lang.IllegalArgumentException
-
editStream
void editStream(java.lang.String streamPath, StreamDescriptor desc) throws java.io.IOException, java.lang.IllegalArgumentExceptionModify the attributes of a stream.- Parameters:
streamPath- absolute path of the stream in MapR-FSdesc- descriptor for stream attributes- Throws:
java.io.IOExceptionjava.lang.IllegalArgumentException
-
getStreamDescriptor
StreamDescriptor getStreamDescriptor(java.lang.String streamPath) throws java.io.IOException, java.lang.IllegalArgumentException
Get the StreamDescriptor for a stream.- Parameters:
streamPath- absolute path of the stream in MapR-FS- Returns:
- descriptor for stream attributes
- Throws:
java.io.IOExceptionjava.lang.IllegalArgumentException
-
deleteStream
void deleteStream(java.lang.String streamPath) throws java.io.IOException, java.lang.IllegalArgumentExceptionDelete a stream.- Parameters:
streamPath- absolute path of the stream in MapR-FS- Throws:
java.io.IOExceptionjava.lang.IllegalArgumentException
-
countTopics
int countTopics(java.lang.String streamPath) throws java.io.IOException, java.lang.IllegalArgumentExceptionCount the number of topics in a stream.- Parameters:
streamPath- absolute path of the stream in MapR-FS- Returns:
- number of topics in the stream.
- Throws:
java.io.IOExceptionjava.lang.IllegalArgumentException
-
createTopic
void createTopic(java.lang.String streamPath, java.lang.String topicName) throws java.io.IOExceptionCreate a topic with the default number of partitions.- Parameters:
streamPath- absolute path of the stream in MapR-FStopicName- name of the topic- Throws:
java.io.IOException
-
createTopic
void createTopic(java.lang.String streamPath, java.lang.String topicName, int npartitions) throws java.io.IOExceptionCreate a topic with the specified number of partitions.- Parameters:
streamPath- absolute path of the stream in MapR-FStopicName- name of the topic- Throws:
java.io.IOException
-
createTopic
void createTopic(java.lang.String streamPath, java.lang.String topicName, TopicDescriptor desc) throws java.io.IOExceptionCreate a topic with the default number of partitions.- Parameters:
streamPath- absolute path of the stream in MapR-FStopicName- name of the topicdesc- descriptor for topic attributes- Throws:
java.io.IOException
-
editTopic
void editTopic(java.lang.String streamPath, java.lang.String topicName, int npartitions) throws java.io.IOExceptionModify the number of partitions for a topic.- Parameters:
streamPath- absolute path of the stream in MapR-FStopicName- name of the topic- Throws:
java.io.IOException
-
editTopic
void editTopic(java.lang.String streamPath, java.lang.String topicName, TopicDescriptor desc) throws java.io.IOExceptionCreate a topic with the default number of partitions.- Parameters:
streamPath- absolute path of the stream in MapR-FStopicName- name of the topicdesc- descriptor for topic attributes- Throws:
java.io.IOException
-
deleteTopic
void deleteTopic(java.lang.String streamPath, java.lang.String topicName) throws java.io.IOExceptionDelete a topic.- Parameters:
streamPath- absolute path of the stream in MapR-FStopicName- name of the topic- Throws:
java.io.IOException
-
compactTopicNow
void compactTopicNow(java.lang.String streamPath, java.lang.String topicName) throws java.io.IOException- Throws:
java.io.IOException
-
getTopicDescriptor
TopicDescriptor getTopicDescriptor(java.lang.String streamPath, java.lang.String topicName) throws java.io.IOException
- Parameters:
streamPath-topicName-- Returns:
- descriptor for topic attributes
- Throws:
java.io.IOException
-
listTopics
java.util.List<java.lang.String> listTopics(java.lang.String streamPath) throws java.io.IOException, java.lang.IllegalArgumentExceptionList all the topics within a stream.- Parameters:
streamPath-- Returns:
- list of topic names for the topics in the stream.
- Throws:
java.io.IOExceptionjava.lang.IllegalArgumentException
-
listTopicsForStream
java.util.Map<java.lang.String,java.util.List<TopicFeedInfo>> listTopicsForStream(java.lang.String streamPath) throws java.io.IOException, java.lang.IllegalArgumentException
List all the topics within a stream.- Parameters:
streamPath-- Returns:
- list of topic names for the topics in the stream.
- Throws:
java.io.IOExceptionjava.lang.IllegalArgumentException
-
listConsumerGroups
java.util.Collection<java.lang.Object> listConsumerGroups(java.lang.String streamPath) throws java.io.IOException, java.lang.IllegalArgumentExceptionList all the consumer groups within a stream.- Parameters:
streamPath-- Returns:
- list of consumer groups for the stream.
- Throws:
java.io.IOExceptionjava.lang.IllegalArgumentException
-
streamExists
boolean streamExists(java.lang.String streamPath) throws java.io.IOException- Parameters:
streamPath-- Returns:
trueif the specified path exists and is a stream- Throws:
java.io.IOException
-
listConsumerGroupOffsets
java.util.Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.clients.consumer.OffsetAndMetadata> listConsumerGroupOffsets(java.lang.String streamPath, java.lang.String groupId) throws java.io.IOException, java.lang.IllegalArgumentExceptionList all the consumer group offsets within a stream and group id.- Parameters:
streamPath-- Returns:
- list of consumer groups for the stream.
- Throws:
java.io.IOExceptionjava.lang.IllegalArgumentException
-
alterConsumerGroupOffsets
java.util.Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.common.protocol.Errors> alterConsumerGroupOffsets(java.lang.String streamPath, java.lang.String groupId, java.util.Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.clients.consumer.OffsetAndMetadata> offsets) throws java.io.IOException, java.lang.IllegalArgumentExceptionAlter the consumer group offsets for group with group id.- Parameters:
groupId-- Returns:
- list of consumer groups for the stream.
- Throws:
java.io.IOExceptionjava.lang.IllegalArgumentException
-
close
void close()
OverrideAutoCloseable.close()to avoid declaring a checked exception.- Specified by:
closein interfacejava.lang.AutoCloseable
-
close
void close(long duration, java.util.concurrent.TimeUnit unit)- Parameters:
duration-unit-
-
close
void close(java.time.Duration duration)
- Parameters:
duration-
-
-