-
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.
Merge remote-tracking branch 'sgup432/ehcache_disk_integ' into keysto…
…re-squashed
- Loading branch information
Showing
290 changed files
with
3,943 additions
and
1,104 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
35 changes: 35 additions & 0 deletions
35
benchmarks/src/main/java/org/opensearch/common/round/RoundableSupplier.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,35 @@ | ||
/* | ||
* 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.round; | ||
|
||
import java.util.function.Supplier; | ||
|
||
public class RoundableSupplier implements Supplier<Roundable> { | ||
private final Supplier<Roundable> delegate; | ||
|
||
RoundableSupplier(String type, long[] values, int size) throws ClassNotFoundException { | ||
switch (type) { | ||
case "binary": | ||
delegate = () -> new BinarySearcher(values, size); | ||
break; | ||
case "linear": | ||
delegate = () -> new BidirectionalLinearSearcher(values, size); | ||
break; | ||
case "btree": | ||
throw new ClassNotFoundException("BtreeSearcher is not supported below JDK 20"); | ||
default: | ||
throw new IllegalArgumentException("invalid type: " + type); | ||
} | ||
} | ||
|
||
@Override | ||
public Roundable get() { | ||
return delegate.get(); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
benchmarks/src/main/java20/org/opensearch/common/round/RoundableSupplier.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,36 @@ | ||
/* | ||
* 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.round; | ||
|
||
import java.util.function.Supplier; | ||
|
||
public class RoundableSupplier implements Supplier<Roundable> { | ||
private final Supplier<Roundable> delegate; | ||
|
||
RoundableSupplier(String type, long[] values, int size) { | ||
switch (type) { | ||
case "binary": | ||
delegate = () -> new BinarySearcher(values, size); | ||
break; | ||
case "linear": | ||
delegate = () -> new BidirectionalLinearSearcher(values, size); | ||
break; | ||
case "btree": | ||
delegate = () -> new BtreeSearcher(values, size); | ||
break; | ||
default: | ||
throw new IllegalArgumentException("invalid type: " + type); | ||
} | ||
} | ||
|
||
@Override | ||
public Roundable get() { | ||
return delegate.get(); | ||
} | ||
} |
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
Oops, something went wrong.