-
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.
Signed-off-by: Peter Alfonsi <[email protected]>
- Loading branch information
Peter Alfonsi
committed
Mar 8, 2024
1 parent
af35c6d
commit 1f7f460
Showing
5 changed files
with
182 additions
and
20 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
plugins/cache-ehcache/src/main/java/org/opensearch/cache/keystore/DummyKeystore.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.keystore; | ||
|
||
import org.opensearch.common.cache.keystore.KeyLookupStore; | ||
|
||
/** | ||
* A dummy keystore, which will always report that a key is contained in it. | ||
*/ | ||
public class DummyKeystore implements KeyLookupStore<Integer> { | ||
@Override | ||
public boolean add(Integer value) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean contains(Integer value) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean remove(Integer value) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public int getSize() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public long getMemorySizeInBytes() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public long getMemorySizeCapInBytes() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public boolean isFull() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public void regenerateStore(Integer[] newValues) {} | ||
|
||
@Override | ||
public void clear() {} | ||
} |
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