Skip to content

Commit

Permalink
Clean family before re-run its analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
diogok committed Dec 13, 2016
1 parent c633a1e commit 1261174
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ FROM diogok/java8:zulu
WORKDIR /opt
CMD ["java","-server","-XX:+UseConcMarkSweepGC","-XX:+UseCompressedOops","-XX:+DoEscapeAnalysis","-jar","rrapp-idx.jar"]

ADD target/rrapp-idx-0.0.3-standalone.jar /opt/rrapp-idx.jar
ADD target/rrapp-idx-0.0.4-standalone.jar /opt/rrapp-idx.jar

2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject rrapp-idx "0.0.3"
(defproject rrapp-idx "0.0.4"
:description "Run analysis on DarwinCore taxa and occurrences aggregated"
:url "http://github.com/biodivdev/rrapp-idx"
:license {:name "MIT"}
Expand Down
4 changes: 3 additions & 1 deletion src/rrapp_idx/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
(defn run-all
[]
(let [families (chan 2)
families-d (chan 2)
species (chan 5)
names (chan 5)
occurrences (chan 2)
results (chan 5)]

(pipe families get-species species)
(pipe families clean-family families-d)
(pipe families-d get-species species)
(pipe species get-names names)
(pipe names get-occurrences occurrences)
(pipe occurrences get-results results)
Expand Down
9 changes: 9 additions & 0 deletions src/rrapp_idx/db.clj
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@
:hits
(map :_source)))

(defn clean-family
[family out]
(go
(log/info "Clean species of" family)
(post-json (str (config :elasticsearch) "/" (config :index) "/analysis/_delete_by_query")
{:query {:term {:family.keyword family}}})
(>! out family)
(close! out)))

(defn get-species
[family out]
(go
Expand Down

0 comments on commit 1261174

Please sign in to comment.