-
Notifications
You must be signed in to change notification settings - Fork 141
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
Add Flint Index Purging Logic #2372
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
package org.opensearch.sql.opensearch.setting; | ||
|
||
import static org.opensearch.common.settings.Settings.EMPTY; | ||
import static org.opensearch.common.unit.TimeValue.timeValueDays; | ||
import static org.opensearch.sql.common.setting.Settings.Key.ENCYRPTION_MASTER_KEY; | ||
|
||
import com.google.common.annotations.VisibleForTesting; | ||
|
@@ -25,6 +26,7 @@ | |
import org.opensearch.common.settings.SecureSetting; | ||
import org.opensearch.common.settings.Setting; | ||
import org.opensearch.common.unit.MemorySizeValue; | ||
import org.opensearch.common.unit.TimeValue; | ||
import org.opensearch.sql.common.setting.LegacySettings; | ||
import org.opensearch.sql.common.setting.Settings; | ||
|
||
|
@@ -149,6 +151,27 @@ public class OpenSearchSettings extends Settings { | |
Setting.Property.NodeScope, | ||
Setting.Property.Dynamic); | ||
|
||
public static final Setting<TimeValue> SESSION_INDEX_TTL_SETTING = | ||
Setting.positiveTimeSetting( | ||
Key.SESSION_INDEX_TTL.getKeyValue(), | ||
timeValueDays(14), | ||
Setting.Property.NodeScope, | ||
Setting.Property.Dynamic); | ||
|
||
public static final Setting<TimeValue> RESULT_INDEX_TTL_SETTING = | ||
Setting.positiveTimeSetting( | ||
Key.RESULT_INDEX_TTL.getKeyValue(), | ||
timeValueDays(60), | ||
Setting.Property.NodeScope, | ||
Setting.Property.Dynamic); | ||
|
||
public static final Setting<Boolean> AUTO_INDEX_MANAGEMENT_ENABLED_SETTING = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this for both the indices? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
Setting.boolSetting( | ||
Key.AUTO_INDEX_MANAGEMENT_ENABLED.getKeyValue(), | ||
true, | ||
Setting.Property.NodeScope, | ||
Setting.Property.Dynamic); | ||
|
||
/** Construct OpenSearchSetting. The OpenSearchSetting must be singleton. */ | ||
@SuppressWarnings("unchecked") | ||
public OpenSearchSettings(ClusterSettings clusterSettings) { | ||
|
@@ -231,6 +254,24 @@ public OpenSearchSettings(ClusterSettings clusterSettings) { | |
Key.SPARK_EXECUTION_SESSION_LIMIT, | ||
SPARK_EXECUTION_SESSION_LIMIT_SETTING, | ||
new Updater(Key.SPARK_EXECUTION_SESSION_LIMIT)); | ||
register( | ||
settingBuilder, | ||
clusterSettings, | ||
Key.SESSION_INDEX_TTL, | ||
SESSION_INDEX_TTL_SETTING, | ||
new Updater(Key.SESSION_INDEX_TTL)); | ||
register( | ||
settingBuilder, | ||
clusterSettings, | ||
Key.RESULT_INDEX_TTL, | ||
RESULT_INDEX_TTL_SETTING, | ||
new Updater(Key.RESULT_INDEX_TTL)); | ||
register( | ||
settingBuilder, | ||
clusterSettings, | ||
Key.AUTO_INDEX_MANAGEMENT_ENABLED, | ||
AUTO_INDEX_MANAGEMENT_ENABLED_SETTING, | ||
new Updater(Key.AUTO_INDEX_MANAGEMENT_ENABLED)); | ||
registerNonDynamicSettings( | ||
settingBuilder, clusterSettings, Key.CLUSTER_NAME, ClusterName.CLUSTER_NAME_SETTING); | ||
defaultSettings = settingBuilder.build(); | ||
|
@@ -298,6 +339,9 @@ public static List<Setting<?>> pluginSettings() { | |
.add(SPARK_EXECUTION_ENGINE_CONFIG) | ||
.add(SPARK_EXECUTION_SESSION_ENABLED_SETTING) | ||
.add(SPARK_EXECUTION_SESSION_LIMIT_SETTING) | ||
.add(SESSION_INDEX_TTL_SETTING) | ||
.add(RESULT_INDEX_TTL_SETTING) | ||
.add(AUTO_INDEX_MANAGEMENT_ENABLED_SETTING) | ||
.build(); | ||
} | ||
|
||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor Nit: can we move this up, In case there is a new revision.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, will do