-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Add DLM force merge operation helpers #143200
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
seanzatzdev
merged 22 commits into
elastic:main
from
seanzatzdev:dlm-force-merge-operation
Mar 6, 2026
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
31d6c0d
Add DLM force merge operation helpers
seanzatzdev 2731ae7
adapt data lifecycleservice force merge code
seanzatzdev 9d0a1c8
Update modules/data-streams/src/main/java/org/elasticsearch/datastrea…
seanzatzdev 69aa5c4
PR feedback
seanzatzdev a1c64ef
[CI] Auto commit changes from spotless
ec18cd9
Merge branch 'main' into dlm-force-merge-operation
seanzatzdev 1b45498
implement execute(), add completeness check before running maybeForce…
seanzatzdev 6b8c255
add unit test for when force merge is already complete
seanzatzdev 147b93c
add check for nonexistent index
seanzatzdev a4e3443
update comment
seanzatzdev ba18299
Update modules/data-streams/src/main/java/org/elasticsearch/datastrea…
seanzatzdev a2783d1
[CI] Auto commit changes from spotless
def11f4
Update modules/data-streams/src/main/java/org/elasticsearch/datastrea…
seanzatzdev aba3ac9
Merge branch 'elastic:main' into dlm-force-merge-operation
seanzatzdev da58897
respond to PR feedback
seanzatzdev 8024964
Merge branch 'elastic:main' into dlm-force-merge-operation
seanzatzdev a155873
use unavailable shards method
seanzatzdev 9e83a2c
address PR feedback
seanzatzdev 7c46f92
Merge branch 'main' into dlm-force-merge-operation
seanzatzdev 46f1778
adjust to max timeout for force merge
seanzatzdev 64cb76b
Merge branch 'main' into dlm-force-merge-operation
seanzatzdev 2328dd6
Merge branch 'main' into dlm-force-merge-operation
seanzatzdev 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
71 changes: 71 additions & 0 deletions
71
...reams/src/main/java/org/elasticsearch/datastreams/lifecycle/ForceMergeRequestWrapper.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,71 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the "Elastic License | ||
| * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
| * Public License v 1"; you may not use this file except in compliance with, at | ||
| * your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
| * License v3.0 only", or the "Server Side Public License, v 1". | ||
| */ | ||
|
|
||
| package org.elasticsearch.datastreams.lifecycle; | ||
|
|
||
| import org.elasticsearch.action.admin.indices.forcemerge.ForceMergeRequest; | ||
|
|
||
| import java.util.Arrays; | ||
| import java.util.Objects; | ||
|
|
||
| /** | ||
| * This wrapper exists only to provide equals and hashCode implementations of a ForceMergeRequest for transportActionsDeduplicator. | ||
| * It intentionally ignores forceMergeUUID (which ForceMergeRequest's equals/hashCode would have to if they existed) because we don't | ||
| * care about it for data stream lifecycle deduplication. This class is public so that it can be reused by other data stream lifecycle | ||
| * management components (for example when forming DLM force-merge requests), but it is not intended as a | ||
| * general-purpose Elasticsearch public API. | ||
| */ | ||
| public final class ForceMergeRequestWrapper extends ForceMergeRequest { | ||
| public ForceMergeRequestWrapper(ForceMergeRequest original) { | ||
| super(original.indices()); | ||
| this.maxNumSegments(original.maxNumSegments()); | ||
| this.onlyExpungeDeletes(original.onlyExpungeDeletes()); | ||
| this.flush(original.flush()); | ||
| this.indicesOptions(original.indicesOptions()); | ||
| this.setShouldStoreResult(original.getShouldStoreResult()); | ||
| this.setRequestId(original.getRequestId()); | ||
| this.timeout(original.timeout()); | ||
| this.setParentTask(original.getParentTask()); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean equals(Object o) { | ||
| if (this == o) { | ||
| return true; | ||
| } | ||
| if (o == null || getClass() != o.getClass()) { | ||
| return false; | ||
| } | ||
| ForceMergeRequest that = (ForceMergeRequest) o; | ||
| return Arrays.equals(indices, that.indices()) | ||
| && maxNumSegments() == that.maxNumSegments() | ||
| && onlyExpungeDeletes() == that.onlyExpungeDeletes() | ||
| && flush() == that.flush() | ||
| && Objects.equals(indicesOptions(), that.indicesOptions()) | ||
| && getShouldStoreResult() == that.getShouldStoreResult() | ||
| && getRequestId() == that.getRequestId() | ||
| && Objects.equals(timeout(), that.timeout()) | ||
| && Objects.equals(getParentTask(), that.getParentTask()); | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| return Objects.hash( | ||
| Arrays.hashCode(indices), | ||
| maxNumSegments(), | ||
| onlyExpungeDeletes(), | ||
| flush(), | ||
| indicesOptions(), | ||
| getShouldStoreResult(), | ||
| getRequestId(), | ||
| timeout(), | ||
| getParentTask() | ||
| ); | ||
| } | ||
| } |
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
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.