-
Notifications
You must be signed in to change notification settings - Fork 6
[NAE-2136] Speed up Elasticsearch reindex #327
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
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
a473c0b
NAE-2136 - Pridana logika pre Reindex case-ov a taskov cez controller…
dominikvozr 2480a25
NAE-2136 - cursor next approach
dominikvozr 990fe7b
NAE-2136 - cursor improved indexing and improved loop
dominikvozr dfc5117
NAE-2136 - fix pr logging, indexing algorithm, fix configuration, nul…
dominikvozr 9eef8e0
NAE-2136 - restrict indexing only for past till now - 2 minutes
dominikvozr f286be9
NAE-2136 - revert usage of unsecure global lists and new numbers of o…
dominikvozr 714790d
NAE-2136 - modified solution based on dividing the number of operatio…
dominikvozr 01bea60
NAE-2136 - ConcurrentModificationException prevention
dominikvozr 6ea44cc
NAE-2136 - Remove unused inner class
dominikvozr eaec9dc
**Enhance reindexing capabilities with bulk indexing improvements**
renczesstefan f881794
- updated index resolution
renczesstefan 2e124b1
Add Javadoc comments to Elasticsearch indexing methods
renczesstefan 692610a
Update repositories and QRGen dependency in pom.xml
renczesstefan 4762d94
Refactor reindex logic to use MongoDB queries.
renczesstefan 12f50fc
Refactor reindexQueried method to simplify parameters
renczesstefan 668dc94
Add @Min validation to batch size properties
renczesstefan faa66e2
Remove unused QRGen dependency from pom.xml
renczesstefan 62ee1e5
Use property for Jackson version management
renczesstefan 6788ac2
Add ElasticIndexService dependency to ReindexingTask
renczesstefan 7edf68f
Remove unused CaseRepository dependency from ReindexingTask.
renczesstefan d0de75c
Refactor Elasticsearch indexing and update entity handling.
renczesstefan 523f1b0
Handle duplicate records during ElasticSearch reindexing
renczesstefan 1788209
Fix incorrect repository usage in task reindexing logic
renczesstefan 37f2023
Refactor Elasticsearch client integration and authentication.
renczesstefan d160097
Fix null ID handling in Elastic bulk operations
renczesstefan b88fc8a
Refactor bulk operation JSON handling in ElasticIndexService
renczesstefan 6f102aa
[NAE-2136] Speed up Elasticsearch reindex
machacjozef 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
24 changes: 24 additions & 0 deletions
24
src/main/java/com/netgrif/application/engine/elastic/domain/CaseField.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,24 @@ | ||
| package com.netgrif.application.engine.elastic.domain; | ||
|
|
||
| import lombok.Data; | ||
| import lombok.EqualsAndHashCode; | ||
| import lombok.NoArgsConstructor; | ||
| import org.springframework.data.elasticsearch.annotations.Field; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| import static org.springframework.data.elasticsearch.annotations.FieldType.*; | ||
|
|
||
| @Data | ||
| @NoArgsConstructor | ||
| @EqualsAndHashCode(callSuper = true) | ||
| public class CaseField extends DataField { | ||
|
|
||
| @Field(type = Text) | ||
| private List<String> caseValue; | ||
|
|
||
| public CaseField(List<String> value) { | ||
| super(value.toString()); | ||
| this.caseValue = value; | ||
| } | ||
| } |
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
29 changes: 29 additions & 0 deletions
29
...java/com/netgrif/application/engine/elastic/serializer/LocalDateTimeJsonDeserializer.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,29 @@ | ||
| package com.netgrif.application.engine.elastic.serializer; | ||
|
|
||
| import com.fasterxml.jackson.core.JsonParser; | ||
| import com.fasterxml.jackson.databind.DeserializationContext; | ||
| import com.fasterxml.jackson.databind.JsonDeserializer; | ||
|
|
||
| import java.io.IOException; | ||
| import java.time.LocalDateTime; | ||
| import java.time.format.DateTimeFormatter; | ||
| import java.time.format.DateTimeFormatterBuilder; | ||
| import java.time.temporal.ChronoField; | ||
|
|
||
| public class LocalDateTimeJsonDeserializer extends JsonDeserializer<LocalDateTime> { | ||
| private static final DateTimeFormatter FORMATTER = new DateTimeFormatterBuilder() | ||
| .appendPattern("yyyy-MM-dd'T'HH:mm:ss") | ||
| .optionalStart() | ||
| .appendFraction(ChronoField.MILLI_OF_SECOND, 1, 3, true) | ||
| .optionalEnd() | ||
| .toFormatter(); | ||
|
|
||
| @Override | ||
| public LocalDateTime deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { | ||
| String value = p.getValueAsString(); | ||
| if (value == null || value.isEmpty()) { | ||
| return null; | ||
| } | ||
| return LocalDateTime.parse(value, FORMATTER); | ||
| } | ||
| } |
18 changes: 18 additions & 0 deletions
18
...n/java/com/netgrif/application/engine/elastic/serializer/LocalDateTimeJsonSerializer.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,18 @@ | ||
| package com.netgrif.application.engine.elastic.serializer; | ||
|
|
||
| import com.fasterxml.jackson.core.JsonGenerator; | ||
| import com.fasterxml.jackson.databind.JsonSerializer; | ||
| import com.fasterxml.jackson.databind.SerializerProvider; | ||
|
|
||
| import java.io.IOException; | ||
| import java.time.LocalDateTime; | ||
| import java.time.format.DateTimeFormatter; | ||
|
|
||
| public class LocalDateTimeJsonSerializer extends JsonSerializer<LocalDateTime> { | ||
| private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS"); | ||
|
|
||
| @Override | ||
| public void serialize(LocalDateTime value, JsonGenerator gen, SerializerProvider serializers) throws IOException { | ||
| gen.writeString(FORMATTER.format(value)); | ||
| } | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.