public List<String> getDimensions(
     String collection, MultivaluedMap<String, String> selectedDimensionValues) throws Exception {
   CollectionSchema schema = dataCache.getCollectionSchema(serverUri, collection);
   Set<String> selectedDimensions =
       (selectedDimensionValues == null ? null : selectedDimensionValues.keySet());
   if (CollectionUtils.isEmpty(selectedDimensions)) {
     return schema.getDimensions();
   }
   List<String> filteredDimensions =
       new ArrayList<>(CollectionUtils.subtract(schema.getDimensions(), selectedDimensions));
   Collections.sort(filteredDimensions);
   return filteredDimensions;
 }
 /**
  * Return a sorted map of dimension -> aliases for the provided collection. If no alias exists,
  * 'null' will be returned in the JSON response. This method does not filter out pre-selected
  * dimensions.
  */
 @GET
 @Path("/dimensionAliases/{collection}")
 public Map<String, String> getDimensionAliases(@PathParam("collection") String collection)
     throws Exception {
   CollectionSchema schema = dataCache.getCollectionSchema(serverUri, collection);
   Iterator<String> dimensionsIter = schema.getDimensions().iterator();
   Iterator<String> dimensionAliasesIter = schema.getDimensionAliases().iterator();
   Map<String, String> aliasMap = new TreeMap<>();
   while (dimensionsIter.hasNext()) {
     String dimension = dimensionsIter.next();
     String dimensionAlias = dimensionAliasesIter.next();
     aliasMap.put(dimension, dimensionAlias);
   }
   return aliasMap;
 }
  /**
   * Return a list of metric aliases for the provided collection. If no alias exists, 'null' will be
   * returned in the JSON response.
   */
  @GET
  @Path("/metricAliases/{collection}")
  public Map<String, String> getMetricAliases(@PathParam("collection") String collection)
      throws Exception {
    CollectionSchema schema = dataCache.getCollectionSchema(serverUri, collection);
    List<String> metricAliases = schema.getMetricAliases();

    Iterator<String> metricsIter = getMetrics(collection).iterator();
    Iterator<String> metricAliasesIter = metricAliases.iterator();
    Map<String, String> aliasMap = new TreeMap<>();
    while (metricsIter.hasNext()) {
      String metric = metricsIter.next();
      String metricAlias = metricAliasesIter.next();
      aliasMap.put(metric, metricAlias);
    }

    return aliasMap;
  }
 public List<String> getMetricAliasesAsList(String collection) throws Exception {
   CollectionSchema schema = dataCache.getCollectionSchema(serverUri, collection);
   return schema.getMetricAliases();
 }
 /** Return a list of metrics for the provided collection. */
 @GET
 @Path("/metrics/{collection}")
 public List<String> getMetrics(@PathParam("collection") String collection) throws Exception {
   CollectionSchema schema = dataCache.getCollectionSchema(serverUri, collection);
   return schema.getMetrics();
 }