-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dependabot/gradle/plugins/discovery-gce/io.g…
…rpc-grpc-api-1.68.0 Signed-off-by: gaobinlong <[email protected]>
- Loading branch information
Showing
87 changed files
with
10,189 additions
and
5,657 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
57 changes: 57 additions & 0 deletions
57
...internalClusterTest/java/org/opensearch/cache/common/tier/TieredSpilloverCacheBaseIT.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,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 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.