Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(post-importer): refactor incident processing (#4567)
* create new index `post-importer-queue` * store last processed post import position in `import-position` index (new version) * we don't use `pendingIncident` flag in `list-view` index anymore, instead we iterate over `post-importer-queue` records * we avoid updating incident entities from different thread: * importer only inserts data * post importer updates * implement migration to fill in `post-importer-queue` * unignore flaky tests related with incidents closes #4524 * fix(post-importer): fix migration... ...to not be applied on every restart * fix(post-importer): fix migration step equals method
- Loading branch information
1 parent
fb591dd
commit 2466a0b
Showing
50 changed files
with
1,444 additions
and
543 deletions.
There are no files selected for viewing
This file contains 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 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 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 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
13 changes: 13 additions & 0 deletions
13
els-schema/src/main/java/io/camunda/operate/entities/post/PostImporterActionType.java
This file contains 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,13 @@ | ||
/* | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH | ||
* under one or more contributor license agreements. Licensed under a proprietary license. | ||
* See the License.txt file for more information. You may not use this file | ||
* except in compliance with the proprietary license. | ||
*/ | ||
package io.camunda.operate.entities.post; | ||
|
||
public enum PostImporterActionType { | ||
|
||
INCIDENT | ||
|
||
} |
113 changes: 113 additions & 0 deletions
113
els-schema/src/main/java/io/camunda/operate/entities/post/PostImporterQueueEntity.java
This file contains 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,113 @@ | ||
/* | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH | ||
* under one or more contributor license agreements. Licensed under a proprietary license. | ||
* See the License.txt file for more information. You may not use this file | ||
* except in compliance with the proprietary license. | ||
*/ | ||
package io.camunda.operate.entities.post; | ||
|
||
import io.camunda.operate.entities.OperateEntity; | ||
|
||
import java.time.OffsetDateTime; | ||
import java.util.Objects; | ||
|
||
public class PostImporterQueueEntity extends OperateEntity<PostImporterQueueEntity> { | ||
|
||
private Long key; | ||
|
||
private PostImporterActionType actionType; | ||
|
||
private String intent; | ||
|
||
private OffsetDateTime creationTime; | ||
|
||
private Integer partitionId; | ||
|
||
private Long processInstanceKey; | ||
|
||
private Long position; | ||
|
||
public Long getKey() { | ||
return key; | ||
} | ||
|
||
public PostImporterQueueEntity setKey(Long key) { | ||
this.key = key; | ||
return this; | ||
} | ||
|
||
public PostImporterActionType getActionType() { | ||
return actionType; | ||
} | ||
|
||
public PostImporterQueueEntity setActionType(PostImporterActionType actionType) { | ||
this.actionType = actionType; | ||
return this; | ||
} | ||
|
||
public String getIntent() { | ||
return intent; | ||
} | ||
|
||
public PostImporterQueueEntity setIntent(String intent) { | ||
this.intent = intent; | ||
return this; | ||
} | ||
|
||
public OffsetDateTime getCreationTime() { | ||
return creationTime; | ||
} | ||
|
||
public PostImporterQueueEntity setCreationTime(OffsetDateTime creationTime) { | ||
this.creationTime = creationTime; | ||
return this; | ||
} | ||
|
||
public Integer getPartitionId() { | ||
return partitionId; | ||
} | ||
|
||
public PostImporterQueueEntity setPartitionId(Integer partitionId) { | ||
this.partitionId = partitionId; | ||
return this; | ||
} | ||
|
||
public Long getProcessInstanceKey() { | ||
return processInstanceKey; | ||
} | ||
|
||
public PostImporterQueueEntity setProcessInstanceKey(Long processInstanceKey) { | ||
this.processInstanceKey = processInstanceKey; | ||
return this; | ||
} | ||
|
||
public Long getPosition() { | ||
return position; | ||
} | ||
|
||
public PostImporterQueueEntity setPosition(Long position) { | ||
this.position = position; | ||
return this; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) | ||
return true; | ||
if (o == null || getClass() != o.getClass()) | ||
return false; | ||
if (!super.equals(o)) | ||
return false; | ||
PostImporterQueueEntity that = (PostImporterQueueEntity) o; | ||
return Objects.equals(key, that.key) && actionType == that.actionType && Objects.equals(intent, | ||
that.intent) && Objects.equals(creationTime, that.creationTime) && Objects.equals(partitionId, | ||
that.partitionId) && Objects.equals(processInstanceKey, that.processInstanceKey) && Objects.equals(position, | ||
that.position); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(super.hashCode(), key, actionType, intent, creationTime, partitionId, processInstanceKey, | ||
position); | ||
} | ||
} |
This file contains 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 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 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
13 changes: 13 additions & 0 deletions
13
els-schema/src/main/java/io/camunda/operate/schema/migration/DataInitializerStep.java
This file contains 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,13 @@ | ||
/* | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH | ||
* under one or more contributor license agreements. Licensed under a proprietary license. | ||
* See the License.txt file for more information. You may not use this file | ||
* except in compliance with the proprietary license. | ||
*/ | ||
package io.camunda.operate.schema.migration; | ||
|
||
/** | ||
* This migration step fills the new index with data. Does not require index of older version. | ||
*/ | ||
public interface DataInitializerStep { | ||
} |
Oops, something went wrong.