-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
File System Caching for remote store
Part of this commit was developed from code and concepts initially implemented in Amazon OpenSearch Service as part of the UltraWarm feature. Thank you to the following developers and the entire UltraWarm team. Co-authored-by: Min Zhou <minzho@amazon.com> Co-authored-by: Ankit Malpani <malpani@amazon.com> Co-authored-by: Rohit Nair <rohinair@amazon.com> Co-authored-by: Sorabh Hamirwasia <hsorabh@amazon.com> Co-authored-by: Ankit Jain <akjain@amazon.com> Co-authored-by: Tianru Zhou <tianruz@amazon.com> Co-authored-by: Neetika Singhal <neetiks@amazon.com> Co-authored-by: Amit Khandelwal <mkhnde@amazon.com> Co-authored-by: Vigya Sharma <vigyas@amazon.com> Co-authored-by: Prateek Sharma <shrprat@amazon.com> Co-authored-by: Venkata Jyothsna Donapati <donapv@amazon.com> Co-authored-by: Vlad Rozov <vrozov@amazon.com> Co-authored-by: Mohit Agrawal <agramohi@amazon.com> Co-authored-by: Shweta Thareja <tharejas@amazon.com> Co-authored-by: Palash Hedau <phhedau@amazon.com> Co-authored-by: Saurabh Singh <sisurab@amazon.com> Co-authored-by: Piyush Daftary <pdaftary@amazon.com> Co-authored-by: Payal Maheshwari <pmaheshw@amazon.com> Co-authored-by: Kunal Khatua <kkhatua@amazon.com> Co-authored-by: Gulshan Kumar <kumargu@amazon.com> Co-authored-by: Rushi Agrawal <agrrushi@amazon.com> Co-authored-by: Ketan Verma <vermketa@amazon.com> Co-authored-by: Gaurav Chandani <chngau@amazon.com> Co-authored-by: Dharmesh Singh <sdharms@amazon.com> Signed-off-by: Ahmad AbuKhalil <abukhali@amazon.com>
- Loading branch information
1 parent
dfe5d2b
commit f3f4f04
Showing
34 changed files
with
2,895 additions
and
74 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
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
22 changes: 22 additions & 0 deletions
22
server/src/main/java/org/opensearch/common/cache/RemovalReason.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,22 @@ | ||
/* | ||
* 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.common.cache; | ||
|
||
/** | ||
* Reason for notification removal | ||
* | ||
* @opensearch.internal | ||
*/ | ||
public enum RemovalReason { | ||
REPLACED, | ||
INVALIDATED, | ||
EVICTED, | ||
EXPLICIT, | ||
CAPACITY | ||
} |
27 changes: 27 additions & 0 deletions
27
server/src/main/java/org/opensearch/common/cache/Weigher.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,27 @@ | ||
/* | ||
* 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.common.cache; | ||
|
||
/** | ||
* A class that can determine the weight of a value. The total weight threshold | ||
* is used to determine when an eviction is required. | ||
* | ||
* @opensearch.internal | ||
*/ | ||
public interface Weigher<V> { | ||
|
||
/** | ||
* Measures an object's weight to determine how many units of capacity that | ||
* the value consumes. A value must consume a minimum of one unit. | ||
* | ||
* @param value the object to weigh | ||
* @return the object's weight | ||
*/ | ||
long weightOf(V value); | ||
} |
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
34 changes: 34 additions & 0 deletions
34
server/src/main/java/org/opensearch/index/store/remote/filecache/CachedIndexInput.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,34 @@ | ||
/* | ||
* 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.index.store.remote.filecache; | ||
|
||
import org.apache.lucene.store.IndexInput; | ||
|
||
/** | ||
* Base IndexInput whose instances will be maintained in cache. | ||
* | ||
* @opensearch.internal | ||
*/ | ||
public abstract class CachedIndexInput extends IndexInput { | ||
|
||
/** | ||
* resourceDescription should be a non-null, opaque string | ||
* describing this resource; it's returned from | ||
* {@link #toString}. | ||
*/ | ||
protected CachedIndexInput(String resourceDescription) { | ||
super(resourceDescription); | ||
} | ||
|
||
/** | ||
* return true this index input is closed, false if not | ||
* @return true this index input is closed, false if not | ||
*/ | ||
public abstract boolean isClosed(); | ||
} |
Oops, something went wrong.