diff --git a/common-app-lib/src/cmr/common_app/services/search.clj b/common-app-lib/src/cmr/common_app/services/search.clj index 814491b129..4e22850522 100644 --- a/common-app-lib/src/cmr/common_app/services/search.clj +++ b/common-app-lib/src/cmr/common_app/services/search.clj @@ -115,8 +115,7 @@ ;; use that if so. If the scroll-id is not set and scroll is set to 'defer' then store the ;; search results in the cache and return an empty result (with appropriate headers). Otherwise ;; do normal query/scrolling without using the cache. - (let [_ (println "INSIDE find-concepts...") - scroll-id (:scroll-id query) + (let [scroll-id (:scroll-id query) [results result-str] (or (pop-scroll-results-from-cache context scroll-id) (time-concept-search context query))] (if (and (not scroll-id) (= (:scroll query) "defer")) diff --git a/elastic-utils-lib/src/cmr/elastic_utils/search/query_execution.clj b/elastic-utils-lib/src/cmr/elastic_utils/search/query_execution.clj index 0abb7ccdcb..8955b19c66 100644 --- a/elastic-utils-lib/src/cmr/elastic_utils/search/query_execution.clj +++ b/elastic-utils-lib/src/cmr/elastic_utils/search/query_execution.clj @@ -95,8 +95,7 @@ (defmethod execute-query :elasticsearch [context query] - (let [_ (println "INSIDE execute-query :elasticsearch") - [context processed-query] (concept-type-specific-query-processing + (let [[context processed-query] (concept-type-specific-query-processing context query) processed-query (pre-process-query-result-features context processed-query) elastic-results (->> processed-query diff --git a/indexer-app/src/cmr/indexer/data/elasticsearch.clj b/indexer-app/src/cmr/indexer/data/elasticsearch.clj index adb14127ae..57f79f9384 100644 --- a/indexer-app/src/cmr/indexer/data/elasticsearch.clj +++ b/indexer-app/src/cmr/indexer/data/elasticsearch.clj @@ -315,13 +315,14 @@ "Save the document in Elasticsearch, raise error if failed." [context es-indexes es-type es-doc concept-id revision-id elastic-version options] (doseq [es-index es-indexes] - (let [_ (println "save-document-in-elastic") + (let [ + ;_ (println "save-document-in-elastic with options = " options) conn (context->conn context) {:keys [ignore-conflict? all-revisions-index?]} options elastic-id (get-elastic-id concept-id revision-id all-revisions-index?) - _ (println (format "es-helper/put with params: es-index %s es-type %s elastic-id %s elastic-version %s" es-index es-type elastic-id elastic-version)) + ;_ (println (format "save-document-in-elastic: es-helper/put with params: es-index %s es-type %s elastic-id %s elastic-version %s" es-index es-type elastic-id elastic-version)) result (try-elastic-operation - es-helper/put conn es-index es-type es-doc elastic-id elastic-version)] ;; For all revisions, it will just pick only the concept-id as the elastic-id. Ummm how is this tombstoning the document? + es-helper/put conn es-index es-type es-doc elastic-id elastic-version)] (when (:error result) (if (= 409 (:status result)) (if ignore-conflict? @@ -342,11 +343,10 @@ ([context es-indexes es-type concept-id revision-id elastic-version] (delete-document context es-indexes es-type concept-id revision-id elastic-version nil)) ([context es-indexes _es-type concept-id revision-id elastic-version options] - (println (format "delete-document params: es-indexes %s ^^^^ _es-type %s ^^^^ concept-id %s ^^^^ revision-id %s ^^^^ elastic-version %s ^^^^ options %s ^^^^ " es-indexes _es-type concept-id revision-id elastic-version options)) + ;(println (format "delete-document params: es-indexes %s ^^^^ _es-type %s ^^^^ concept-id %s ^^^^ revision-id %s ^^^^ elastic-version %s ^^^^ options %s ^^^^ " es-indexes _es-type concept-id revision-id elastic-version options)) (doseq [es-index es-indexes] ;; Cannot use elastisch for deletion as we require special headers on delete - (let [_ (println "delete document in elastic !!!!") - {:keys [admin-token]} (context->es-config context) + (let [{:keys [admin-token]} (context->es-config context) {:keys [uri http-opts]} (context->conn context) {:keys [ignore-conflict? all-revisions-index?]} options elastic-id (get-elastic-id concept-id revision-id all-revisions-index?) @@ -354,7 +354,6 @@ (format "%s/%s/_doc/%s?version=%s&version_type=external_gte" uri es-index elastic-id elastic-version) (format "%s/%s/_doc/%s" uri es-index elastic-id)) - _ (println "delete-document: delete-url is " delete-url) response (client/delete delete-url (merge http-opts {:headers {"Authorization" admin-token diff --git a/indexer-app/src/cmr/indexer/services/event_handler.clj b/indexer-app/src/cmr/indexer/services/event_handler.clj index 33c3cf991a..39182515c2 100644 --- a/indexer-app/src/cmr/indexer/services/event_handler.clj +++ b/indexer-app/src/cmr/indexer/services/event_handler.clj @@ -80,12 +80,13 @@ (defmethod handle-ingest-event :concept-delete [context all-revisions-index? {:keys [concept-id revision-id]}] - (println "INSIDE handle-ingest-event JYNA with all-revisions-index = " all-revisions-index?) + ;(println "INSIDE handle-ingest-event JYNA with all-revisions-index = " all-revisions-index?) (when-not (= :humanizer (cc/concept-id->type concept-id)) (let [[tm result] (util/time-execution (indexer/delete-concept context concept-id revision-id {:ignore-conflict? true :all-revisions-index? all-revisions-index?}))] + ;(println "Result of handle-ingest-event :concept-delete = " result) (debug (format (str "Timed function %s handle-ingest-event concept-delete for concept-id %s " "revision-id %s all-revisions-index? %s took %d ms.") (str *ns*) concept-id revision-id all-revisions-index? tm)) diff --git a/indexer-app/src/cmr/indexer/services/index_service.clj b/indexer-app/src/cmr/indexer/services/index_service.clj index d748728bf1..2275e05119 100644 --- a/indexer-app/src/cmr/indexer/services/index_service.clj +++ b/indexer-app/src/cmr/indexer/services/index_service.clj @@ -692,73 +692,146 @@ ;; *********************************************** ;; Multi method delete-concept -;; TODO maybe create a new delete-concept for just concept-type collection-draft which will delete the CD from both indices -- create a new pathway for it basically -;; and then have publish-draft-concept only write to one queue... this way we aren't worried about the async issue and just do all the deletes at once (defmulti delete-concept "Delete the concept with the given id" (fn [_context concept-id _revision-id _options] (cs/concept-id->type concept-id))) -;; JYNA this is where the concept delete event goes to in indexer. Indexer picks it up and executes this func. -(defmethod delete-concept :default - [context concept-id revision-id options] - (println (format "****** INSIDE delete-concept :default with params: concept-id %s, revision-id %s, options %s" concept-id revision-id options)) - ;; Assuming ingest will pass enough info for deletion - ;; We should avoid making calls to metadata db to get the necessary info if possible +;(defmethod delete-concept :default +; [context concept-id revision-id options] +; (println (format "****** INSIDE delete-concept :default with params: concept-id %s, revision-id %s, options %s" concept-id revision-id options)) +; ;; Assuming ingest will pass enough info for deletion +; ;; We should avoid making calls to metadata db to get the necessary info if possible +; (let [{:keys [all-revisions-index?]} options +; concept-type (cs/concept-id->type concept-id) +; _ (println "******* INSIDE delete-concept: concept-type is : " concept-type) +; ;; CDs are tombstoned when endpoint /publish is used so why would this throw an error? Now I need to look at real-world examples of what is going on +; ;; Now we are seeing this throw errors Jyna, when we keep creating drafts and publishing to the same collection -- because of the two queues executing at diff times problem +; ;; TODO do we really want this to fail if we can't find the concept in the db? +; concept (meta-db/get-concept context concept-id revision-id) +; _ (println "****** delete-concept: THE CONCEPT RETURNED IN DELETE-CONCEPT. SHOULD BE TOMBSTONED CONCEPT.") ;; this gets back the :delete = true metadata from DB +; _ (println (format "****** concept-id= %s, revision-id = %s, deleted = %s, format =%s, native-id = %s" (:concept-id concept) (:revisions-id concept) (:deleted concept) (:format concept) (:native-id concept))) +; elastic-version (get-elastic-version context concept)] +; (when (indexing-applicable? concept-type all-revisions-index?) +; (println (format "****** delete-concept: Indexing is applicable for concept-type: %s and all-revisions-index %s" concept-type all-revisions-index?)) +; (info (get-concept-delete-log-string concept-type context concept-id revision-id all-revisions-index?)) +; (let [index-names (idx-set/get-concept-index-names context concept-id revision-id options) +; concept-mapping-types (idx-set/get-concept-mapping-types context) +; elastic-options (select-keys options [:all-revisions-index? :ignore-conflict?]) +; _ (println "elastic-options = " elastic-options)] +; (if all-revisions-index? +; ;; save tombstone in all revisions collection index +; (let [_ (println "****** delete-concept: all-revisions-index is true") ;; TODO jyna we go into this section +; es-doc (if (cs/generic-concept? concept-type) +; (es/parsed-concept->elastic-doc context concept (json/parse-string (:metadata concept) true)) +; (es/parsed-concept->elastic-doc context concept (:extra-fields concept))) +; [tm result] (util/time-execution +; (es/save-document-in-elastic +; context index-names (concept-mapping-types concept-type) +; es-doc concept-id revision-id elastic-version elastic-options))] +; (debug (format "Timed function %s/delete-concept saving tombstone in all-revisions-index took %d ms." (str *ns*) tm)) +; (println "****** Saving 'tombstoned' concept resulted in = " result) +; ;; TODO: JYNA Not sure what is going on here... but not convinced that this 'save-document-in-elastic' func is actually deleting the document in elastic like we need it to here... +; result) +; ;; else delete concept from primary concept index +; (do +; (println "****** delete-concept: all-revisions-index is false") +; (es/delete-document +; context index-names (concept-mapping-types concept-type) +; concept-id revision-id elastic-version elastic-options) +; ;; Index a deleted-granule document when granule is deleted +; ;; JYNA all these delete requests to ES are API calls -- are they synchronous? +; (when (= :granule concept-type) +; (let [[tm result] (util/time-execution +; (dg/index-deleted-granule context concept concept-id revision-id elastic-version elastic-options))] +; (debug (format "Timed function %s index-deleted-granule took %d ms." (str *ns*) tm)) +; result)) +; ;; propagate collection deletion to granules +; (when (= :collection concept-type) +; (let [[tm result] (util/time-execution +; (cascade-collection-delete context concept-mapping-types concept-id revision-id))] +; (debug (format "Timed function %s/cascade-collection-delete took %d ms." (str *ns*) tm)) +; result)) +; ))) +; ;; For draft concept, after the index is deleted, remove it from database. +; (when (cs/is-draft-concept? concept-type) +; (println "****** JYNA this is a draft concept will force delete the draft") +; (meta-db/delete-draft context concept)) +; ))) + +(defn- delete-concept-helper + [context concept concept-id revision-id options] (let [{:keys [all-revisions-index?]} options concept-type (cs/concept-id->type concept-id) - ;; CDs are tombstoned when endpoint /publish is used so why would this throw an error? Now I need to look at real-world examples of what is going on - ;; Now we are seeing this throw errors Jyna, when we keep creating drafts and publishing to the same collection -- because of the two queues executing at diff times problem - ;; TODO do we really want this to fail if we can't find the concept in the db? - - concept (meta-db/get-concept context concept-id revision-id) - _ (println "****** delete-concept: THE CONCEPT RETURNED IN DELETE-CONCEPT. SHOULD BE TOMBSTONED CONCEPT.") ;; this gets back the :delete = true metadata from DB - _ (println (format "****** concept-id= %s, revision-id = %s, deleted = %s, format =%s, native-id = %s" (:concept-id concept) (:revisions-id concept) (:deleted concept) (:format concept) (:native-id concept))) elastic-version (get-elastic-version context concept)] (when (indexing-applicable? concept-type all-revisions-index?) - (println "****** delete-concept: Indexing is applicable") + (println (format "****** delete-concept: Indexing is applicable for concept-type: %s and all-revisions-index %s" concept-type all-revisions-index?)) (info (get-concept-delete-log-string concept-type context concept-id revision-id all-revisions-index?)) (let [index-names (idx-set/get-concept-index-names context concept-id revision-id options) concept-mapping-types (idx-set/get-concept-mapping-types context) elastic-options (select-keys options [:all-revisions-index? :ignore-conflict?])] (if all-revisions-index? ;; save tombstone in all revisions collection index - (let [_ (println "****** delete-concept: all-revisions-index is true") ;; TODO jyna we go into this section + (let [ + ;_ (println "****** delete-concept: all-revisions-index is true") es-doc (if (cs/generic-concept? concept-type) (es/parsed-concept->elastic-doc context concept (json/parse-string (:metadata concept) true)) (es/parsed-concept->elastic-doc context concept (:extra-fields concept))) [tm result] (util/time-execution - (es/save-document-in-elastic - context index-names (concept-mapping-types concept-type) - es-doc concept-id revision-id elastic-version elastic-options))] + (es/save-document-in-elastic + context index-names (concept-mapping-types concept-type) + es-doc concept-id revision-id elastic-version elastic-options))] (debug (format "Timed function %s/delete-concept saving tombstone in all-revisions-index took %d ms." (str *ns*) tm)) - (println "****** Saving 'tombstoned' concept resulted in = " result) + ;(println "****** Saving 'tombstoned' concept resulted in = " result) ;; TODO: JYNA Not sure what is going on here... but not convinced that this 'save-document-in-elastic' func is actually deleting the document in elastic like we need it to here... result) ;; else delete concept from primary concept index (do - (println "****** delete-concept: all-revisions-index is false") + ;(println "****** delete-concept: all-revisions-index is false") (es/delete-document - context index-names (concept-mapping-types concept-type) - concept-id revision-id elastic-version elastic-options) + context index-names (concept-mapping-types concept-type) + concept-id revision-id elastic-version elastic-options) ;; Index a deleted-granule document when granule is deleted ;; JYNA all these delete requests to ES are API calls -- are they synchronous? (when (= :granule concept-type) (let [[tm result] (util/time-execution - (dg/index-deleted-granule context concept concept-id revision-id elastic-version elastic-options))] + (dg/index-deleted-granule context concept concept-id revision-id elastic-version elastic-options))] (debug (format "Timed function %s index-deleted-granule took %d ms." (str *ns*) tm)) result)) ;; propagate collection deletion to granules (when (= :collection concept-type) (let [[tm result] (util/time-execution - (cascade-collection-delete context concept-mapping-types concept-id revision-id))] + (cascade-collection-delete context concept-mapping-types concept-id revision-id))] (debug (format "Timed function %s/cascade-collection-delete took %d ms." (str *ns*) tm)) - result))))) - ;; For draft concept, after the index is deleted, remove it from database. - (when (cs/is-draft-concept? concept-type) - (println "****** JYNA this is a draft concept will force delete the draft") - (meta-db/delete-draft context concept)) - ))) + result)) + )))))) + +(defmethod delete-concept :default + [context concept-id revision-id options] + (println (format "****** INSIDE delete-concept :default with params: concept-id %s, revision-id %s, options %s" concept-id revision-id options)) + ;; Assuming ingest will pass enough info for deletion + ;; We should avoid making calls to metadata db to get the necessary info if possible + (let [concept-type (cs/concept-id->type concept-id) + concept (meta-db/get-concept context concept-id revision-id)] + (delete-concept-helper context concept concept-id revision-id options) + (when (cs/is-draft-concept? concept-type) + (meta-db/delete-draft context concept)))) + +(defmethod delete-concept :collection-draft + [context concept-id revision-id options] + (println (format "****** INSIDE delete-concept :collection-draft with params: concept-id %s, revision-id %s, options %s" concept-id revision-id options)) + (let [concept (meta-db2/get-concept context concept-id revision-id)] + ;(if (nil? concept) + ; (println "****** INSIDE delete-concept :collection-draft: CONCEPT WAS NIL. DOING NOTHING.")) + (when (not (nil? concept)) + ;(println "****** INSIDE delete-concept :collection-draft: concept was not nil") + (delete-concept-helper context concept concept-id revision-id (assoc options :all-revisions-index? true)) + (delete-concept-helper context concept concept-id revision-id (assoc options :all-revisions-index? false)) + ;; if both all revisions and revision is being processed, then this might have a race condition and throw an error because one deleted the concept before this process could + (try + (meta-db/delete-draft context concept) + (catch Exception e + (println "This either failed to delete or it was because it was already deleted. If already deleted then ignore this error.")))))) (defn- index-association-concept "Index the association concept identified by the given concept-id and revision-id." diff --git a/ingest-app/src/cmr/ingest/api/generic_documents.clj b/ingest-app/src/cmr/ingest/api/generic_documents.clj index 3a7a4602c3..d9da910673 100644 --- a/ingest-app/src/cmr/ingest/api/generic_documents.clj +++ b/ingest-app/src/cmr/ingest/api/generic_documents.clj @@ -262,12 +262,10 @@ A 404 status is returned if the concept has already been deleted or removed from database." [request] (let [{:keys [route-params request-context params]} request - _ (println "JYNA inside delete-generic-document") provider-id (or (:provider params) (:provider-id route-params)) native-id (:native-id route-params) concept-type (concept-type->singular route-params) - _ (println "delete-generic-document -- concept type = " concept-type) _ (if-not (is-draft-concept? request) (acl/verify-ingest-management-permission request-context :update :provider-object provider-id) @@ -334,11 +332,9 @@ ([request concept-id native-id] (publish-draft-concept request concept-id native-id nil nil)) ([request concept-id native-id coll-concept-id coll-revision-id] - (let [{:keys [draft-concept-type provider-id concept-type-in-draft]} (extract-info-from-concept-id concept-id) - ;; gets concept from oracle and uses that data to create a map of native_id and collection ingest request - _ (println "START getting collection concept data from ORACLE") + (let [{:keys [draft-concept-type provider-id concept-type-in-draft]} + (extract-info-from-concept-id concept-id) info (get-info-from-metadata-db request concept-id provider-id concept-type-in-draft) - _ (println "END getting collection concept data from ORACLE") request (:request info) draft-native-id (:native-id info) ;;publish the concept-type-in-draft @@ -354,14 +350,15 @@ _ (println "END publishing collection with ingest collection call")] (if (contains? #{200 201} (:status publish-result)) ;;construct request to delete the draft. - (let [_ (println "START publish result was successful. START delete of draft request.") + (let [ + ;_ (println "START publish result was successful. START delete of draft request.") delete-request (-> request (assoc-in [:route-params :native-id] draft-native-id) (assoc-in [:route-params :concept-type] draft-concept-type) (assoc-in [:params :native-id] draft-native-id) (assoc-in [:params :concept-type] draft-concept-type)) delete-result (delete-generic-document delete-request) - _ (println "END delete of draft request with status " (:status delete-result))] + ;_ (println "END delete of draft request with status " (:status delete-result))] (if (= 200 (:status delete-result)) publish-result (errors/throw-service-error @@ -389,8 +386,7 @@ (defn publish-draft "Publish a draft concept, i.e. ingest the corresponding concept and delete the draft." [request concept-id native-id] - (let [_ (println "Inside publish-draft main API func") - draft-concept-type (:draft-concept-type (extract-info-from-concept-id concept-id)) + (let [draft-concept-type (:draft-concept-type (extract-info-from-concept-id concept-id)) content-type (:content-type request) body (:body request) body-map (when body @@ -407,7 +403,7 @@ ;; A variable draft does not have to be associated to a collection, if a collection concept id ;; does not exist, publish the variable anyway. (publish-draft-concept request concept-id native-id))) - (publish-draft-concept request concept-id native-id)) ;; going in here + (publish-draft-concept request concept-id native-id)) (errors/throw-service-error :bad-request (format "Only draft can be published in this route. concept-id [%s] does not belong to a draft concept" concept-id))))) diff --git a/ingest-app/src/cmr/ingest/api/routes.clj b/ingest-app/src/cmr/ingest/api/routes.clj index 40bf97bd1b..2865890b50 100644 --- a/ingest-app/src/cmr/ingest/api/routes.clj +++ b/ingest-app/src/cmr/ingest/api/routes.clj @@ -255,7 +255,6 @@ request (subscriptions/delete-subscription native-id request))) - ;; JYNA this is how collection-draft is created: /providers/JM_PROV1/collection-drafts/NativeID-CMR-10194-2 ;; Generic documents are by pattern: /providers/{prov_id}/{concept-type}/{native_id} (context ["/:concept-type" :concept-type diff --git a/ingest-app/src/cmr/ingest/services/ingest_service/util.clj b/ingest-app/src/cmr/ingest/services/ingest_service/util.clj index 14d815749a..f40ddb82bc 100644 --- a/ingest-app/src/cmr/ingest/services/ingest_service/util.clj +++ b/ingest-app/src/cmr/ingest/services/ingest_service/util.clj @@ -55,8 +55,7 @@ "Delete a concept from mdb and indexer. Throws a 404 error if the concept does not exist or the latest revision for the concept is already a tombstone." [context concept-attribs] - (let [_ (println "JYNA inside delete-concept") - {:keys [concept-type provider-id native-id]} concept-attribs + (let [{:keys [concept-type provider-id native-id]} concept-attribs existing-concept (first (mdb/find-concepts context {:provider-id provider-id :native-id native-id diff --git a/message-queue-lib/src/cmr/message_queue/test/queue_broker_wrapper.clj b/message-queue-lib/src/cmr/message_queue/test/queue_broker_wrapper.clj index d638680986..fd7943624f 100644 --- a/message-queue-lib/src/cmr/message_queue/test/queue_broker_wrapper.clj +++ b/message-queue-lib/src/cmr/message_queue/test/queue_broker_wrapper.clj @@ -135,6 +135,7 @@ [broker exchange-name msg] (let [queues (queue-protocol/get-queues-bound-to-exchange (:queue-broker broker) exchange-name) + ;_ (println (format "queues bound to the exchange %s: %s" exchange-name queues)) results (for [queue-name queues] (publish-to-queue broker queue-name msg))] (every? identity results))) diff --git a/metadata-db-app/src/cmr/metadata_db/api/concepts.clj b/metadata-db-app/src/cmr/metadata_db/api/concepts.clj index 5286b5e95e..48fe5e9129 100644 --- a/metadata-db-app/src/cmr/metadata_db/api/concepts.clj +++ b/metadata-db-app/src/cmr/metadata_db/api/concepts.clj @@ -25,8 +25,7 @@ ([context params concept-id] (get-concept context params concept-id nil)) ([context params concept-id revision] - (let [_ (println "JYNA Inside get-concept for concept-id = " concept-id) - include-umm-metadata (= "true" (:include_umm_metadata params))] + (let [include-umm-metadata (= "true" (:include_umm_metadata params))] {:status 200 :body (json/generate-string (concept-service/get-concept (assoc context :include-umm-metadata include-umm-metadata) concept-id (as-int revision))) :headers rh/json-header}))) @@ -81,8 +80,7 @@ (defn- save-concept-revision "Store a concept record and return the revision" [context params concept] - (let [_ (println "JYNA inside save-concept-revision") - concept (-> concept + (let [concept (-> concept clojure.walk/keywordize-keys (update-in [:concept-type] keyword)) ;; get variable-association and associated-item when applicable. @@ -143,7 +141,6 @@ :body (json/generate-string (concept-service/get-provider-holdings context)) :headers rh/json-header}) -;; JYNA Save concepts is here (def concepts-api-routes (routes (context "/concepts" [] @@ -164,7 +161,6 @@ (POST "/" {:keys [request-context params body]} (save-concept-revision request-context params body)) ;; remove a draft from the database - ;;JYNA this is where the force delete from indexer is going (DELETE "/force-delete-draft/:concept-id" {{:keys [concept-id] :as params} :params request-context :request-context} (force-delete-draft request-context params concept-id nil)) diff --git a/metadata-db-app/src/cmr/metadata_db/data/ingest_events.clj b/metadata-db-app/src/cmr/metadata_db/data/ingest_events.clj index e00e69895c..355c84fef0 100644 --- a/metadata-db-app/src/cmr/metadata_db/data/ingest_events.clj +++ b/metadata-db-app/src/cmr/metadata_db/data/ingest_events.clj @@ -14,10 +14,10 @@ (when (config/publish-messages) (when-let [exchange-name-fn (config/concept-type->exchange-name-fn (cc/concept-id->type (:concept-id msg)))] - (println (format "INSIDE publish-event with exchange-name-fn = %s" exchange-name-fn)) + ;(println (format "INSIDE publish-event with exchange-name-fn = %s" exchange-name-fn)) (let [queue-broker (get-in context [:system :queue-broker])] ;(println "queue-broker = " queue-broker) - (println "msg = " msg) + ;(println "msg = " msg) (when queue-broker (queue/publish-message queue-broker (exchange-name-fn) msg)))))) diff --git a/metadata-db-app/src/cmr/metadata_db/data/oracle/concepts.clj b/metadata-db-app/src/cmr/metadata_db/data/oracle/concepts.clj index 80fe8c1955..dbe553ce5b 100644 --- a/metadata-db-app/src/cmr/metadata_db/data/oracle/concepts.clj +++ b/metadata-db-app/src/cmr/metadata_db/data/oracle/concepts.clj @@ -346,11 +346,9 @@ (defn get-concept ([db concept-type provider concept-id] - (println "JYNA INSIDE get-concept with db transacations happening") (j/with-db-transaction [conn db] (let [table (tables/get-table-name provider concept-type)] - (println "table = " table) (db-result->concept-map concept-type conn (:provider-id provider) (su/find-one conn (select '[*] (from table) @@ -425,7 +423,6 @@ ;; Concept id native id pair was valid (let [{:keys [concept-type]} concept table (tables/get-table-name provider concept-type) - _ (println "TABLE NAME = " table + " BEING INSERTED FOR CONCEPT TYPE = " concept-type) seq-name (str table "_seq") [cols values] (concept->insert-args concept (:small provider)) stmt (format (str "INSERT INTO %s (id, %s, transaction_id) VALUES " diff --git a/metadata-db-app/src/cmr/metadata_db/services/concept_service.clj b/metadata-db-app/src/cmr/metadata_db/services/concept_service.clj index b6523c390c..071a6587f9 100644 --- a/metadata-db-app/src/cmr/metadata_db/services/concept_service.clj +++ b/metadata-db-app/src/cmr/metadata_db/services/concept_service.clj @@ -773,11 +773,11 @@ ;; true implies creation of tombstone for the revision (defmethod save-concept-revision true [context concept] - (println "JYNA inside save-concept-revision true with tombstone for concept = " concept) + ;(println "JYNA inside save-concept-revision true with tombstone for concept = " concept) (cv/validate-tombstone-request concept) (let [{:keys [concept-id revision-id skip-publication]} concept {:keys [concept-type provider-id]} (cu/parse-concept-id concept-id) - _ (println "JYNA concept-type = " concept-type "for concept-id = " concept-id) + ;_ (println "JYNA concept-type = " concept-type "for concept-id = " concept-id) db (util/context->db context) provider (provider-service/get-provider-by-id context provider-id true) _ (validate-system-level-concept concept provider) @@ -798,10 +798,11 @@ tombstone (create-tombstone-concept metadata concept previous-revision)] (cv/validate-concept tombstone) (validate-concept-revision-id db provider tombstone previous-revision) - (let [_ (println "trying to save revisioned tombstone") + (let [ + ;_ (println "trying to save revisioned tombstone") revisioned-tombstone (->> (set-or-generate-revision-id db provider tombstone previous-revision) (try-to-save db provider context)) - _ (println "successfully saved revisioned tombstone")] + ;_ (println "successfully saved revisioned tombstone")] ;; delete the associated variable associations if applicable (delete-associations context concept-type concept-id nil :variable-association) ;; delete the associated service associations if applicable diff --git a/search-app/src/cmr/search/api/concepts_search.clj b/search-app/src/cmr/search/api/concepts_search.clj index 924907b6ae..04586bbcdb 100644 --- a/search-app/src/cmr/search/api/concepts_search.clj +++ b/search-app/src/cmr/search/api/concepts_search.clj @@ -226,8 +226,7 @@ "Invokes query service to parse the parameters query, find results, and return the response" [ctx path-w-extension params headers body] - (let [_ (println "INSIDE find-concepts-by-parameters") - concept-type (concept-type-path-w-extension->concept-type path-w-extension) + (let [concept-type (concept-type-path-w-extension->concept-type path-w-extension) short-scroll-id (get headers (string/lower-case common-routes/SCROLL_ID_HEADER)) scroll-id-and-search-params (core-api/get-scroll-id-and-search-params-from-cache ctx short-scroll-id) scroll-id (:scroll-id scroll-id-and-search-params) diff --git a/transmit-lib/src/cmr/transmit/metadata_db.clj b/transmit-lib/src/cmr/transmit/metadata_db.clj index f57992bbeb..aecd9887f4 100644 --- a/transmit-lib/src/cmr/transmit/metadata_db.clj +++ b/transmit-lib/src/cmr/transmit/metadata_db.clj @@ -486,8 +486,7 @@ (defn-timed save-concept "Saves a concept in metadata db" [context concept] - (let [_ (println "JYNA inside save-concept in transmit-lib") - conn (config/context->app-connection context :metadata-db) + (let [conn (config/context->app-connection context :metadata-db) url (str (conn/root-url conn) "/concepts") concept-json-str (json/generate-string concept) params (merge