Package org.oracle.okafka.clients.admin
Class AdminClient
java.lang.Object
org.oracle.okafka.clients.admin.AdminClient
- All Implemented Interfaces:
AutoCloseable,org.apache.kafka.clients.admin.Admin,Admin
- Direct Known Subclasses:
KafkaAdminClient
The administrative client for Transactional Event Queues(TXEQ), which supports managing and inspecting topics.
For this release only creation of topic(s) and deletion of topic(s) is supported.
A topic can be created by invoking
#createTopics(Collection) and deleted by invoking #deleteTopics(Collection) method.
Topic can be created with following configuration.
retention.ms: Amount of time in milliseconds for which records stay in topic and are available for consumption. Internally, retention.ms value is rounded to the second. Default value for this parameter is 7 days.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the AdminClient and release all associated resources.abstract voidClose the AdminClient and release all associated resources.static AdminClientCreate a new AdminClient with the given configuration.static AdminClientcreate(Properties props) Create a new Admin with the given configuration.org.apache.kafka.clients.admin.CreateTopicsResultcreateTopics(Collection<org.apache.kafka.clients.admin.NewTopic> newTopics) Create a batch of new topics .This call supports onlyretention.msoption for topic creation.abstract org.apache.kafka.clients.admin.CreateTopicsResultcreateTopics(Collection<org.apache.kafka.clients.admin.NewTopic> newTopics, org.apache.kafka.clients.admin.CreateTopicsOptions options) Create a batch of new topics.org.apache.kafka.clients.admin.DeleteTopicsResultdeleteTopics(Collection<String> topics) Delete a batch of topics.abstract org.apache.kafka.clients.admin.DeleteTopicsResultdeleteTopics(Collection<String> topics, org.apache.kafka.clients.admin.DeleteTopicsOptions options) Delete a batch of topics.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.kafka.clients.admin.Admin
abortTransaction, abortTransaction, clientInstanceId, deleteTopics, deleteTopics, describeMetadataQuorum, describeMetadataQuorum, describeProducers, describeProducers, describeTopics, describeTopics, describeTransactions, describeTransactions, fenceProducers, fenceProducers, listClientMetricsResources, listClientMetricsResources, listConsumerGroupOffsets, listConsumerGroupOffsets, listTransactions, listTransactionsMethods inherited from interface org.oracle.okafka.clients.admin.Admin
alterClientQuotas, alterClientQuotas, alterConsumerGroupOffsets, alterConsumerGroupOffsets, alterPartitionReassignments, alterPartitionReassignments, alterUserScramCredentials, alterUserScramCredentials, close, deleteConsumerGroupOffsets, deleteConsumerGroupOffsets, describeClientQuotas, describeClientQuotas, describeFeatures, describeFeatures, describeUserScramCredentials, describeUserScramCredentials, describeUserScramCredentials, electLeaders, electLeaders, electPreferredLeaders, electPreferredLeaders, incrementalAlterConfigs, incrementalAlterConfigs, listOffsets, listOffsets, listPartitionReassignments, listPartitionReassignments, listPartitionReassignments, listPartitionReassignments, listPartitionReassignments, metrics, removeMembersFromConsumerGroup, unregisterBroker, unregisterBroker, updateFeatures
-
Constructor Details
-
AdminClient
public AdminClient()
-
-
Method Details
-
create
Description copied from interface:AdminCreate a new Admin with the given configuration.- Parameters:
props- The configuration.- Returns:
- The new KafkaAdminClient.
-
create
Create a new AdminClient with the given configuration.- Parameters:
conf- The configuration.- Returns:
- The new KafkaAdminClient.
-
close
public void close()Close the AdminClient and release all associated resources. Seeclose(long, TimeUnit)- Specified by:
closein interfaceorg.apache.kafka.clients.admin.Admin- Specified by:
closein interfaceAdmin- Specified by:
closein interfaceAutoCloseable
-
close
Close the AdminClient and release all associated resources. The close operation has a grace period during which current operations will be allowed to complete, specified by the given duration and time unit. New operations will not be accepted during the grace period. Once the grace period is over, all operations that have not yet been completed will be aborted with a TimeoutException. -
createTopics
public org.apache.kafka.clients.admin.CreateTopicsResult createTopics(Collection<org.apache.kafka.clients.admin.NewTopic> newTopics) Create a batch of new topics .This call supports onlyretention.msoption for topic creation. This operation is not transactional so it may succeed for some topics while fail for others. This method is not supported in preview release.- Specified by:
createTopicsin interfaceorg.apache.kafka.clients.admin.Admin- Specified by:
createTopicsin interfaceAdmin- Parameters:
newTopics- The new topics to create.- Returns:
- The CreateTopicsResult.
-
createTopics
public abstract org.apache.kafka.clients.admin.CreateTopicsResult createTopics(Collection<org.apache.kafka.clients.admin.NewTopic> newTopics, org.apache.kafka.clients.admin.CreateTopicsOptions options) Create a batch of new topics. This call supports onlyretention.msoption for topic creation. This operation is not transactional so it may succeed for some topics while fail for others. This method is not supported in preview release.- Specified by:
createTopicsin interfaceorg.apache.kafka.clients.admin.Admin- Specified by:
createTopicsin interfaceAdmin- Parameters:
newTopics- The new topics to create.options- The options to use when creating the new topics.- Returns:
- The CreateTopicsResult.
-
deleteTopics
Delete a batch of topics. This call doen't consider options for topic deletion. This operation is not transactional so it may succeed for some topics while fail for others.- Specified by:
deleteTopicsin interfaceorg.apache.kafka.clients.admin.Admin- Specified by:
deleteTopicsin interfaceAdmin- Parameters:
topics- The topic names to delete.- Returns:
- The DeleteTopicsResult.
-
deleteTopics
public abstract org.apache.kafka.clients.admin.DeleteTopicsResult deleteTopics(Collection<String> topics, org.apache.kafka.clients.admin.DeleteTopicsOptions options) Delete a batch of topics. This call doen't consider options for topic deletion. This operation is not transactional so it may succeed for some topics while fail for others.delete.topic.enableis true in Oracle TEQ.- Specified by:
deleteTopicsin interfaceorg.apache.kafka.clients.admin.Admin- Specified by:
deleteTopicsin interfaceAdmin- Parameters:
topics- The topic names to delete.options- The options to use when deleting the topics.- Returns:
- The DeleteTopicsResult.
-