mirror of https://github.com/apache/druid.git
remove extra kill parameter
This commit is contained in:
parent
5364aa5b6c
commit
b82b487f20
|
@ -258,7 +258,7 @@ Optional Header Parameters for auditing the config change can also be specified.
|
|||
|
||||
Disables a datasource.
|
||||
|
||||
* `/druid/coordinator/v1/datasources/{dataSourceName}/intervals/{interval}?kill=true`
|
||||
* `/druid/coordinator/v1/datasources/{dataSourceName}/intervals/{interval}`
|
||||
* `@Deprecated. /druid/coordinator/v1/datasources/{dataSourceName}?kill=true&interval={myISO8601Interval}`
|
||||
|
||||
Runs a [Kill task](../ingestion/tasks.html) for a given interval and datasource.
|
||||
|
|
|
@ -36,9 +36,8 @@ import org.jboss.netty.handler.codec.http.HttpResponseStatus;
|
|||
import org.joda.time.Interval;
|
||||
|
||||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Map;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
|
||||
public class CoordinatorResourceTestClient
|
||||
{
|
||||
|
@ -143,7 +142,7 @@ public class CoordinatorResourceTestClient
|
|||
makeRequest(
|
||||
HttpMethod.DELETE,
|
||||
String.format(
|
||||
"%sdatasources/%s/intervals/%s?kill=true",
|
||||
"%sdatasources/%s/intervals/%s",
|
||||
getCoordinatorURL(),
|
||||
dataSource, interval.toString().replace("/", "_")
|
||||
)
|
||||
|
|
|
@ -49,7 +49,6 @@ import org.joda.time.Interval;
|
|||
import javax.annotation.Nullable;
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.DELETE;
|
||||
import javax.ws.rs.DefaultValue;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
|
@ -207,15 +206,13 @@ public class DatasourcesResource
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public Response deleteDataSourceSpecificInterval(
|
||||
@PathParam("dataSourceName") final String dataSourceName,
|
||||
@PathParam("interval") final String interval,
|
||||
@QueryParam("kill") @DefaultValue("true") final String kill
|
||||
@PathParam("interval") final String interval
|
||||
)
|
||||
{
|
||||
if (indexingServiceClient == null) {
|
||||
return Response.ok(ImmutableMap.of("error", "no indexing service found")).build();
|
||||
}
|
||||
final Interval theInterval = new Interval(interval.replace("_", "/"));
|
||||
if (kill != null && Boolean.valueOf(kill)) {
|
||||
try {
|
||||
indexingServiceClient.killSegments(dataSourceName, new Interval(theInterval));
|
||||
}
|
||||
|
@ -227,9 +224,6 @@ public class DatasourcesResource
|
|||
))
|
||||
.build();
|
||||
}
|
||||
} else {
|
||||
return Response.ok(ImmutableMap.of("error", "kill is set to false")).build();
|
||||
}
|
||||
return Response.ok().build();
|
||||
}
|
||||
|
||||
|
|
|
@ -20,14 +20,11 @@
|
|||
package io.druid.server.http;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import io.druid.client.CoordinatorServerView;
|
||||
import io.druid.client.DruidDataSource;
|
||||
import io.druid.client.DruidServer;
|
||||
import io.druid.client.InventoryView;
|
||||
import io.druid.client.indexing.IndexingServiceClient;
|
||||
import io.druid.metadata.MetadataSegmentManager;
|
||||
import io.druid.timeline.DataSegment;
|
||||
import org.easymock.EasyMock;
|
||||
import org.joda.time.Interval;
|
||||
|
@ -399,29 +396,11 @@ public class DatasourcesResourceTest
|
|||
EasyMock.replay(indexingServiceClient, server);
|
||||
|
||||
DatasourcesResource datasourcesResource = new DatasourcesResource(inventoryView, null, indexingServiceClient);
|
||||
Response response = datasourcesResource.deleteDataSourceSpecificInterval("datasource1", interval, "true");
|
||||
Response response = datasourcesResource.deleteDataSourceSpecificInterval("datasource1", interval);
|
||||
|
||||
Assert.assertEquals(200, response.getStatus());
|
||||
Assert.assertEquals(null, response.getEntity());
|
||||
EasyMock.verify(indexingServiceClient, server);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDeleteDataSourceSpecificIntervalKillFalse() throws Exception
|
||||
{
|
||||
String interval = "2010-01-01_P1D";
|
||||
Interval theInterval = new Interval(interval.replace("_", "/"));
|
||||
|
||||
IndexingServiceClient indexingServiceClient = EasyMock.createStrictMock(IndexingServiceClient.class);
|
||||
EasyMock.replay(indexingServiceClient, server);
|
||||
|
||||
DatasourcesResource datasourcesResource = new DatasourcesResource(inventoryView, null, indexingServiceClient);
|
||||
Response response = datasourcesResource.deleteDataSourceSpecificInterval("datasource1", interval, "false");
|
||||
|
||||
Assert.assertEquals(200, response.getStatus());
|
||||
ImmutableMap<String, String> results = (ImmutableMap<String, String>) response.getEntity();
|
||||
Assert.assertEquals(results, ImmutableMap.<String, String>of("error", "kill is set to false"));
|
||||
EasyMock.verify(indexingServiceClient, server);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue