From 649f285feb4d418729705f1873c3db0e9ecd02a8 Mon Sep 17 00:00:00 2001 From: fjy Date: Fri, 30 Jan 2015 12:37:48 -0800 Subject: [PATCH] Add an endpoint to return the overlord leader --- .../druid/indexing/overlord/http/OverlordResource.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/indexing-service/src/main/java/io/druid/indexing/overlord/http/OverlordResource.java b/indexing-service/src/main/java/io/druid/indexing/overlord/http/OverlordResource.java index 76523504f53..5b5f26643e9 100644 --- a/indexing-service/src/main/java/io/druid/indexing/overlord/http/OverlordResource.java +++ b/indexing-service/src/main/java/io/druid/indexing/overlord/http/OverlordResource.java @@ -28,7 +28,6 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import com.google.common.io.ByteSource; -import com.google.common.io.InputSupplier; import com.google.common.util.concurrent.SettableFuture; import com.google.inject.Inject; import com.metamx.common.logger.Logger; @@ -61,7 +60,6 @@ import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.io.IOException; -import java.io.InputStream; import java.util.Collection; import java.util.List; import java.util.Map; @@ -126,6 +124,14 @@ public class OverlordResource ); } + @GET + @Path("/leader") + @Produces(MediaType.APPLICATION_JSON) + public Response getLeader() + { + return Response.ok(taskMaster.getLeader()).build(); + } + @GET @Path("/task/{taskid}") @Produces(MediaType.APPLICATION_JSON)