@Path(value="data") @Singleton public class DataServlet extends CORSPreflightServlet implements BardConfigResources
Constructor and Description |
---|
DataServlet(ResourceDictionaries resourceDictionaries,
DruidQueryBuilder druidQueryBuilder,
TemplateDruidQueryMerger templateDruidQueryMerger,
DruidResponseParser druidResponseParser,
RequestWorkflowProvider workflowProvider,
RequestMapper requestMapper,
ObjectMappersSuite objectMappers,
DruidFilterBuilder filterBuilder,
HavingGenerator havingGenerator,
GranularityParser granularityParser,
JobPayloadBuilder jobPayloadBuilder,
JobRowBuilder jobRowBuilder,
AsynchronousWorkflowsBuilder asynchronousWorkflowsBuilder,
BroadcastChannel<String> preResponseStoredNotifications,
HttpResponseMaker httpResponseMaker,
ResponseFormatResolver formatResolver,
DataApiRequestFactory dataApiRequestFactory,
ResponseProcessorFactory responseProcessorFactory)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
getData(javax.ws.rs.core.UriInfo uriInfo,
javax.ws.rs.container.ContainerRequestContext containerRequestContext,
String tableName,
String timeGrain,
List<javax.ws.rs.core.PathSegment> dimensions,
String metrics,
String intervals,
String filters,
String havings,
String sorts,
String count,
String topN,
String format,
String timeZone,
String asyncAfter,
String perPage,
String page,
Boolean readCache,
javax.ws.rs.container.AsyncResponse asyncResponse)
Resource method with dimensions as a mandatory path parameter.
|
DataRequestHandler |
getDataRequestHandler() |
DruidQueryBuilder |
getDruidQueryBuilder() |
DruidResponseParser |
getDruidResponseParser() |
DruidFilterBuilder |
getFilterBuilder()
A parser and builder for filters.
|
GranularityParser |
getGranularityParser()
A parser for string to granularities.
|
HavingGenerator |
getHavingApiGenerator()
Having Api Generator.
|
void |
getNoDimensionData(javax.ws.rs.core.UriInfo uriInfo,
javax.ws.rs.container.ContainerRequestContext containerRequestContext,
String tableName,
String timeGrain,
String metrics,
String intervals,
String filters,
String havings,
String sorts,
String count,
String topN,
String format,
String timeZone,
String asyncAfter,
String perPage,
String page,
Boolean readCache,
javax.ws.rs.container.AsyncResponse asyncResponse)
Resource method with tableName and timeGrain as a mandatory path parameter.
|
ObjectMappersSuite |
getObjectMappers() |
RequestMapper |
getRequestMapper() |
ResourceDictionaries |
getResourceDictionaries()
The collection of resource dictionaries.
|
org.joda.time.DateTimeZone |
getSystemTimeZone()
The configured default time zone for dates.
|
TemplateDruidQueryMerger |
getTemplateDruidQueryMerger() |
com.fasterxml.jackson.databind.ObjectWriter |
getWriter() |
preflightResponse
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDimensionDictionary, getLogicalTableDictionary, getMetricDictionary
@Inject public DataServlet(ResourceDictionaries resourceDictionaries, DruidQueryBuilder druidQueryBuilder, TemplateDruidQueryMerger templateDruidQueryMerger, DruidResponseParser druidResponseParser, RequestWorkflowProvider workflowProvider, @Named(value="dataApiRequestMapper") RequestMapper requestMapper, ObjectMappersSuite objectMappers, DruidFilterBuilder filterBuilder, HavingGenerator havingGenerator, GranularityParser granularityParser, JobPayloadBuilder jobPayloadBuilder, JobRowBuilder jobRowBuilder, AsynchronousWorkflowsBuilder asynchronousWorkflowsBuilder, BroadcastChannel<String> preResponseStoredNotifications, HttpResponseMaker httpResponseMaker, ResponseFormatResolver formatResolver, DataApiRequestFactory dataApiRequestFactory, ResponseProcessorFactory responseProcessorFactory)
resourceDictionaries
- Dictionary holderdruidQueryBuilder
- A builder for converting API Requests into Druid QueriestemplateDruidQueryMerger
- A helper to merge TemplateDruidQueries togetherdruidResponseParser
- Parses Druid responsesworkflowProvider
- Provides the static workflow for the systemrequestMapper
- Allows for overriding the API requestobjectMappers
- JSON serialization toolsfilterBuilder
- Helper to build filtershavingGenerator
- Helper to generate havinggranularityParser
- Helper for parsing granularitiesjobPayloadBuilder
- The factory for building a view of the JobRow that is sent to the userjobRowBuilder
- The JobRows factoryasynchronousWorkflowsBuilder
- The factory for building the asynchronous workflowpreResponseStoredNotifications
- The broadcast channel responsible for notifying other Bard processeshttpResponseMaker
- The factory for building HTTP responses
that a query has been completed and its results stored in theformatResolver
- The formatResolver for determining correct response formatdataApiRequestFactory
- A factory to build dataApiRequests
PreResponseStore
responseProcessorFactory
- Builds the object that performs post processing on a Druid response@GET @Timed @Produces(value="application/json") @Path(value="/{tableName}/{timeGrain}") public void getNoDimensionData(@Context javax.ws.rs.core.UriInfo uriInfo, @Context javax.ws.rs.container.ContainerRequestContext containerRequestContext, @PathParam(value="tableName") String tableName, @PathParam(value="timeGrain") String timeGrain, @QueryParam(value="metrics") String metrics, @QueryParam(value="dateTime") String intervals, @QueryParam(value="filters") String filters, @QueryParam(value="having") String havings, @QueryParam(value="sort") String sorts, @QueryParam(value="count") String count, @QueryParam(value="topN") String topN, @QueryParam(value="format") String format, @QueryParam(value="timeZone") String timeZone, @QueryParam(value="asyncAfter") String asyncAfter, @DefaultValue(value="") @NotNull @QueryParam(value="perPage") String perPage, @DefaultValue(value="") @NotNull @QueryParam(value="page") String page, @DefaultValue(value="true") @NotNull @QueryParam(value="_cache") Boolean readCache, @Suspended javax.ws.rs.container.AsyncResponse asyncResponse)
The path for this method allows us to match on URLs without dimensions that don't have a trailing slash.
uriInfo
- UriInfo of the requestcontainerRequestContext
- Http request contexttableName
- Requested Logical TableNametimeGrain
- Frequency of the requestmetrics
- Requested list of metrics (as a formatted string)intervals
- Requested list of intervals (as a formatted string)filters
- Requested list of filters (as a formatted string)havings
- Requested list of having queries (as a formatted string)sorts
- Requested sorting (as a formatted string)count
- Requested number of rows in the response (as a formatted string)topN
- Requested number of first rows per time bucket in the response (as a formatted string)format
- Requested formattimeZone
- Requested time zone (impacts day based granularities and intervals)asyncAfter
- The maximum time length (in milliseconds) a request is allowed to be synchronous before
becoming asynchronous, if "never" then the request is forever synchronousperPage
- Requested number of rows of data to be displayed on each page of resultspage
- Requested page of results desiredreadCache
- false to bypass cacheasyncResponse
- An async response that we can use to respond asynchronously@GET @Timed @Produces(value="application/json") @Path(value="/{tableName}/{timeGrain}/{dimensions:.*}") public void getData(@Context javax.ws.rs.core.UriInfo uriInfo, @Context javax.ws.rs.container.ContainerRequestContext containerRequestContext, @PathParam(value="tableName") String tableName, @PathParam(value="timeGrain") String timeGrain, @PathParam(value="dimensions") List<javax.ws.rs.core.PathSegment> dimensions, @QueryParam(value="metrics") String metrics, @QueryParam(value="dateTime") String intervals, @QueryParam(value="filters") String filters, @QueryParam(value="having") String havings, @QueryParam(value="sort") String sorts, @QueryParam(value="count") String count, @QueryParam(value="topN") String topN, @QueryParam(value="format") String format, @QueryParam(value="timeZone") String timeZone, @QueryParam(value="asyncAfter") String asyncAfter, @DefaultValue(value="") @NotNull @QueryParam(value="perPage") String perPage, @DefaultValue(value="") @NotNull @QueryParam(value="page") String page, @DefaultValue(value="true") @NotNull @QueryParam(value="_cache") Boolean readCache, @Suspended javax.ws.rs.container.AsyncResponse asyncResponse)
uriInfo
- UriInfo of the requestcontainerRequestContext
- Http request contexttableName
- Requested Logical TableNametimeGrain
- Frequency of the requestdimensions
- Requested list of metrics (as a formatted string)metrics
- Requested list of metrics (as a formatted string)intervals
- Requested list of intervals (as a formatted string)filters
- Requested list of filters (as a formatted string)havings
- Requested list of havings (as a formatted string)sorts
- Requested sorting (as a formatted string)count
- Requested number of rows in the response (as a formatted string)topN
- Requested number of first rows per time bucket in the response (as a formatted string)timeZone
- Requested time zone (impacts day based granularities and intervals)format
- Requested formatasyncAfter
- The maximum time length (in milliseconds) a request is allowed to be synchronous before
becoming asynchronous, if "never" then the request is forever synchronousperPage
- Requested number of rows of data to be displayed on each page of resultspage
- Requested page of results desiredreadCache
- false to bypass cacheasyncResponse
- An async response that we can use to respond asynchronouslypublic DruidResponseParser getDruidResponseParser()
public DruidFilterBuilder getFilterBuilder()
BardConfigResources
getFilterBuilder
in interface BardConfigResources
public HavingGenerator getHavingApiGenerator()
BardConfigResources
getHavingApiGenerator
in interface BardConfigResources
public com.fasterxml.jackson.databind.ObjectWriter getWriter()
public ObjectMappersSuite getObjectMappers()
public RequestMapper getRequestMapper()
public DataRequestHandler getDataRequestHandler()
public TemplateDruidQueryMerger getTemplateDruidQueryMerger()
public DruidQueryBuilder getDruidQueryBuilder()
public org.joda.time.DateTimeZone getSystemTimeZone()
BardConfigResources
getSystemTimeZone
in interface BardConfigResources
public ResourceDictionaries getResourceDictionaries()
BardConfigResources
getResourceDictionaries
in interface BardConfigResources
public GranularityParser getGranularityParser()
BardConfigResources
getGranularityParser
in interface BardConfigResources
Copyright © 2016–2018 Yahoo! Inc.. All rights reserved.