              tables (if (instance? String tables) [tables] tables)]
          (response
            (regions-by-servers (:regions @cached) (:servers @cached)
-                               (keyword metric) (keyword sort) tables))))
+                               (keyword metric) (keyword sort) tables
+                               {:with-meta? @with-meta?}))))
   (GET "/table_regions.json"
        {{:keys [sort metric]
          :or {sort "metric" metric "store-file-size-mb"}} :params}
        (response
          (regions-by-tables (:regions @cached)
-                            (keyword metric) (keyword sort))))
+                            (keyword metric) (keyword sort)
+                            {:with-meta? @with-meta?})))
   (PUT "/move_region" {{:keys [src dest region]} :params}
        (when @read-only?
          (throw (Exception. "Read-only mode. Not allowed.")))


(defn regions-by-servers
  "Generates output for /server_regions.json. Regions grouped by their servers."
  [regions servers metric sort tables]
  (let [;; Exclude meta regions
        all-regions (remove :meta? regions)

        ;; Sort the tables in descending order by the sum of the given metric
        all-tables (keys (sort-by


(defn regions-by-tables
  "Generates output for /table_regions.json. Regions grouped by their tables."
  [regions metric sort {:keys [with-meta?] :or {with-meta? false}}]
  (let [;; Exclude hbase:meta table
        all-regions (if with-meta? regions (remove :meta? regions))
        ;; Sort the regions
        sorted-regions (if (= sort :metric)
                         (reverse (sort-by metric all-regions))
