@Path(value="/slices") @Singleton public class SlicesServlet extends EndpointServlet
objectMappers| Constructor and Description |
|---|
SlicesServlet(PhysicalTableDictionary physicalTableDictionary,
RequestMapper requestMapper,
DataSourceMetadataService dataSourceMetadataService,
ObjectMappersSuite objectMappers,
ResponseFormatResolver formatResolver)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.Response |
getSliceBySliceName(String sliceName,
javax.ws.rs.core.UriInfo uriInfo,
javax.ws.rs.container.ContainerRequestContext containerRequestContext)
Endpoint to get all the dimensions and metrics serviced by a druid slice.
|
static String |
getSliceDetailUrl(String slice,
javax.ws.rs.core.UriInfo uriInfo)
Get the URL of the slice.
|
javax.ws.rs.core.Response |
getSlices(String perPage,
String page,
String format,
javax.ws.rs.core.UriInfo uriInfo,
javax.ws.rs.container.ContainerRequestContext containerRequestContext)
Endpoint to get all the performance slices.
|
formatResponse@Inject public SlicesServlet(PhysicalTableDictionary physicalTableDictionary, @Named(value="slicesApiRequestMapper") RequestMapper requestMapper, DataSourceMetadataService dataSourceMetadataService, ObjectMappersSuite objectMappers, ResponseFormatResolver formatResolver)
physicalTableDictionary - Physical Tables that this endpoint is reporting onrequestMapper - Mapper for changing the API requestdataSourceMetadataService - The data source metadata providerobjectMappers - JSON toolsformatResolver - The formatResolver for determining correct response format@GET
@Timed
public javax.ws.rs.core.Response getSlices(@DefaultValue(value="") @NotNull @QueryParam(value="perPage")
String perPage,
@DefaultValue(value="") @NotNull @QueryParam(value="page")
String page,
@QueryParam(value="format")
String format,
@Context
javax.ws.rs.core.UriInfo uriInfo,
@Context
javax.ws.rs.container.ContainerRequestContext containerRequestContext)
perPage - number of values to return per pagepage - the page to start fromformat - The name of the output format typeuriInfo - UriInfo of the requestcontainerRequestContext - The context of data provided by the Jersey container for this request
{
"slices": [
{ "name" : "slice A", "timeGrain" : "day", "uri" : "http:/.../" },
{ "name" : "slice B", "timeGrain" : "day", "uri" : "http:/.../" }
]
}
@GET
@Timed
@Produces(value="application/json")
@Path(value="/{sliceName}")
public javax.ws.rs.core.Response getSliceBySliceName(@PathParam(value="sliceName")
String sliceName,
@Context
javax.ws.rs.core.UriInfo uriInfo,
@Context
javax.ws.rs.container.ContainerRequestContext containerRequestContext)
sliceName - Physical table nameuriInfo - UriInfo of the requestcontainerRequestContext - The context of data provided by the Jersey container for this request
{
"name" : "slice A",
"timeGrain" : "daily",
"dimensions" : [
{ "name" : "dimensionA", "uri" : "http://.../" , "intervals" : [ '2010-03-01/2010-10-29'.... ]},
{ "name" : "dimensionB", "uri" : "http://.../" , "intervals" : [ '2010-03-01/2010-10-29'.... ]}
],
"metrics" : [
{ "name" : "metricA", "intervals" : [ '2010-03-01/2010-10-29'.... ]},
{ "name" : "metricB", "intervals" : [ '2010-03-01/2010-10-29'.... ]}
]
}
Copyright © 2016–2018 Yahoo! Inc.. All rights reserved.