public class ResponseData extends Object
| Modifier and Type | Field and Description |
|---|---|
protected LinkedHashSet<MetricColumn> |
apiMetricColumns |
protected static Map<Dimension,Map<DimensionField,String>> |
DIMENSION_FIELD_COLUMN_NAMES |
protected static org.slf4j.Logger |
LOG |
protected SimplifiedIntervalList |
missingIntervals |
protected Pagination |
pagination |
protected Map<String,URI> |
paginationLinks |
protected LinkedHashMap<Dimension,LinkedHashSet<DimensionField>> |
requestedApiDimensionFields |
protected ResultSet |
resultSet |
protected SimplifiedIntervalList |
volatileIntervals |
| Constructor and Description |
|---|
ResponseData(ResultSet resultSet,
DataApiRequest apiRequest,
SimplifiedIntervalList missingIntervals,
SimplifiedIntervalList volatileIntervals,
Pagination pagination,
Map<String,URI> paginationLinks)
Deprecated.
All the values needed to build a Response should be passed explicitly instead of relying on the
DataApiRequest
|
ResponseData(ResultSet resultSet,
LinkedHashSet<String> apiMetricColumnNames,
LinkedHashMap<Dimension,LinkedHashSet<DimensionField>> requestedApiDimensionFields,
SimplifiedIntervalList missingIntervals,
SimplifiedIntervalList volatileIntervals,
Pagination pagination,
Map<String,URI> paginationLinks)
Constructor.
|
protected static final org.slf4j.Logger LOG
protected static final Map<Dimension,Map<DimensionField,String>> DIMENSION_FIELD_COLUMN_NAMES
protected final ResultSet resultSet
protected final LinkedHashSet<MetricColumn> apiMetricColumns
protected final LinkedHashMap<Dimension,LinkedHashSet<DimensionField>> requestedApiDimensionFields
protected final SimplifiedIntervalList missingIntervals
protected final SimplifiedIntervalList volatileIntervals
protected final Pagination pagination
public ResponseData(ResultSet resultSet, LinkedHashSet<String> apiMetricColumnNames, LinkedHashMap<Dimension,LinkedHashSet<DimensionField>> requestedApiDimensionFields, SimplifiedIntervalList missingIntervals, SimplifiedIntervalList volatileIntervals, Pagination pagination, Map<String,URI> paginationLinks)
resultSet - ResultSet to turn into responseapiMetricColumnNames - The names of the logical metrics requestedrequestedApiDimensionFields - The fields for each dimension that should be shown in the responsemissingIntervals - intervals over which partial data existsvolatileIntervals - intervals over which data is understood as 'best-to-date'pagination - The object containing the pagination information. Null if we are not paginating.paginationLinks - A mapping from link names to links to be added to the end of the JSON response.@Deprecated public ResponseData(ResultSet resultSet, DataApiRequest apiRequest, SimplifiedIntervalList missingIntervals, SimplifiedIntervalList volatileIntervals, Pagination pagination, Map<String,URI> paginationLinks)
resultSet - ResultSet to turn into responseapiRequest - API Request to get the metric columns frommissingIntervals - intervals over which partial data existsvolatileIntervals - intervals over which data is understood as 'best-to-date'pagination - The object containing the pagination information. Null if we are not paginating.paginationLinks - A mapping from link names to links to be added to the end of the JSON response.public ResultSet getResultSet()
public SimplifiedIntervalList getMissingIntervals()
public SimplifiedIntervalList getVolatileIntervals()
public Pagination getPagination()
public LinkedHashMap<Dimension,LinkedHashSet<DimensionField>> getRequestedApiDimensionFields()
public LinkedHashSet<MetricColumn> getApiMetricColumns()
protected LinkedHashSet<MetricColumn> generateApiMetricColumns(Set<String> apiMetricColumnNames)
apiMetricColumnNames - Set of Metric names extracted from the requested api metricspublic Stream<String> generateDimensionColumnHeaders(Map.Entry<Dimension,LinkedHashSet<DimensionField>> entry)
entry - Entry to base the columns on.public Map<String,Object> buildResultRow(Result result)
result - The result to processpublic Map<String,Object> buildResultRowWithSidecars(Result result, Map<Dimension,Set<Map<DimensionField,String>>> sidecars)
result - The result to processsidecars - Map of sidecar data (dimension rows in the result)public List<String> buildIntervalStringList(Collection<org.joda.time.Interval> intervals)
intervals - list of intervals to be converted into stringprotected static String getDimensionColumnName(Dimension dimension, DimensionField dimensionField)
dimension - The dimension for the column namedimensionField - The dimensionField for the column nameCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.