|
12 | 12 | [cmr.common.util :as u] |
13 | 13 | [cmr.dev-system.config :as dev-config] |
14 | 14 | [cmr.dev-system.control :as control] |
15 | | - [cmr.elastic-utils.config :as elastic-config] |
| 15 | + [cmr.elastic-utils.config :as es-config] |
16 | 16 | [cmr.elastic-utils.embedded-elastic-server :as elastic-server] |
17 | 17 | [cmr.indexer.config :as indexer-config] |
18 | 18 | [cmr.indexer.system :as indexer-system] |
|
100 | 100 | (def in-memory-elastic-log-level-atom |
101 | 101 | (atom :info)) |
102 | 102 |
|
103 | | -(defmulti create-gran-elastic-server |
104 | | - "Sets elastic configuration values and returns an instance of an Elasticsearch component representing the granule cluster to run |
105 | | - in memory if applicable. A granule elasticsearch cluster will hold only the granule and deleted granule indexes." |
106 | | - (fn [type] |
107 | | - type)) |
108 | | - |
109 | | -(defmethod create-gran-elastic-server :in-memory |
110 | | - [_] |
111 | | - (let [http-port (elastic-config/gran-elastic-port)] |
112 | | - (elastic-server/create-server http-port |
113 | | - {:log-level (name @in-memory-elastic-log-level-atom) |
114 | | - :kibana-port (dev-config/embedded-kibana-gran-port) |
115 | | - :image-cfg {"Dockerfile" "elasticsearch/Dockerfile.elasticsearch" |
116 | | - "es_libs" "elasticsearch/es_libs" |
117 | | - "embedded-security.policy" "elasticsearch/embedded-security.policy" |
118 | | - "plugins" "elasticsearch/plugins"}}))) |
119 | | - |
120 | | -(defmethod create-gran-elastic-server :external |
121 | | - [_] |
122 | | - nil) |
123 | | - |
124 | 103 | (defmulti create-elastic-server |
125 | | - "Sets elastic configuration values and returns an instance of an Elasticsearch component representing the non-granule cluster to run |
126 | | - in memory if applicable. This non-granule cluster will hold all CMR concept indexes that are NOT the granule or deleted granule indexes." |
127 | | - (fn [type] |
128 | | - type)) |
| 104 | + "Sets elastic configuration values and returns an instance of an Elasticsearch component representing the non-granule cluster to run |
| 105 | + in memory if applicable. This non-granule cluster will hold all CMR concept indexes that are NOT the granule or deleted granule indexes." |
| 106 | + (fn [type elastic-port kibana-port] |
| 107 | + type)) |
129 | 108 |
|
130 | 109 | (defmethod create-elastic-server :in-memory |
131 | | - [_] |
132 | | - (let [http-port (elastic-config/elastic-port)] |
133 | | - (elastic-server/create-server http-port |
134 | | - {:log-level (name @in-memory-elastic-log-level-atom) |
135 | | - :kibana-port (dev-config/embedded-kibana-port) |
136 | | - :image-cfg {"Dockerfile" "elasticsearch/Dockerfile.elasticsearch" |
137 | | - "es_libs" "elasticsearch/es_libs" |
138 | | - "embedded-security.policy" "elasticsearch/embedded-security.policy" |
139 | | - "plugins" "elasticsearch/plugins"}}))) |
| 110 | + [type elastic-port kibana-port] |
| 111 | + (elastic-server/create-server elastic-port |
| 112 | + {:log-level (name @in-memory-elastic-log-level-atom) |
| 113 | + :kibana-port kibana-port |
| 114 | + :image-cfg {"Dockerfile" "elasticsearch/Dockerfile.elasticsearch" |
| 115 | + "es_libs" "elasticsearch/es_libs" |
| 116 | + "embedded-security.policy" "elasticsearch/embedded-security.policy" |
| 117 | + "plugins" "elasticsearch/plugins"}})) |
140 | 118 |
|
141 | 119 | (defmethod create-elastic-server :external |
142 | | - [_] |
| 120 | + [type elastic-port kibana-port] |
143 | 121 | nil) |
144 | 122 |
|
145 | 123 | (defmulti create-redis |
|
307 | 285 | db-component (create-db db) |
308 | 286 | echo-component (create-echo echo) |
309 | 287 | queue-broker (create-queue-broker message-queue) |
310 | | - gran-elastic-server (create-gran-elastic-server elastic) |
311 | | - elastic-server (create-elastic-server elastic) |
| 288 | + gran-elastic-server (create-elastic-server elastic (es-config/gran-elastic-port) (dev-config/embedded-kibana-gran-port)) |
| 289 | + elastic-server (create-elastic-server elastic (es-config/elastic-port) (dev-config/embedded-kibana-port)) |
312 | 290 | redis-server (create-redis redis) |
313 | 291 | sqs-server (create-sqs-server sqs-server) |
314 | 292 | control-server (control/create-server)] |
|
0 commit comments