-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implemented filtering on the ISM eplain API Signed-off-by: Joshua Au <joshuahyau@gmail.com> * Fixed tests for ExplainRequest Signed-off-by: Joshua Au <joshuahyau@gmail.com> * Added filtering on query and metadata map Signed-off-by: Joshua Au <joshuahyau@gmail.com> * Filtered on indexNames in metadata Signed-off-by: Joshua Au <joshuahyau@gmail.com> * Fixed github workflow check errors Signed-off-by: Joshua Au <joshuahyau@gmail.com> * Removed debugging comments Signed-off-by: Joshua Au <joshuahyau@gmail.com> * Updated code styling to make more clear Signed-off-by: Joshua Au <joshuahyau@gmail.com> * Refactored code to match suggestions Signed-off-by: Joshua Au <joshuahyau@gmail.com> * Added test case for the ExplainFilter.byMetaData and parse methods Signed-off-by: Joshua Au <joshuahyau@gmail.com> * Started implementation of explain filter IT Signed-off-by: Joshua Au <joshuahyau@gmail.com> * Implemented test explain filter method Signed-off-by: Joshua Au <joshuahyau@gmail.com> * Implemented explain filter test on failure Signed-off-by: Joshua Au <joshuahyau@gmail.com> * Cleaned up log statements Signed-off-by: Joshua Au <joshuahyau@gmail.com> * Added explain filter test for success Signed-off-by: Joshua Au <joshuahyau@gmail.com> * Fixed lint errors Signed-off-by: Joshua Au <joshuahyau@gmail.com> * Removed policy from index to fix flaky tests Signed-off-by: Joshua Au <joshuahyau@gmail.com> --------- Signed-off-by: Joshua Au <joshuahyau@gmail.com> Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com> Co-authored-by: bowenlan-amzn <bowenlan23@gmail.com>
- Loading branch information
1 parent
21f5f8d
commit 5aeed27
Showing
7 changed files
with
356 additions
and
21 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
35 changes: 35 additions & 0 deletions
35
...st/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ExplainFilterTests.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.model | ||
|
||
import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ActionMetaData | ||
import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedIndexMetaData | ||
import org.opensearch.indexmanagement.spi.indexstatemanagement.model.PolicyRetryInfoMetaData | ||
import org.opensearch.indexmanagement.spi.indexstatemanagement.model.StateMetaData | ||
import org.opensearch.test.OpenSearchTestCase | ||
|
||
class ExplainFilterTests : OpenSearchTestCase() { | ||
fun `test byMetadata`() { | ||
val stateMetaData = StateMetaData("state", 100) | ||
val actionMetaData = ActionMetaData("action", null, 0, false, 0, null, null) | ||
val policyRetryInfoMetaData = PolicyRetryInfoMetaData(false, 1) | ||
|
||
val managedIndexMetaDataAllNull = ManagedIndexMetaData("test", "indexUuid", "policy_id", null, null, null, null, null, null, null, null, null, null, null) | ||
val managedIndexMetaDataNonNull = ManagedIndexMetaData("test", "indexUuid", "policy_id", null, null, null, null, null, null, stateMetaData, actionMetaData, null, policyRetryInfoMetaData, null) | ||
val managedIndexMetaDataSomeNull = ManagedIndexMetaData("test", "indexUuid", "policy_id", null, null, null, null, null, null, null, actionMetaData, null, null, null) | ||
|
||
val explainFilter = ExplainFilter(state = "state", actionType = "action", failed = false) | ||
|
||
var res = explainFilter.byMetaData(managedIndexMetaDataAllNull) | ||
assertFalse(res) | ||
|
||
res = explainFilter.byMetaData(managedIndexMetaDataNonNull) | ||
assertTrue(res) | ||
|
||
res = explainFilter.byMetaData(managedIndexMetaDataSomeNull) | ||
assertFalse(res) | ||
} | ||
} |
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.