This is an automated email from the ASF dual-hosted git repository. lhotari pushed a commit to branch branch-4.1 in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit 9d456df482f984bef7729c7af34e089a3a2670e7 Author: 道君- Tao Jiuming <[email protected]> AuthorDate: Sat Nov 8 01:19:05 2025 +0800 [improve][fn] Use PulsarByteBufAllocator.DEFAULT instead of ByteBufAllocator.DEFAULT (#24952) (cherry picked from commit 9944ab0ef5fa22844accd695cac48104d55467a0) --- .../pulsar/functions/worker/rest/api/FunctionsMetricsResource.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/FunctionsMetricsResource.java b/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/FunctionsMetricsResource.java index fcfd998ad25..43143c67916 100644 --- a/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/FunctionsMetricsResource.java +++ b/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/FunctionsMetricsResource.java @@ -19,7 +19,6 @@ package org.apache.pulsar.functions.worker.rest.api; import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufAllocator; import io.prometheus.client.CollectorRegistry; import io.prometheus.client.exporter.common.TextFormat; import java.io.IOException; @@ -33,6 +32,7 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.StreamingOutput; import org.apache.pulsar.broker.stats.prometheus.PrometheusMetricsServlet; +import org.apache.pulsar.common.allocator.PulsarByteBufAllocator; import org.apache.pulsar.common.util.SimpleTextOutputStream; import org.apache.pulsar.functions.worker.WorkerService; import org.apache.pulsar.functions.worker.rest.FunctionApiResource; @@ -45,7 +45,7 @@ public class FunctionsMetricsResource extends FunctionApiResource { public Response getMetrics() throws IOException { WorkerService workerService = get(); - ByteBuf buf = ByteBufAllocator.DEFAULT.heapBuffer(); + ByteBuf buf = PulsarByteBufAllocator.DEFAULT.heapBuffer(); // if request, also attach the prometheus metrics if (workerService.getWorkerConfig().isIncludeStandardPrometheusMetrics()) { Writer writer = new BufWriter(buf);
