-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[Tiered Caching] Segmented cache changes #16047
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
Merged
jainankitk
merged 14 commits into
opensearch-project:main
from
sgup432:tiered_segment_cache_final
Oct 8, 2024
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
185cc14
Segmented cache changes for TieredCache
sgup432 f3232cb
Adding change log
sgup432 79afb46
Allow segment number to be power of two
sgup432 d1ce19e
Merge branch 'main' into tiered_segment_cache_final
sgup432 5c96fac
Moving common tiered cache IT methods to a common base class
sgup432 fa1b38f
Adding disk took time IT test with multiple segment
sgup432 49e36fe
Merge branch 'main' into tiered_segment_cache_final
sgup432 bea8fd7
Correcting changelog
sgup432 bd1fce1
Addressing comments
sgup432 016c049
Fixing invalid segment count variable name
sgup432 66f6576
Merge branch 'main' into tiered_segment_cache_final
sgup432 93e3395
Introducing new settings for size for respective cache tier
sgup432 b71b2d4
Changing the default segmentCount logic
sgup432 ce52c28
Fixing missing java doc issue
sgup432 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 hidden or 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
57 changes: 57 additions & 0 deletions
57
...internalClusterTest/java/org/opensearch/cache/common/tier/TieredSpilloverCacheBaseIT.java
This file contains hidden or 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,57 @@ | ||
| /* | ||
| * 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.cache.common.tier; | ||
|
|
||
| import org.opensearch.common.cache.CacheType; | ||
| import org.opensearch.common.cache.settings.CacheSettings; | ||
| import org.opensearch.common.cache.store.OpenSearchOnHeapCache; | ||
| import org.opensearch.common.settings.Settings; | ||
| import org.opensearch.common.util.FeatureFlags; | ||
| import org.opensearch.test.OpenSearchIntegTestCase; | ||
|
|
||
| public class TieredSpilloverCacheBaseIT extends OpenSearchIntegTestCase { | ||
|
|
||
| public Settings defaultSettings(String onHeapCacheSizeInBytesOrPercentage, int numberOfSegments) { | ||
| return Settings.builder() | ||
| .put(FeatureFlags.PLUGGABLE_CACHE, "true") | ||
| .put( | ||
| CacheSettings.getConcreteStoreNameSettingForCacheType(CacheType.INDICES_REQUEST_CACHE).getKey(), | ||
| TieredSpilloverCache.TieredSpilloverCacheFactory.TIERED_SPILLOVER_CACHE_NAME | ||
| ) | ||
| .put( | ||
| TieredSpilloverCacheSettings.TIERED_SPILLOVER_ONHEAP_STORE_NAME.getConcreteSettingForNamespace( | ||
| CacheType.INDICES_REQUEST_CACHE.getSettingPrefix() | ||
| ).getKey(), | ||
| OpenSearchOnHeapCache.OpenSearchOnHeapCacheFactory.NAME | ||
| ) | ||
| .put( | ||
| TieredSpilloverCacheSettings.TIERED_SPILLOVER_DISK_STORE_NAME.getConcreteSettingForNamespace( | ||
| CacheType.INDICES_REQUEST_CACHE.getSettingPrefix() | ||
| ).getKey(), | ||
| MockDiskCache.MockDiskCacheFactory.NAME | ||
| ) | ||
| .put( | ||
| TieredSpilloverCacheSettings.TIERED_SPILLOVER_SEGMENTS.getConcreteSettingForNamespace( | ||
| CacheType.INDICES_REQUEST_CACHE.getSettingPrefix() | ||
| ).getKey(), | ||
| numberOfSegments | ||
| ) | ||
| .put( | ||
| TieredSpilloverCacheSettings.TIERED_SPILLOVER_ONHEAP_STORE_SIZE.getConcreteSettingForNamespace( | ||
| CacheType.INDICES_REQUEST_CACHE.getSettingPrefix() | ||
| ).getKey(), | ||
| onHeapCacheSizeInBytesOrPercentage | ||
| ) | ||
| .build(); | ||
| } | ||
|
|
||
| public int getNumberOfSegments() { | ||
| return randomFrom(1, 2, 4, 8, 16, 64, 128, 256); | ||
| } | ||
| } |
This file contains hidden or 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.
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.
Uh oh!
There was an error while loading. Please reload this page.