You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -95,14 +108,15 @@ var { shallowCopy } = require('./util');
95
108
util.inherits(AdminClient,Client);
96
109
97
110
/**
98
-
* Create a new AdminClient for making topics, partitions, and more.
111
+
* Create a new AdminClient using the provided configuration.
99
112
*
100
113
* This is a factory method because it immediately starts an
101
114
* active handle with the brokers.
102
115
*
103
-
* @param {object} conf - Key value pairs to configure the admin client
104
-
* @param {object} eventHandlers - optional key value pairs of event handlers to attach to the client
105
-
*
116
+
* @param {object} conf - Key value pairs to configure the admin client.
117
+
* @param {object?} eventHandlers - Optional key value pairs of event handlers to attach to the client.
118
+
* @memberof RdKafka
119
+
* @alias RdKafka.AdminClient.create
106
120
*/
107
121
functioncreateAdminClient(conf,eventHandlers){
108
122
varclient=newAdminClient(conf);
@@ -126,11 +140,14 @@ function createAdminClient(conf, eventHandlers) {
126
140
* This is a factory method because it immediately starts an
127
141
* active handle with the brokers.
128
142
*
129
-
* The producer or consumer being used must be connected.
130
-
* The client can only be used while the producer or consumer is connected.
143
+
* The producer or consumer being used must be connected before creating the admin client,
144
+
* and the admin client can only be used while the producer or consumer is connected.
145
+
*
131
146
* Logging and other events from this client will be emitted on the producer or consumer.
132
-
* @param {import('../types/rdkafka').Producer | import('../types/rdkafka').KafkaConsumer} existingClient a producer or consumer to create the admin client from
133
-
* @param {object} eventHandlers optional key value pairs of event handlers to attach to the client
147
+
* @param {RdKafka.Producer | RdKafka.KafkaConsumer} existingClient - A producer or consumer to create the admin client from.
148
+
* @param {object?} eventHandlers - Optional key value pairs of event handlers to attach to the client.
* var client = AdminClient.create({ ... }); // From configuration
182
+
* var client = AdminClient.createFrom(existingClient); // From existing producer or consumer
183
+
*
184
+
* @param {object|null} conf - Key value pairs to configure the admin client
185
+
* @param {RdKafka.Producer | RdKafka.KafkaConsumer | null} existingClient - An existing producer or consumer to create the admin client from (optional).
186
+
* @memberof RdKafka
170
187
* @constructor
171
188
*/
172
189
functionAdminClient(conf,existingClient){
@@ -197,6 +214,7 @@ function AdminClient(conf, existingClient) {
197
214
* need to be called outside.
198
215
*
199
216
* Unlike the other connect methods, this one is synchronous.
217
+
* @private
200
218
*/
201
219
AdminClient.prototype.connect=function(){
202
220
if(!this._hasUnderlyingClient){
@@ -213,7 +231,7 @@ AdminClient.prototype.connect = function () {
213
231
* Disconnect the admin client.
214
232
*
215
233
* This is a synchronous method, but all it does is clean up
216
-
* some memory and shut some threads down
234
+
* some memory and shut some threads down.
217
235
*/
218
236
AdminClient.prototype.disconnect=function(){
219
237
if(this._hasUnderlyingClient){
@@ -231,9 +249,13 @@ AdminClient.prototype.disconnect = function () {
231
249
/**
232
250
* Create a topic with a given config.
233
251
*
234
-
* @param {NewTopic} topic - Topic to create.
235
-
* @param {number} timeout - Number of milliseconds to wait while trying to create the topic.
236
-
* @param {function} cb - The callback to be executed when finished
252
+
* @param {object} topic - Topic to create.
253
+
* @param {string} topic.topic - The name of the topic to create.
254
+
* @param {number} topic.num_partitions - The number of partitions for the topic.
255
+
* @param {number} topic.replication_factor - The replication factor for the topic.
256
+
* @param {object?} topic.config - The topic configuration. The keys of this object denote the keys of the configuration.
257
+
* @param {number?} timeout - Number of milliseconds to wait while trying to create the topic. Set to 5000 by default.
258
+
* @param {function} cb - The callback to be executed when finished.
0 commit comments