diff --git a/search-app/src/cmr/search/api/association.clj b/search-app/src/cmr/search/api/association.clj index 80a0f04dc1..721a730737 100644 --- a/search-app/src/cmr/search/api/association.clj +++ b/search-app/src/cmr/search/api/association.clj @@ -8,8 +8,7 @@ [cmr.common.util :as util] [cmr.search.services.association-service :as assoc-service] [cmr.search.services.association-validation :as assoc-validation] - [compojure.core :refer :all] - [compojure.route :as route])) + [compojure.core :refer :all])) (defn- validate-association-content-type "Validates that content type sent with a association is JSON." diff --git a/search-app/src/cmr/search/api/community_usage_metrics.clj b/search-app/src/cmr/search/api/community_usage_metrics.clj index 91835ef700..06e8f39844 100644 --- a/search-app/src/cmr/search/api/community_usage_metrics.clj +++ b/search-app/src/cmr/search/api/community_usage_metrics.clj @@ -7,10 +7,8 @@ [cmr.acl.core :as acl] [cmr.common-app.api.routes :as cr] [cmr.common.mime-types :as mt] - [cmr.common.services.errors :as errors] [cmr.search.services.community-usage-metrics.metrics-service :as metrics-service] - [compojure.core :refer :all] - [compojure.route :as route])) + [compojure.core :refer :all])) (defn- community-usage-metrics-response "Creates a successful community usage metrics response with the given data response" diff --git a/search-app/src/cmr/search/api/concepts_search.clj b/search-app/src/cmr/search/api/concepts_search.clj index 59cb36f038..04586bbcdb 100644 --- a/search-app/src/cmr/search/api/concepts_search.clj +++ b/search-app/src/cmr/search/api/concepts_search.clj @@ -3,13 +3,12 @@ (:require [cheshire.core :as json] [clojure.string :as string] - [clojure.walk :as walk] [cmr.common-app.api.launchpad-token-validation :refer [get-token-type]] [cmr.common-app.api.routes :as common-routes] [cmr.common-app.config :as common-app-config] [cmr.common-app.services.search :as search] [cmr.common.cache :as cache] - [cmr.common.config :as cfg :refer [defconfig]] + [cmr.common.config :refer [defconfig]] [cmr.common.generics :as common-generic] [cmr.common.log :refer (debug info warn error)] [cmr.common.mime-types :as mt] @@ -20,8 +19,7 @@ [cmr.search.services.query-service :as query-svc] [cmr.search.services.result-format-helper :as rfh] [cmr.search.validators.all-granule-validation :as all-gran-validation] - [compojure.core :refer :all] - [inflections.core :as inf])) + [compojure.core :refer :all])) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Constants and Utility Functions @@ -361,7 +359,7 @@ (json/parse-string true) :scroll_id)] (do - (info (format "Clear scroll: %s" short-scroll-id)) + (debug (format "Clear scroll: %s" short-scroll-id)) ;; if the short scroll id is valid, retrieve the real scroll id (if-let [scroll-id (->> short-scroll-id (core-api/get-scroll-id-and-search-params-from-cache context) diff --git a/search-app/src/cmr/search/api/services.clj b/search-app/src/cmr/search/api/services.clj index deb5123755..e6ee5c8a9c 100644 --- a/search-app/src/cmr/search/api/services.clj +++ b/search-app/src/cmr/search/api/services.clj @@ -2,8 +2,7 @@ "Defines the API for associating/dissociating services with collections in the CMR." (:require [cmr.search.api.association :as association] - [compojure.core :refer :all] - [compojure.route :as route])) + [compojure.core :refer :all])) (def service-api-routes (context "/services" [] diff --git a/search-app/src/cmr/search/api/tags.clj b/search-app/src/cmr/search/api/tags.clj index fde9fb975b..65e187f5f2 100644 --- a/search-app/src/cmr/search/api/tags.clj +++ b/search-app/src/cmr/search/api/tags.clj @@ -5,15 +5,13 @@ [clojure.string :as string] [cmr.acl.core :as acl] [cmr.common-app.api.enabled :as common-enabled] - [cmr.common-app.api.launchpad-token-validation :as lt-validation] [cmr.common.log :refer (debug info warn error)] [cmr.common.mime-types :as mt] [cmr.common.services.errors :as errors] [cmr.common.util :as util] [cmr.search.services.tagging-service :as tagging-service] [cmr.transmit.config :as transmit-config] - [compojure.core :refer :all] - [compojure.route :as route])) + [compojure.core :refer :all])) (defn- validate-tag-content-type "Validates that content type sent with a tag is JSON" @@ -81,7 +79,7 @@ (verify-tag-modification-permission context :update) (common-enabled/validate-write-enabled context "search") (validate-tag-content-type headers) - (info (format "Tagging [%s] on collections: %s by client: %s." + (debug (format "Tagging [%s] on collections: %s by client: %s." tag-key body (:client-id context))) (tag-api-response (tagging-service/associate-tag-to-collections context tag-key body))) @@ -91,7 +89,7 @@ (verify-tag-modification-permission context :update) (common-enabled/validate-write-enabled context "search") (validate-tag-content-type headers) - (info (format "Dissociating tag [%s] from collections: %s by client: %s." + (debug (format "Dissociating tag [%s] from collections: %s by client: %s." tag-key body (:client-id context))) (tag-api-response (tagging-service/dissociate-tag-to-collections context tag-key body))) @@ -101,7 +99,7 @@ (verify-tag-modification-permission context :update) (common-enabled/validate-write-enabled context "search") (validate-tag-content-type headers) - (info (format "Tagging [%s] on collections by query: %s by client: %s." + (debug (format "Tagging [%s] on collections by query: %s by client: %s." tag-key body (:client-id context))) (tag-api-response (tagging-service/associate-tag-by-query context tag-key body))) @@ -111,7 +109,7 @@ (verify-tag-modification-permission context :update) (common-enabled/validate-write-enabled context "search") (validate-tag-content-type headers) - (info (format "Dissociating tag [%s] from collections by query: %s by client: %s." + (debug (format "Dissociating tag [%s] from collections by query: %s by client: %s." tag-key body (:client-id context))) (tag-api-response (tagging-service/dissociate-tag-by-query context tag-key body))) diff --git a/search-app/src/cmr/search/api/tools.clj b/search-app/src/cmr/search/api/tools.clj index 4884d8fc61..8afa5aa541 100644 --- a/search-app/src/cmr/search/api/tools.clj +++ b/search-app/src/cmr/search/api/tools.clj @@ -2,8 +2,7 @@ "Defines the API for associating/dissociating tools with collections in the CMR." (:require [cmr.search.api.association :as association] - [compojure.core :refer :all] - [compojure.route :as route])) + [compojure.core :refer :all])) (def tool-api-routes (context "/tools" [] diff --git a/search-app/src/cmr/search/data/complex_to_simple_converters/has_granules.clj b/search-app/src/cmr/search/data/complex_to_simple_converters/has_granules.clj index bfbad338f0..ea310b50d5 100644 --- a/search-app/src/cmr/search/data/complex_to_simple_converters/has_granules.clj +++ b/search-app/src/cmr/search/data/complex_to_simple_converters/has_granules.clj @@ -2,7 +2,6 @@ (:require [cmr.elastic-utils.search.query-transform :as c2s] [cmr.common.services.search.query-model :as cqm] - [cmr.search.models.query :as qm] [cmr.search.services.query-execution.has-granules-results-feature :as has-granules-base])) ;; The following protocol implementation ensures that a c.s.m.q.HasGranulesCondition record in our diff --git a/search-app/src/cmr/search/data/complex_to_simple_converters/has_granules_or_cwic.clj b/search-app/src/cmr/search/data/complex_to_simple_converters/has_granules_or_cwic.clj index de7fc71c45..d3876d201a 100644 --- a/search-app/src/cmr/search/data/complex_to_simple_converters/has_granules_or_cwic.clj +++ b/search-app/src/cmr/search/data/complex_to_simple_converters/has_granules_or_cwic.clj @@ -2,7 +2,6 @@ (:require [cmr.elastic-utils.search.query-transform :as c2s] [cmr.common.services.search.query-model :as cqm] - [cmr.search.models.query :as qm] [cmr.search.services.query-execution.has-granules-or-cwic-results-feature :as has-gran-or-cwic-base] [cmr.search.services.query-execution.has-granules-results-feature :as has-granules-base])) diff --git a/search-app/src/cmr/search/data/complex_to_simple_converters/two_d_coordinate_system.clj b/search-app/src/cmr/search/data/complex_to_simple_converters/two_d_coordinate_system.clj index 5f33fab4e0..eda07b2161 100644 --- a/search-app/src/cmr/search/data/complex_to_simple_converters/two_d_coordinate_system.clj +++ b/search-app/src/cmr/search/data/complex_to_simple_converters/two_d_coordinate_system.clj @@ -3,8 +3,7 @@ protocol for two d coordinate system related search fields." (:require [cmr.common.services.search.query-model :as qm] [cmr.elastic-utils.search.es-group-query-conditions :as gc] - [cmr.elastic-utils.search.query-transform :as c2s] - [cmr.common.services.errors :as errors])) + [cmr.elastic-utils.search.query-transform :as c2s])) (defprotocol ConvertCoordinateCondition (coordinate-cond->condition diff --git a/search-app/src/cmr/search/data/elastic_search_index.clj b/search-app/src/cmr/search/data/elastic_search_index.clj index 15c6c459ab..330b4d27f8 100644 --- a/search-app/src/cmr/search/data/elastic_search_index.clj +++ b/search-app/src/cmr/search/data/elastic_search_index.clj @@ -3,7 +3,7 @@ (:require [clojure.string :as string] [cmr.common.concepts :as concepts] - [cmr.common.config :as cfg :refer [defconfig]] + [cmr.common.config :refer [defconfig]] [cmr.common.hash-cache :as hcache] [cmr.common.services.errors :as e] [cmr.common.services.search.query-model :as qm] diff --git a/search-app/src/cmr/search/data/metadata_retrieval/metadata_cache.clj b/search-app/src/cmr/search/data/metadata_retrieval/metadata_cache.clj index 501987239f..f95f5516b8 100644 --- a/search-app/src/cmr/search/data/metadata_retrieval/metadata_cache.clj +++ b/search-app/src/cmr/search/data/metadata_retrieval/metadata_cache.clj @@ -17,7 +17,7 @@ [cmr.common.hash-cache :as hash-cache] [cmr.common.memory-db.connection] [cmr.common.jobs :refer [defjob]] - [cmr.common.log :as log :refer [debug info]] + [cmr.common.log :refer [debug info]] [cmr.common.redis-log-util :as rl-util] [cmr.common.services.errors :as errors] [cmr.common.util :as u] @@ -76,7 +76,8 @@ "Refreshes the collection metadata cache" [context] (info "Refreshing metadata cache") - (let [incremental-since-refresh-date (str (clj-time.core/now)) + (let [start-time (System/currentTimeMillis) + incremental-since-refresh-date (str (clj-time.core/now)) concepts-tuples (cmn-coll-metadata-cache/fetch-collections-from-elastic context) new-cache-value (reduce #(merge %1 (concept-tuples->cache-map context %2)) {} @@ -91,15 +92,16 @@ cmn-coll-metadata-cache/collection-metadata-cache-fields-key (vec (remove nil? (keys new-cache-value)))) (hash-cache/set-values rcache cmn-coll-metadata-cache/cache-key new-cache-value) - (info "Metadata cache refresh complete. Cache Size:" - (hash-cache/cache-size rcache cmn-coll-metadata-cache/cache-key)))) + (info "Metadata cache refresh complete. Took %d ms. Cache Size:" + ((System/currentTimeMillis) - start-time) (hash-cache/cache-size rcache cmn-coll-metadata-cache/cache-key)))) (defn update-cache-job "Updates the collection metadata cache by querying elastic search for updates since the last time the cache was updated." [context] (info "Updating collection metadata cache") - (let [cache (hash-cache/context->cache context cmn-coll-metadata-cache/cache-key) + (let [start-time (System/currentTimeMillis) + cache (hash-cache/context->cache context cmn-coll-metadata-cache/cache-key) incremental-since-refresh-date (str (t/now)) concepts-tuples (cmn-coll-metadata-cache/fetch-updated-collections-from-elastic context) new-cache-value (reduce #(merge %1 (concept-tuples->cache-map context %2)) @@ -121,7 +123,7 @@ (hash-cache/set-values cache cmn-coll-metadata-cache/cache-key new-cache-value) - (info "Metadata cache update complete. Cache Size:" (hash-cache/cache-size cache cmn-coll-metadata-cache/cache-key)))) + (info "Metadata cache update complete. Took %d ms. Cache Size:" ((System/currentTimeMillis) - start-time) (hash-cache/cache-size cache cmn-coll-metadata-cache/cache-key)))) (defn in-memory-db? "Checks to see if the database in the context is an in-memory db." diff --git a/search-app/src/cmr/search/data/query_order_by_expense.clj b/search-app/src/cmr/search/data/query_order_by_expense.clj index ff695902e9..89ce505b30 100644 --- a/search-app/src/cmr/search/data/query_order_by_expense.clj +++ b/search-app/src/cmr/search/data/query_order_by_expense.clj @@ -2,9 +2,7 @@ "Sorts query conditions within a query by their execution expense. Elasticsearch recommend putting cached filters before uncached filters. Expensive queries like exact spatial intersection should be placed last." - (:require [cmr.common.services.errors :as errors] - [cmr.search.models.query :as qm] - [cmr.elastic-utils.search.es-query-order-by-expense :as qobe]) + (:require [cmr.elastic-utils.search.es-query-order-by-expense :as qobe]) (:import [cmr.search.models.query CollectionQueryCondition SpatialCondition diff --git a/search-app/src/cmr/search/middleware/shapefile.clj b/search-app/src/cmr/search/middleware/shapefile.clj index 08179d28c0..f777c3d19c 100644 --- a/search-app/src/cmr/search/middleware/shapefile.clj +++ b/search-app/src/cmr/search/middleware/shapefile.clj @@ -2,9 +2,9 @@ "Contains parameter converters for shapefile parameter" (:require [ring.middleware.multipart-params :refer [wrap-multipart-params]] - [cmr.common.config :as cfg :refer [defconfig]] + [cmr.common.config :refer [defconfig]] [cmr.common.api.errors :as api-errors] - [cmr.common.log :refer [debug error]] + [cmr.common.log :refer [error]] [cmr.common.services.errors :as errors]) (:import (java.io BufferedInputStream File FileReader FileOutputStream FileInputStream) diff --git a/search-app/src/cmr/search/middleware/shapefile_simplification.clj b/search-app/src/cmr/search/middleware/shapefile_simplification.clj index 0730ba1481..857fdef715 100644 --- a/search-app/src/cmr/search/middleware/shapefile_simplification.clj +++ b/search-app/src/cmr/search/middleware/shapefile_simplification.clj @@ -1,11 +1,8 @@ (ns cmr.search.middleware.shapefile-simplification "Middleware to optionally reduce the complexity of shapefiles" (:require - [clojure.java.io :as io] - [cheshire.core :as json] - [cmr.common.config :as cfg :refer [defconfig]] + [cmr.common.config :refer [defconfig]] [cmr.common.api.errors :as api-errors] - [cmr.common.log :refer [debug]] [cmr.common.mime-types :as mt] [cmr.common.services.errors :as errors] [cmr.search.services.parameters.converters.geojson :as geojson] diff --git a/search-app/src/cmr/search/results_handlers/stac_spatial_results_handler.clj b/search-app/src/cmr/search/results_handlers/stac_spatial_results_handler.clj index 0aa6aa4b42..d0763ef6a4 100644 --- a/search-app/src/cmr/search/results_handlers/stac_spatial_results_handler.clj +++ b/search-app/src/cmr/search/results_handlers/stac_spatial_results_handler.clj @@ -1,13 +1,8 @@ (ns cmr.search.results-handlers.stac-spatial-results-handler "A helper for converting spatial shapes into stac results" (:require - [cmr.spatial.cartesian-ring :as cr] [cmr.spatial.derived :as d] - [cmr.spatial.geodetic-ring :as gr] - [cmr.spatial.line-string :as l] - [cmr.spatial.mbr :as m] - [cmr.spatial.point :as p] - [cmr.spatial.polygon :as poly])) + [cmr.spatial.mbr :as m])) (defprotocol stacSpatialHandler "Converts a spatial shape into GeoJSON structures" diff --git a/search-app/src/cmr/search/validators/opendata.clj b/search-app/src/cmr/search/validators/opendata.clj index 2c6d749414..fb12ea76de 100644 --- a/search-app/src/cmr/search/validators/opendata.clj +++ b/search-app/src/cmr/search/validators/opendata.clj @@ -1,7 +1,6 @@ (ns cmr.search.validators.opendata "Validate Opendata formatted collections against JSON schema in /resources/schema" (:require - [clojure.java.io :as io] [cmr.common.validations.json-schema :as json-schema])) (defn- load-opendata-schema diff --git a/search-app/test/cmr/search/test/unit/data/query_to_elastic_converters/keyword_wildcards.clj b/search-app/test/cmr/search/test/unit/data/query_to_elastic_converters/keyword_wildcards.clj index bc129f6c35..1a1182d8fe 100644 --- a/search-app/test/cmr/search/test/unit/data/query_to_elastic_converters/keyword_wildcards.clj +++ b/search-app/test/cmr/search/test/unit/data/query_to_elastic_converters/keyword_wildcards.clj @@ -2,7 +2,7 @@ "This test tests the pure functions get-validate-keyword-wildcards-msg" (:require [clojure.test :refer :all] - [cmr.common.util :as u :refer [are3]] + [cmr.common.util :refer [are3]] [cmr.search.data.query-to-elastic :as query-to-elastic])) (deftest get-validate-keyword-wildcards-msg-test diff --git a/search-app/test/cmr/search/test/unit/results_handlers/opendata_results_handler.clj b/search-app/test/cmr/search/test/unit/results_handlers/opendata_results_handler.clj index 540cf433a6..1ea12b2af2 100644 --- a/search-app/test/cmr/search/test/unit/results_handlers/opendata_results_handler.clj +++ b/search-app/test/cmr/search/test/unit/results_handlers/opendata_results_handler.clj @@ -2,7 +2,7 @@ "This tests the opendata-results-handler namespace." (:require [clojure.test :refer :all] - [cmr.common.util :as util :refer [are3]] + [cmr.common.util :refer [are3]] [cmr.search.results-handlers.opendata-results-handler :as opendata-results-handler])) (deftest distribution-is-downloadable diff --git a/search-app/test/cmr/search/test/unit/results_handlers/results_handler_util.clj b/search-app/test/cmr/search/test/unit/results_handlers/results_handler_util.clj index da3e483067..a7a4dd90a4 100644 --- a/search-app/test/cmr/search/test/unit/results_handlers/results_handler_util.clj +++ b/search-app/test/cmr/search/test/unit/results_handlers/results_handler_util.clj @@ -1,6 +1,6 @@ (ns cmr.search.test.unit.results-handlers.results-handler-util (:require [clojure.test :refer :all] - [cmr.common.util :as util :refer [are3]] + [cmr.common.util :refer [are3]] [cmr.search.results-handlers.results-handler-util :as rs-util])) (deftest convert-associations-test diff --git a/search-app/test/cmr/search/test/unit/results_handlers/stac_results_handler.clj b/search-app/test/cmr/search/test/unit/results_handlers/stac_results_handler.clj index fd0cb299a7..e64c89a151 100644 --- a/search-app/test/cmr/search/test/unit/results_handlers/stac_results_handler.clj +++ b/search-app/test/cmr/search/test/unit/results_handlers/stac_results_handler.clj @@ -3,8 +3,7 @@ (:require [clojure.test :refer :all] [cmr.common.util :as util :refer [are3]] - [cmr.search.results-handlers.stac-results-handler :as stac-results-handler] - [ring.util.codec :as codec])) + [cmr.search.results-handlers.stac-results-handler :as stac-results-handler])) (def ^:private metadata-link "example metadata-link for test" diff --git a/search-app/test/cmr/search/test/unit/results_handlers/stac_spatial_results_handler.clj b/search-app/test/cmr/search/test/unit/results_handlers/stac_spatial_results_handler.clj index 0e755aa4ea..6018eace7c 100644 --- a/search-app/test/cmr/search/test/unit/results_handlers/stac_spatial_results_handler.clj +++ b/search-app/test/cmr/search/test/unit/results_handlers/stac_spatial_results_handler.clj @@ -1,11 +1,8 @@ (ns cmr.search.test.unit.results-handlers.stac-spatial-results-handler (:require [clojure.test :refer :all] - [cmr.common.util :as util :refer [are3]] + [cmr.common.util :refer [are3]] [cmr.search.results-handlers.stac-spatial-results-handler :as ssrh] - [cmr.spatial.cartesian-ring :as cr] - [cmr.spatial.derived :as d] - [cmr.spatial.geodetic-ring :as gr] [cmr.spatial.ring-relations :as rr] [cmr.spatial.line-string :as l] [cmr.spatial.mbr :as m] diff --git a/search-app/test/cmr/search/test/unit/results_handlers/timeline_results_handler.clj b/search-app/test/cmr/search/test/unit/results_handlers/timeline_results_handler.clj index ca47ede38f..10692a7cfa 100644 --- a/search-app/test/cmr/search/test/unit/results_handlers/timeline_results_handler.clj +++ b/search-app/test/cmr/search/test/unit/results_handlers/timeline_results_handler.clj @@ -1,11 +1,7 @@ (ns cmr.search.test.unit.results-handlers.timeline-results-handler (:require [clojure.test :refer :all] - [cmr.common.test.test-check-ext :refer [defspec]] - [clojure.test.check.properties :refer [for-all]] - [clojure.test.check.generators :as gen] [cmr.search.results-handlers.timeline-results-handler :as trh] - [clj-time.core :as t] - [clj-time.coerce :as c])) + [clj-time.core :as t])) (deftest adjacent-interval-test (testing "year" diff --git a/search-app/test/cmr/search/test/unit/services/acls/granule_acls.clj b/search-app/test/cmr/search/test/unit/services/acls/granule_acls.clj index 360b69a109..30920734f7 100644 --- a/search-app/test/cmr/search/test/unit/services/acls/granule_acls.clj +++ b/search-app/test/cmr/search/test/unit/services/acls/granule_acls.clj @@ -4,7 +4,7 @@ [cmr.common.hash-cache :as hash-cache] [cmr.redis-utils.config :as redis-config] [cmr.redis-utils.redis-hash-cache :as redis-hash-cache] - [cmr.common.util :as util :refer [are3]] + [cmr.common.util :refer [are3]] [cmr.redis-utils.test.test-util :as test-util] [cmr.search.services.acls.granule-acls :as g]))