forked from opensearch-project/index-management
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds min rollover age as a transition condition (opensearch-project#215)
* Adds min rollover age as a transition condition Signed-off-by: Drew Baugher <[email protected]> * Fixes link checker Signed-off-by: Drew Baugher <[email protected]>
- Loading branch information
Showing
11 changed files
with
200 additions
and
18 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
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
35 changes: 35 additions & 0 deletions
35
...tlin/org/opensearch/indexmanagement/indexstatemanagement/opensearchapi/ExtensionsTests.kt
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,35 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.indexmanagement.indexstatemanagement.opensearchapi | ||
|
||
import org.opensearch.Version | ||
import org.opensearch.action.admin.indices.rollover.RolloverInfo | ||
import org.opensearch.cluster.metadata.IndexMetadata | ||
import org.opensearch.test.OpenSearchTestCase | ||
|
||
class ExtensionsTests : OpenSearchTestCase() { | ||
|
||
fun `test getting oldest rollover time`() { | ||
val noRolloverMetadata = IndexMetadata | ||
.Builder("foo-index") | ||
.settings(settings(Version.CURRENT)) | ||
.numberOfShards(1) | ||
.numberOfReplicas(1) | ||
.build() | ||
|
||
assertNull(noRolloverMetadata.getOldestRolloverTime()) | ||
val oldest = RolloverInfo("bar-alias", emptyList(), 17L) | ||
|
||
val metadata = IndexMetadata | ||
.Builder(noRolloverMetadata) | ||
.putRolloverInfo(RolloverInfo("foo-alias", emptyList(), 42L)) | ||
.putRolloverInfo(oldest) | ||
.putRolloverInfo(RolloverInfo("baz-alias", emptyList(), 134345L)) | ||
.build() | ||
|
||
assertEquals("Did not get the oldest rollover time", oldest.time, metadata.getOldestRolloverTime()?.toEpochMilli()) | ||
} | ||
} |
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
Oops, something went wrong.