-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added FlowFrameworkMaxRequestRetrySetting and applied this to GetMlTa…
…skStep Signed-off-by: Joshua Palis <[email protected]>
- Loading branch information
Showing
10 changed files
with
220 additions
and
46 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
41 changes: 41 additions & 0 deletions
41
src/main/java/org/opensearch/flowframework/common/FlowFrameworkMaxRequestRetrySetting.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,41 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
package org.opensearch.flowframework.common; | ||
|
||
import org.opensearch.cluster.service.ClusterService; | ||
import org.opensearch.common.settings.Settings; | ||
|
||
import static org.opensearch.flowframework.common.FlowFrameworkSettings.MAX_REQUEST_RETRY; | ||
|
||
/** | ||
* Controls max request retry setting for workflow step transport action APIs | ||
*/ | ||
public class FlowFrameworkMaxRequestRetrySetting { | ||
|
||
protected volatile Integer maxRetry; | ||
|
||
/** | ||
* Instantiate this class. | ||
* | ||
* @param clusterService OpenSearch cluster service | ||
* @param settings OpenSearch settings | ||
*/ | ||
public FlowFrameworkMaxRequestRetrySetting(ClusterService clusterService, Settings settings) { | ||
maxRetry = MAX_REQUEST_RETRY.get(settings); | ||
clusterService.getClusterSettings().addSettingsUpdateConsumer(MAX_REQUEST_RETRY, it -> maxRetry = it); | ||
} | ||
|
||
/** | ||
* Gets the maximum number of retries | ||
* @return the maximum number of retries | ||
*/ | ||
public int getMaxRetries() { | ||
return maxRetry; | ||
} | ||
} |
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
Oops, something went wrong.