-
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.
- Loading branch information
Showing
21 changed files
with
2,309 additions
and
1 deletion.
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
18 changes: 18 additions & 0 deletions
18
release-notes/opensearch-index-management.release-notes-2.8.0.0.md
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,18 @@ | ||
## Version 2.8.0.0 2023-06-06 | ||
|
||
Compatible with OpenSearch 2.8.0 | ||
|
||
### Maintenance | ||
* Upgrade to gradle 8.1.1. ([#777](https://github.com/opensearch-project/index-management/pull/777)) | ||
* Bump version to 2.8. ([#759](https://github.com/opensearch-project/index-management/pull/759)) | ||
|
||
### Features | ||
* Support notification integration with long running operations. ([#790, 791, 793](https://github.com/opensearch-project/index-management/pull/793)) | ||
|
||
### Bug fixes | ||
* Remove recursion call when checking permission on indices. ([#785](https://github.com/opensearch-project/index-management/pull/785)) | ||
* Added trimming of nanos part of "epoch_millis" timestamp when date_histogram type used is date_nanos. ([#782](https://github.com/opensearch-project/index-management/pull/782)) | ||
* Added proper resolving of sourceIndex inside RollupInterceptor, it's required for QueryStringQuery parsing. ([#773](https://github.com/opensearch-project/index-management/pull/773)) | ||
|
||
### Documentation | ||
* Added 2.8 release notes. ([#794](https://github.com/opensearch-project/index-management/pull/794)) |
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
67 changes: 67 additions & 0 deletions
67
...pensearch/indexmanagement/controlcenter/notification/filter/IndexOperationActionFilter.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,67 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.indexmanagement.controlcenter.notification.filter | ||
|
||
import org.apache.logging.log4j.LogManager | ||
import org.opensearch.action.ActionListener | ||
import org.opensearch.action.ActionRequest | ||
import org.opensearch.action.ActionResponse | ||
import org.opensearch.action.support.ActionFilter | ||
import org.opensearch.action.support.ActionFilterChain | ||
import org.opensearch.action.support.ActiveShardsObserver | ||
import org.opensearch.client.Client | ||
import org.opensearch.cluster.metadata.IndexNameExpressionResolver | ||
import org.opensearch.cluster.service.ClusterService | ||
import org.opensearch.indexmanagement.controlcenter.notification.util.supportedActions | ||
import org.opensearch.tasks.Task | ||
import org.opensearch.tasks.TaskId | ||
|
||
class IndexOperationActionFilter( | ||
val client: Client, | ||
val clusterService: ClusterService, | ||
val activeShardsObserver: ActiveShardsObserver, | ||
val indexNameExpressionResolver: IndexNameExpressionResolver | ||
) : ActionFilter { | ||
|
||
private val logger = LogManager.getLogger(IndexOperationActionFilter::class.java) | ||
|
||
override fun order() = Integer.MAX_VALUE | ||
override fun <Request : ActionRequest, Response : ActionResponse> apply( | ||
task: Task, | ||
action: String, | ||
request: Request, | ||
listener: ActionListener<Response>, | ||
chain: ActionFilterChain<Request, Response> | ||
) { | ||
chain.proceed(task, action, request, wrapActionListener(task, action, request, listener)) | ||
} | ||
|
||
fun <Request : ActionRequest, Response : ActionResponse> wrapActionListener( | ||
task: Task, | ||
action: String, | ||
request: Request, | ||
listener: ActionListener<Response>, | ||
): ActionListener<Response> { | ||
var wrappedListener = listener | ||
if (supportedActions.contains(action)) { | ||
if (task.parentTaskId.isSet == false) { | ||
val taskId = TaskId(clusterService.localNode().id, task.id) | ||
logger.info("Add notification action listener for tasks: {} and action: {} ", taskId.toString(), action) | ||
wrappedListener = NotificationActionListener( | ||
delegate = listener, | ||
client = client, | ||
action = action, | ||
clusterService = clusterService, | ||
task = task, | ||
request = request, | ||
activeShardsObserver = activeShardsObserver, | ||
indexNameExpressionResolver = indexNameExpressionResolver | ||
) | ||
} | ||
} | ||
return wrappedListener | ||
} | ||
} |
Oops, something went wrong.