-
Notifications
You must be signed in to change notification settings - Fork 7
CCD-5849: elastic search upgrade #1611
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kiran-yenigala-hmcts
wants to merge
13
commits into
master
Choose a base branch
from
CCD-5849_sb3_1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+973
−272
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
f886545
CCD-5849: elastic search upgrade
kiran-yenigala-hmcts 2393881
CCD-5849: elastic search upgrade
kiran-yenigala-hmcts 1dec46b
CCD-5849: elastic search upgrade
kiran-yenigala-hmcts e493d9b
CCD-5849 use ES version 9.1.2
markdathornehmcts e204c95
CCD-6654 enable ES for FTA testing
markdathornehmcts 4c7ef0d
CCD-6654 trigger build after enable_keep_helm label added
markdathornehmcts e18ea7c
Merge branch 'master' into CCD-5849_sb3_1
markdathornehmcts ca28611
Merge branch 'master' into CCD-5849_sb3_1
markdathornehmcts f4c2fee
CCD-6654 sonar fixes
markdathornehmcts f80d41f
Merge remote-tracking branch 'origin/CCD-5849_sb3_1' into CCD-5849_sb3_1
markdathornehmcts b2b407f
CCD-6654 sonar fixes
markdathornehmcts 078df72
CCD-6654 sonar fixes
markdathornehmcts 05a9bee
Merge branch 'master' into CCD-5849_sb3_1
rapolaskaseliscgi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,10 +23,13 @@ java: | |
|
|
||
| # enable whenever required and provide host url to match with corresponding data-store-api | ||
| ELASTIC_SEARCH_ENABLED: true | ||
| ELASTIC_SEARCH_HOST: "{{ .Release.Name }}-es-master" | ||
|
|
||
| ELASTIC_SEARCH_HOST: ccd-data-store-api-pr-2620-es-master | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to be reverted before merging |
||
|
|
||
| USER_PROFILE_HOST: http://${SERVICE_NAME}-ccd-user-profile-api | ||
| TS_TRANSLATION_SERVICE_HOST: http://${SERVICE_NAME}-translation-service | ||
|
|
||
|
|
||
| # ccd-test app-insights key - remove once testing is done | ||
| APPINSIGHTS_INSTRUMENTATIONKEY: 2dcb834e-768e-4429-9050-ab15af959995 | ||
|
|
||
|
|
@@ -109,7 +112,7 @@ ccd: | |
| secretRef: "{{ .Values.global.postgresSecret }}" | ||
| key: PASSWORD | ||
| disabled: true | ||
|
|
||
|
|
||
| elastic: | ||
| enabled: true | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...ain/java/uk/gov/hmcts/ccd/definition/store/elastic/client/ElasticsearchClientFactory.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| package uk.gov.hmcts.ccd.definition.store.elastic.client; | ||
|
|
||
| import co.elastic.clients.elasticsearch.ElasticsearchClient; | ||
| import co.elastic.clients.json.JsonData; | ||
| import co.elastic.clients.json.jackson.JacksonJsonpMapper; | ||
| import co.elastic.clients.transport.rest_client.RestClientTransport; | ||
| import org.elasticsearch.client.RestClient; | ||
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
|
|
||
| import java.io.IOException; | ||
| import java.util.Map; | ||
| import java.util.function.Supplier; | ||
|
|
||
| public class ElasticsearchClientFactory { | ||
|
|
||
| private static final Logger log = LoggerFactory.getLogger(ElasticsearchClientFactory.class); | ||
| private final Supplier<RestClient> restClientSupplier; | ||
| private final JacksonJsonpMapper mapper; | ||
|
|
||
| public ElasticsearchClientFactory(Supplier<RestClient> restClientSupplier, JacksonJsonpMapper mapper) { | ||
| this.restClientSupplier = restClientSupplier; | ||
| this.mapper = mapper; | ||
| } | ||
|
|
||
| public ElasticsearchClient createClient() { | ||
| RestClient restClient = restClientSupplier.get(); | ||
| RestClientTransport transport = new RestClientTransport(restClient, mapper); | ||
| ElasticsearchClient client = new ElasticsearchClient(transport); | ||
| try { | ||
| client.cluster().putSettings(s -> | ||
| s.persistent(Map.of("action.destructive_requires_name", JsonData.of(false))) | ||
| ); | ||
| } catch (IOException e) { | ||
| log.error(e.getMessage(), e); | ||
| } | ||
|
|
||
| return client; | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be reverted prior to merge