@Path(value="/tables") @Singleton public class TablesServlet extends EndpointServlet implements BardConfigResources
objectMappers
Constructor and Description |
---|
TablesServlet(ResourceDictionaries resourceDictionaries,
RequestMapper requestMapper,
ObjectMappersSuite objectMappers,
GranularityParser granularityParser,
ResponseFormatResolver formatResolver)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
getAllTables(String perPage,
String page,
String format,
javax.ws.rs.core.UriInfo uriInfo,
javax.ws.rs.container.ContainerRequestContext containerRequestContext)
Get all the logical tables as a summary list.
|
DruidFilterBuilder |
getFilterBuilder()
Filter builder isn't used in TablesServlet but is part of the configuration interface, so this is an empty
implementation.
|
GranularityParser |
getGranularityParser()
A parser for string to granularities.
|
HavingGenerator |
getHavingApiGenerator()
Having Api generator isn't used in TablesServlet but is part of the configuration interface, so this is an empty
implementation.
|
static Set<Map<String,Object>> |
getLogicalAll(Collection<LogicalTable> logicalTables,
javax.ws.rs.core.UriInfo uriInfo)
Get the summary list view of the logical tables.
|
LogicalTableDictionary |
getLogicalTableDictionary()
The dictionary of logical tables.
|
protected static Map<String,Object> |
getLogicalTableFullView(LogicalTable logicalTable,
javax.ws.rs.core.UriInfo uriInfo)
Deprecated.
In order to display constrained data availability in table resource, this method needs to accept a
TablesApiRequest as a parameter. Use
getLogicalTableFullView(TablesApiRequestImpl, UriInfo) instead. |
protected static Map<String,Object> |
getLogicalTableFullView(TablesApiRequestImpl tablesApiRequest,
javax.ws.rs.core.UriInfo uriInfo)
Get the full view of the logical table.
|
static Set<Map<String,String>> |
getLogicalTableListSummaryView(Collection<LogicalTable> logicalTables,
javax.ws.rs.core.UriInfo uriInfo)
Get the summary list view of the logical tables.
|
static Map<String,String> |
getLogicalTableSummaryView(LogicalTable logicalTable,
javax.ws.rs.core.UriInfo uriInfo)
Get the summary view of the logical table.
|
static String |
getLogicalTableUrl(LogicalTable logicalTable,
javax.ws.rs.core.UriInfo uriInfo)
Get the URL of the logical table.
|
RequestMapper |
getRequestMapper() |
ResourceDictionaries |
getResourceDictionaries()
The collection of resource dictionaries.
|
org.joda.time.DateTimeZone |
getSystemTimeZone()
SystemTimeZone isn't used in TablesServlet but is part of the configuration interface, so this is an empty
implementation.
|
javax.ws.rs.core.Response |
getTable(String tableName,
String perPage,
String page,
String format,
javax.ws.rs.core.UriInfo uriInfo,
javax.ws.rs.container.ContainerRequestContext containerRequestContext)
Get all grain-specific logical tables for a logical table name as a summary list.
|
javax.ws.rs.core.Response |
getTableByGrain(String tableName,
String grain,
javax.ws.rs.core.UriInfo uriInfo,
javax.ws.rs.container.ContainerRequestContext containerRequestContext)
Get unconstrained logical table details for a grain-specific logical table.
|
javax.ws.rs.core.Response |
getTableByGrainAndConstraint(String tableName,
String granularity,
List<javax.ws.rs.core.PathSegment> dimensions,
String metrics,
String intervals,
String filters,
javax.ws.rs.core.UriInfo uriInfo,
javax.ws.rs.container.ContainerRequestContext containerRequestContext)
Get constrained logical table details for a grain-specific logical table.
|
javax.ws.rs.core.Response |
getTablesFullView(String perPage,
String page,
javax.ws.rs.core.UriInfo uriInfo,
javax.ws.rs.container.ContainerRequestContext containerRequestContext)
Get all the tables full view.
|
formatResponse
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDimensionDictionary, getMetricDictionary
@Inject public TablesServlet(ResourceDictionaries resourceDictionaries, @Named(value="tablesApiRequestMapper") RequestMapper requestMapper, ObjectMappersSuite objectMappers, GranularityParser granularityParser, ResponseFormatResolver formatResolver)
resourceDictionaries
- Dictionary holderrequestMapper
- Mapper to change the API request if neededobjectMappers
- JSON toolsgranularityParser
- Helper for parsing granularitiesformatResolver
- The formatResolver for determining correct response format@GET @Timed public javax.ws.rs.core.Response getAllTables(@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
{
"tables": <List of Table Summaries>
}
getLogicalTableListSummaryView(Collection, UriInfo)
@GET @Timed @Path(value="/{tableName}") public javax.ws.rs.core.Response getTable(@PathParam(value="tableName") String tableName, @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)
tableName
- Table to get all the grain-specific logical tables forperPage
- 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
{
"tables": <List of Table Summaries>
}
getLogicalTableListSummaryView(Collection, UriInfo)
@GET @Timed @Produces(value="application/json") @Path(value="/{tableName}/{granularity}") public javax.ws.rs.core.Response getTableByGrain(@PathParam(value="tableName") String tableName, @PathParam(value="granularity") String grain, @Context javax.ws.rs.core.UriInfo uriInfo, @Context javax.ws.rs.container.ContainerRequestContext containerRequestContext)
See getTableByGrainAndConstraint(String, String, List, String, String, String, UriInfo, ContainerRequestContext)
for getting constrained logical table details
tableName
- Logical table name (part of the logical table ID)grain
- Logical table grain (part of the logical table ID)uriInfo
- UriInfo of the requestcontainerRequestContext
- The context of data provided by the Jersey container for this requestTODO: Need to delegate to constrained endpoint
@GET @Timed @Produces(value="application/json") @Path(value="/{tableName}/{granularity}/{dimensions:.*}") public javax.ws.rs.core.Response getTableByGrainAndConstraint(@PathParam(value="tableName") String tableName, @PathParam(value="granularity") String granularity, @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, @Context javax.ws.rs.core.UriInfo uriInfo, @Context javax.ws.rs.container.ContainerRequestContext containerRequestContext)
An example query to this endpoint is
/tables/myTable/week/dim1/dim2?metrics=myMetric&filters=dim3|id-in[foo,bar]
TODO: filter physical tables by interval and filter clause, i.e. "filters=dim3|id-in[foo,bar]".
This query has an optional list of path separated grouping dimensions, an optional list of metrics, and an
optional filter clause.
The query would result in a table response with the metrics, dimensions, and available intervals restricted down to the set of items that are still "reachable" given the constraints in the query (dim1, dim2, dim3, and myMetric, in this case). So, if the table normally indicates that dim7 is one of it's dimensions, but there isn't a backing physical table for myTable that has dim1, dim2, dim3, and myMetric along with dim7, then dim7 would not be in the dimension list returned in the response.
tableName
- Logical table namegranularity
- Logical table grain (part of the logical table ID)dimensions
- Requested list of dimensions (e.g. dim1, dim2)metrics
- Requested list of metrics (e.g. myMetric)intervals
- Requested list of intervals. This is a requiredfilters
- Requested list of filters (e.g. dim3|id-in[foo,bar])uriInfo
- UriInfo of the requestcontainerRequestContext
- The context of data provided by the Jersey container for this requestgetLogicalTableFullView(TablesApiRequestImpl, UriInfo)
@Timed public javax.ws.rs.core.Response getTablesFullView(@DefaultValue(value="") @NotNull @QueryParam(value="perPage") String perPage, @DefaultValue(value="") @NotNull @QueryParam(value="page") String page, @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 fromuriInfo
- UriInfo of the requestcontainerRequestContext
- The context of data provided by the Jersey container for this requestpublic static Set<Map<String,String>> getLogicalTableListSummaryView(Collection<LogicalTable> logicalTables, javax.ws.rs.core.UriInfo uriInfo)
logicalTables
- Collection of logical tables to get the summary view foruriInfo
- UriInfo of the requestpublic static Set<Map<String,Object>> getLogicalAll(Collection<LogicalTable> logicalTables, javax.ws.rs.core.UriInfo uriInfo)
logicalTables
- Collection of logical tables to get the summary view foruriInfo
- UriInfo of the requestpublic static Map<String,String> getLogicalTableSummaryView(LogicalTable logicalTable, javax.ws.rs.core.UriInfo uriInfo)
logicalTable
- Logical table to get the view ofuriInfo
- UriInfo of the request@Deprecated protected static Map<String,Object> getLogicalTableFullView(LogicalTable logicalTable, javax.ws.rs.core.UriInfo uriInfo)
TablesApiRequest
as a parameter. Use
getLogicalTableFullView(TablesApiRequestImpl, UriInfo)
instead.logicalTable
- Logical table to get the view ofuriInfo
- UriInfo of the requestprotected static Map<String,Object> getLogicalTableFullView(TablesApiRequestImpl tablesApiRequest, javax.ws.rs.core.UriInfo uriInfo)
tablesApiRequest
- Table API request that contains information about requested logical table and provides
components for constructing a QueryPlanningConstraint
, which
will be used to filter and constrain table availabilitiesuriInfo
- UriInfo of the requestpublic static String getLogicalTableUrl(LogicalTable logicalTable, javax.ws.rs.core.UriInfo uriInfo)
logicalTable
- Logical table to get the URL ofuriInfo
- URI Info for the requestpublic ResourceDictionaries getResourceDictionaries()
BardConfigResources
getResourceDictionaries
in interface BardConfigResources
public GranularityParser getGranularityParser()
BardConfigResources
getGranularityParser
in interface BardConfigResources
public DruidFilterBuilder getFilterBuilder()
getFilterBuilder
in interface BardConfigResources
public HavingGenerator getHavingApiGenerator()
getHavingApiGenerator
in interface BardConfigResources
public org.joda.time.DateTimeZone getSystemTimeZone()
getSystemTimeZone
in interface BardConfigResources
public RequestMapper getRequestMapper()
public LogicalTableDictionary getLogicalTableDictionary()
BardConfigResources
getLogicalTableDictionary
in interface BardConfigResources
Copyright © 2016–2018 Yahoo! Inc.. All rights reserved.