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 TypeMethodDescriptionvoid
close()
Close the AdminClient and release all associated resources.abstract void
Close the AdminClient and release all associated resources.static AdminClient
Create a new AdminClient with the given configuration.static AdminClient
create
(Properties props) Create a new Admin with the given configuration.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.ms
option for topic creation.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.org.apache.kafka.clients.admin.DeleteTopicsResult
deleteTopics
(Collection<String> topics) Delete a batch of topics.abstract org.apache.kafka.clients.admin.DeleteTopicsResult
deleteTopics
(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, wait
Methods 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, listTransactions
Methods 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:Admin
Create 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:
close
in interfaceorg.apache.kafka.clients.admin.Admin
- Specified by:
close
in interfaceAdmin
- Specified by:
close
in 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.ms
option 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:
createTopics
in interfaceorg.apache.kafka.clients.admin.Admin
- Specified by:
createTopics
in 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.ms
option 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:
createTopics
in interfaceorg.apache.kafka.clients.admin.Admin
- Specified by:
createTopics
in 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:
deleteTopics
in interfaceorg.apache.kafka.clients.admin.Admin
- Specified by:
deleteTopics
in 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.enable
is true in Oracle TEQ.- Specified by:
deleteTopics
in interfaceorg.apache.kafka.clients.admin.Admin
- Specified by:
deleteTopics
in interfaceAdmin
- Parameters:
topics
- The topic names to delete.options
- The options to use when deleting the topics.- Returns:
- The DeleteTopicsResult.
-