File tree Expand file tree Collapse file tree
elastic-utils-lib/src/cmr/elastic_utils/search
indexer-app/src/cmr/indexer/data
search-app/src/cmr/search/data Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6363 (let [index-names-map (fetch-concept-type-index-names context)
6464 index-names (:index-names index-names-map)
6565 cache (hcache/context->cache context index-names-cache-key)]
66+ (info (str " Refreshing search index-names cache - index-names: " index-names))
6667 (hcache/set-values cache index-names-cache-key index-names)
6768 (hcache/set-value cache
6869 index-names-cache-key
Original file line number Diff line number Diff line change 245245(defn refresh-cache
246246 " Refreshes the collection granule aggregates in the cache."
247247 [context granules-updated-in-last-n]
248- (let [_cache (c/context->cache context coll-gran-aggregate-cache-key)]
248+ (let [_cache (c/context->cache context coll-gran-aggregate-cache-key)
249+ start (System/currentTimeMillis )]
250+ (if granules-updated-in-last-n
251+ (info " Refreshing partial collection granule aggregates cache." )
252+ (info " Refreshing full collection granule aggregates cache." ))
249253 (if granules-updated-in-last-n
250254 (partial-cache-refresh context granules-updated-in-last-n)
251- (full-cache-refresh context))))
255+ (full-cache-refresh context))
256+ (if granules-updated-in-last-n
257+ (info (format " Refreshed partial collection granule aggregates cache took %d ms" (- (System/currentTimeMillis ) start)))
258+ (info (format " Refreshed full collection granule aggregates cache took %d ms" (- (System/currentTimeMillis ) start))))))
252259
253260(defn get-coll-gran-aggregates
254261 " Returns the map of granule aggregate information for the collection. Will return nil if the
Original file line number Diff line number Diff line change 55 [cmr.common.concepts :as concepts]
66 [cmr.common.config :as cfg :refer [defconfig ]]
77 [cmr.common.hash-cache :as hcache]
8+ [cmr.common.util :as util]
89 [cmr.common.services.errors :as e]
910 [cmr.common.services.search.query-model :as qm]
1011 [cmr.elastic-utils.search.es-index :as common-esi]
4041 rebalancing-collections (hcache/get-value cache cache-key :rebalancing-collections )]
4142 (apply dissoc granule-index-names (map keyword rebalancing-collections))))
4243(comment
43- (keyword " word " )
44+ (println indexes )
4445 )
4546(defn- collection-concept-id->index-name
4647 " Return the granule index name for the input collection concept id"
4748 [indexes coll-concept-id]
4849 (def indexes indexes )
4950 (def coll-concept-id coll-concept-id )
5051 (get indexes (keyword coll-concept-id) (if (cfg/provider-granules )
51- (get indexes (keyword (str " granule_" (concepts/concept-id->provider-id coll-concept-id))))
52+ (get indexes (keyword (str " granules_" (util/safe-lowercase
53+ (concepts/concept-id->provider-id coll-concept-id)))))
5254 (get indexes :small_collections ))))
5355
5456(defn- collection-concept-ids->index-names
5759 (let [indexes (get-granule-index-names context)]
5860 (distinct (map #(collection-concept-id->index-name indexes %) coll-concept-ids))))
5961
62+ (comment
63+ (println context)
64+ )
6065(defn- provider-ids->index-names
6166 " Return the granule index names for the input provider-ids"
6267 [context provider-ids]
You can’t perform that action at this time.
0 commit comments