   "A map of application name to the start function"
   {:metadata-db {:start mdb-system/start
                  :stop mdb-system/stop}
-   :bootstrap {:start bootstrap-system/start
-                 :stop bootstrap-system/stop}
    :index-set {:start index-set-system/start
                :stop index-set-system/stop}
    :indexer {:start indexer-system/start


(defn- stop-apps
  [system]
  (reduce (fn [system [app {stop-fn :stop}]]
            (update-in system [:apps app] #(when % (stop-fn %))))
          system
          app-control-functions))

(defn- start-components
  [system]

   :ingest {:start ingest-system/start
            :stop ingest-system/stop}
   :search {:start search-system/start
            :stop search-system/stop}
   :bootstrap {:start bootstrap-system/start
               :stop bootstrap-system/stop}})

(def app-startup-order
  "Defines the order in which applications should be started"
  [:metadata-db :index-set :indexer :ingest :search :bootstrap])

(def in-memory-elastic-port 9206)
(def in-memory-elastic-port-for-connection 9206)
