-
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 branch 'main' into autoconfig-changes-PR
Signed-off-by: shephali mittal <[email protected]>
- Loading branch information
Showing
245 changed files
with
4,341 additions
and
721 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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 |
---|---|---|
@@ -1 +1 @@ | ||
* @reta @anasalkouz @andrross @reta @Bukhtawar @CEHENKLE @dblock @gbbafna @setiah @kartg @kotwanikunal @mch2 @nknize @owaiskazi19 @Rishikesh1159 @ryanbogan @saratvemulapalli @shwetathareja @dreamer-89 @tlfeng @VachaShah @dbwiddis @sachinpkale @sohami | ||
* @reta @anasalkouz @andrross @reta @Bukhtawar @CEHENKLE @dblock @gbbafna @setiah @kartg @kotwanikunal @mch2 @nknize @owaiskazi19 @Rishikesh1159 @ryanbogan @saratvemulapalli @shwetathareja @dreamer-89 @tlfeng @VachaShah @dbwiddis @sachinpkale @sohami @msfroh |
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 |
---|---|---|
|
@@ -5,11 +5,15 @@ on: | |
pull_request_target | ||
|
||
jobs: | ||
build: | ||
check-compatibility: | ||
if: github.repository == 'opensearch-project/OpenSearch' | ||
permissions: | ||
contents: read | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Run compatibility task | ||
run: ./gradlew checkCompatibility -i | tee $HOME/gradlew-check.out | ||
|
@@ -22,17 +26,25 @@ jobs: | |
echo "### Skipped components" >> "${{ github.workspace }}/results.txt" && grep -e 'Skipped component' $HOME/gradlew-check.out | sed -e 's/Skipped component: \[\(.*\)\]/- \1/' >> "${{ github.workspace }}/results.txt" | ||
echo "### Compatible components" >> "${{ github.workspace }}/results.txt" && grep -e 'Compatible component' $HOME/gradlew-check.out | sed -e 's/Compatible component: \[\(.*\)\]/- \1/' >> "${{ github.workspace }}/results.txt" | ||
- name: GitHub App token | ||
id: github_app_token | ||
uses: tibdex/[email protected] | ||
- name: Upload results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: results.txt | ||
path: ${{ github.workspace }}/results.txt | ||
|
||
add-comment: | ||
needs: [check-compatibility] | ||
permissions: | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download results | ||
uses: actions/download-artifact@v3 | ||
with: | ||
app_id: ${{ secrets.APP_ID }} | ||
private_key: ${{ secrets.APP_PRIVATE_KEY }} | ||
installation_id: 22958780 | ||
name: results.txt | ||
|
||
- name: Add comment on the PR | ||
uses: peter-evans/create-or-update-comment@v3 | ||
with: | ||
token: ${{ steps.github_app_token.outputs.token }} | ||
issue-number: ${{ github.event.number }} | ||
body-path: "${{ github.workspace }}/results.txt" | ||
body-path: results.txt |
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
172 changes: 172 additions & 0 deletions
172
benchmarks/src/main/java/org/opensearch/common/hash/HashFunctionBenchmark.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,172 @@ | ||
/* | ||
* 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.hash; | ||
|
||
import org.apache.lucene.util.StringHelper; | ||
import org.openjdk.jmh.annotations.Benchmark; | ||
import org.openjdk.jmh.annotations.BenchmarkMode; | ||
import org.openjdk.jmh.annotations.Fork; | ||
import org.openjdk.jmh.annotations.Measurement; | ||
import org.openjdk.jmh.annotations.Mode; | ||
import org.openjdk.jmh.annotations.Param; | ||
import org.openjdk.jmh.annotations.Scope; | ||
import org.openjdk.jmh.annotations.Setup; | ||
import org.openjdk.jmh.annotations.State; | ||
import org.openjdk.jmh.annotations.Warmup; | ||
import org.openjdk.jmh.infra.Blackhole; | ||
|
||
import java.util.Random; | ||
|
||
@Fork(value = 3) | ||
@Warmup(iterations = 1, time = 1) | ||
@Measurement(iterations = 3, time = 3) | ||
@BenchmarkMode(Mode.Throughput) | ||
public class HashFunctionBenchmark { | ||
|
||
@Benchmark | ||
public void hash(Blackhole bh, Options opts) { | ||
bh.consume(opts.type.hash(opts.data)); | ||
} | ||
|
||
@State(Scope.Benchmark) | ||
public static class Options { | ||
@Param({ "MURMUR3", "T1HA1" }) | ||
public Type type; | ||
|
||
@Param({ | ||
"1", | ||
"2", | ||
"3", | ||
"4", | ||
"5", | ||
"6", | ||
"7", | ||
"8", | ||
"9", | ||
"10", | ||
"12", | ||
"14", | ||
"16", | ||
"18", | ||
"21", | ||
"24", | ||
"28", | ||
"32", | ||
"36", | ||
"41", | ||
"47", | ||
"54", | ||
"62", | ||
"71", | ||
"81", | ||
"90", | ||
"100", | ||
"112", | ||
"125", | ||
"139", | ||
"156", | ||
"174", | ||
"194", | ||
"220", | ||
"245", | ||
"272", | ||
"302", | ||
"339", | ||
"384", | ||
"431", | ||
"488", | ||
"547", | ||
"608", | ||
"675", | ||
"763", | ||
"863", | ||
"967", | ||
"1084", | ||
"1225", | ||
"1372", | ||
"1537", | ||
"1737", | ||
"1929", | ||
"2142", | ||
"2378", | ||
"2664", | ||
"3011", | ||
"3343", | ||
"3778", | ||
"4232", | ||
"4783", | ||
"5310", | ||
"5895", | ||
"6662", | ||
"7529", | ||
"8508", | ||
"9444", | ||
"10483", | ||
"11741", | ||
"13150", | ||
"14597", | ||
"16495", | ||
"18475", | ||
"20877", | ||
"23383", | ||
"25956", | ||
"29071", | ||
"32560", | ||
"36142", | ||
"40841", | ||
"46151", | ||
"52151", | ||
"57888", | ||
"65414", | ||
"72610", | ||
"82050", | ||
"91076", | ||
"102006", | ||
"114247", | ||
"127957", | ||
"143312", | ||
"159077", | ||
"176576", | ||
"199531", | ||
"223475", | ||
"250292", | ||
"277825", | ||
"313943", | ||
"351617", | ||
"393812" }) | ||
public Integer length; | ||
public byte[] data; | ||
|
||
@Setup | ||
public void setup() { | ||
data = new byte[length]; | ||
new Random(0).nextBytes(data); | ||
} | ||
} | ||
|
||
public enum Type { | ||
MURMUR3((data, offset, length) -> StringHelper.murmurhash3_x86_32(data, offset, length, 0)), | ||
T1HA1((data, offset, length) -> T1ha1.hash(data, offset, length, 0)); | ||
|
||
private final Hasher hasher; | ||
|
||
Type(Hasher hasher) { | ||
this.hasher = hasher; | ||
} | ||
|
||
public long hash(byte[] data) { | ||
return hasher.hash(data, 0, data.length); | ||
} | ||
} | ||
|
||
@FunctionalInterface | ||
interface Hasher { | ||
long hash(byte[] data, int offset, int length); | ||
} | ||
} |
Oops, something went wrong.