use of org.apache.kafka.connect.health.ConnectClusterDetails in project kafka by apache.
the class RestServer method registerRestExtensions.
void registerRestExtensions(Herder herder, ResourceConfig resourceConfig) {
connectRestExtensions = herder.plugins().newPlugins(config.getList(WorkerConfig.REST_EXTENSION_CLASSES_CONFIG), config, ConnectRestExtension.class);
long herderRequestTimeoutMs = ConnectorsResource.REQUEST_TIMEOUT_MS;
Integer rebalanceTimeoutMs = config.getRebalanceTimeout();
if (rebalanceTimeoutMs != null) {
herderRequestTimeoutMs = Math.min(herderRequestTimeoutMs, rebalanceTimeoutMs.longValue());
}
ConnectClusterDetails connectClusterDetails = new ConnectClusterDetailsImpl(herder.kafkaClusterId());
ConnectRestExtensionContext connectRestExtensionContext = new ConnectRestExtensionContextImpl(new ConnectRestConfigurable(resourceConfig), new ConnectClusterStateImpl(herderRequestTimeoutMs, connectClusterDetails, herder));
for (ConnectRestExtension connectRestExtension : connectRestExtensions) {
connectRestExtension.register(connectRestExtensionContext);
}
}
Aggregations