Skip to content

Commit 98528ab

Browse files
committed
a nit with isTelemetryExporterConfigured
Signed-off-by: see-quick <[email protected]>
1 parent f6b654e commit 98528ab

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

core/src/test/scala/unit/kafka/server/KafkaApisTest.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11532,7 +11532,7 @@ class KafkaApisTest extends Logging {
1153211532
val request = buildRequest(new GetTelemetrySubscriptionsRequest.Builder(
1153311533
new GetTelemetrySubscriptionsRequestData(), true).build())
1153411534

11535-
when(clientMetricsManager.isTelemetryReceiverConfigured).thenReturn(true)
11535+
when(clientMetricsManager.isTelemetryExporterConfigured).thenReturn(true)
1153611536
when(clientMetricsManager.processGetTelemetrySubscriptionRequest(any[GetTelemetrySubscriptionsRequest](),
1153711537
any[RequestContext]())).thenReturn(new GetTelemetrySubscriptionsResponse(
1153811538
new GetTelemetrySubscriptionsResponseData()))
@@ -11552,7 +11552,7 @@ class KafkaApisTest extends Logging {
1155211552
val request = buildRequest(new GetTelemetrySubscriptionsRequest.Builder(
1155311553
new GetTelemetrySubscriptionsRequestData(), true).build())
1155411554

11555-
when(clientMetricsManager.isTelemetryReceiverConfigured).thenReturn(true)
11555+
when(clientMetricsManager.isTelemetryExporterConfigured).thenReturn(true)
1155611556
when(clientMetricsManager.processGetTelemetrySubscriptionRequest(any[GetTelemetrySubscriptionsRequest](),
1155711557
any[RequestContext]())).thenThrow(new RuntimeException("test"))
1155811558

@@ -11570,7 +11570,7 @@ class KafkaApisTest extends Logging {
1157011570
def testPushTelemetry(): Unit = {
1157111571
val request = buildRequest(new PushTelemetryRequest.Builder(new PushTelemetryRequestData(), true).build())
1157211572

11573-
when(clientMetricsManager.isTelemetryReceiverConfigured).thenReturn(true)
11573+
when(clientMetricsManager.isTelemetryExporterConfigured).thenReturn(true)
1157411574
when(clientMetricsManager.processPushTelemetryRequest(any[PushTelemetryRequest](), any[RequestContext]()))
1157511575
.thenReturn(new PushTelemetryResponse(new PushTelemetryResponseData()))
1157611576

@@ -11587,7 +11587,7 @@ class KafkaApisTest extends Logging {
1158711587
def testPushTelemetryWithException(): Unit = {
1158811588
val request = buildRequest(new PushTelemetryRequest.Builder(new PushTelemetryRequestData(), true).build())
1158911589

11590-
when(clientMetricsManager.isTelemetryReceiverConfigured).thenReturn(true)
11590+
when(clientMetricsManager.isTelemetryExporterConfigured).thenReturn(true)
1159111591
when(clientMetricsManager.processPushTelemetryRequest(any[PushTelemetryRequest](), any[RequestContext]()))
1159211592
.thenThrow(new RuntimeException("test"))
1159311593

server/src/main/java/org/apache/kafka/server/ClientMetricsManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public PushTelemetryResponse processPushTelemetryRequest(PushTelemetryRequest re
228228
return new PushTelemetryResponse(new PushTelemetryResponseData());
229229
}
230230

231-
public boolean isTelemetryReceiverConfigured() {
231+
public boolean isTelemetryExporterConfigured() {
232232
return !clientTelemetryExporterPlugin.isEmpty();
233233
}
234234

server/src/main/java/org/apache/kafka/server/DefaultApiVersionManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public ApiMessageType.ListenerType listenerType() {
7878
public ApiVersionsResponse apiVersionResponse(int throttleTimeMs, boolean alterFeatureLevel0) {
7979
FinalizedFeatures finalizedFeatures = metadataCache.features();
8080
Optional<NodeApiVersions> controllerApiVersions = nodeApiVersionsSupplier.get();
81-
boolean clientTelemetryEnabled = clientMetricsManager.map(ClientMetricsManager::isTelemetryReceiverConfigured).orElse(false);
81+
boolean clientTelemetryEnabled = clientMetricsManager.map(ClientMetricsManager::isTelemetryExporterConfigured).orElse(false);
8282
ApiVersionsResponseData.ApiVersionCollection apiVersions = controllerApiVersions
8383
.map(nodeApiVersions -> ApiVersionsResponse.controllerApiVersions(
8484
nodeApiVersions,

0 commit comments

Comments
 (0)