Skip to content

Commit

Permalink
Merge branch 'main' of github.com:opensearch-project/OpenSearch into …
Browse files Browse the repository at this point in the history
…ac-pr-final-1
  • Loading branch information
bharath-techie committed Sep 12, 2023
2 parents 5fb7d51 + 1c8d171 commit 20f5d1a
Show file tree
Hide file tree
Showing 220 changed files with 3,376 additions and 3,051 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/check-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,18 @@ jobs:
with:
name: results.txt

- name: Find Comment
uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: ${{ github.event.number }}
comment-author: 'github-actions[bot]'
body-includes: 'Compatibility status:'

- name: Add comment on the PR
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.number }}
body-path: results.txt
edit-mode: replace
6 changes: 3 additions & 3 deletions .github/workflows/gradle-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:

- name: Create Comment Success
if: ${{ github.event_name == 'pull_request_target' && success() && env.result == 'SUCCESS' }}
uses: peter-evans/create-or-update-comment@v2
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ env.pr_number }}
body: |
Expand All @@ -104,7 +104,7 @@ jobs:
- name: Create Comment Flaky
if: ${{ github.event_name == 'pull_request_target' && success() && env.result != 'SUCCESS' }}
uses: peter-evans/create-or-update-comment@v2
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ env.pr_number }}
body: |
Expand All @@ -116,7 +116,7 @@ jobs:
- name: Create Comment Failure
if: ${{ github.event_name == 'pull_request_target' && failure() }}
uses: peter-evans/create-or-update-comment@v2
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ env.pr_number }}
body: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/poc-checklist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
issues: write
steps:
- name: Add comment
uses: peter-evans/create-or-update-comment@v2
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.issue.number }}
body: |
Expand Down
124 changes: 6 additions & 118 deletions CHANGELOG.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
/*
* 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;

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;
import java.util.function.Supplier;

@Fork(value = 3)
@Warmup(iterations = 3, time = 1)
@Measurement(iterations = 1, time = 1)
@BenchmarkMode(Mode.Throughput)
public class ArrayRoundingBenchmark {

@Benchmark
public void round(Blackhole bh, Options opts) {
Rounding.Prepared rounding = opts.supplier.get();
for (long key : opts.queries) {
bh.consume(rounding.round(key));
}
}

@State(Scope.Benchmark)
public static class Options {
@Param({
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"12",
"14",
"16",
"18",
"20",
"22",
"24",
"26",
"29",
"32",
"37",
"41",
"45",
"49",
"54",
"60",
"64",
"74",
"83",
"90",
"98",
"108",
"118",
"128",
"144",
"159",
"171",
"187",
"204",
"229",
"256" })
public Integer size;

@Param({ "binary", "linear" })
public String type;

@Param({ "uniform", "skewed_edge", "skewed_center" })
public String distribution;

public long[] queries;
public Supplier<Rounding.Prepared> supplier;

@Setup
public void setup() {
Random random = new Random(size);
long[] values = new long[size];
for (int i = 1; i < values.length; i++) {
values[i] = values[i - 1] + 100;
}

long range = values[values.length - 1] - values[0] + 100;
long mean, stddev;
queries = new long[1000000];

switch (distribution) {
case "uniform": // all values equally likely.
for (int i = 0; i < queries.length; i++) {
queries[i] = values[0] + (nextPositiveLong(random) % range);
}
break;
case "skewed_edge": // distribution centered at p90 with ± 5% stddev.
mean = values[0] + (long) (range * 0.9);
stddev = (long) (range * 0.05);
for (int i = 0; i < queries.length; i++) {
queries[i] = Math.max(values[0], mean + (long) (random.nextGaussian() * stddev));
}
break;
case "skewed_center": // distribution centered at p50 with ± 5% stddev.
mean = values[0] + (long) (range * 0.5);
stddev = (long) (range * 0.05);
for (int i = 0; i < queries.length; i++) {
queries[i] = Math.max(values[0], mean + (long) (random.nextGaussian() * stddev));
}
break;
default:
throw new IllegalArgumentException("invalid distribution: " + distribution);
}

switch (type) {
case "binary":
supplier = () -> new Rounding.BinarySearchArrayRounding(values, size, null);
break;
case "linear":
supplier = () -> new Rounding.BidirectionalLinearSearchArrayRounding(values, size, null);
break;
default:
throw new IllegalArgumentException("invalid type: " + type);
}
}

private static long nextPositiveLong(Random random) {
return random.nextLong() & Long.MAX_VALUE;
}
}
}
8 changes: 0 additions & 8 deletions distribution/src/config/opensearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,10 @@ ${path.logs}
# node.attr.remote_store.translog.repository: my-repo-1
#
# ---------------------------------- Experimental Features -----------------------------------
#
# Gates the visibility of the experimental segment replication features until they are production ready.
#
#opensearch.experimental.feature.segment_replication_experimental.enabled: false
#
#
# Gates the visibility of the index setting that allows persisting data to remote store along with local disk.
# Once the feature is ready for production release, this feature flag can be removed.
#
#opensearch.experimental.feature.remote_store.enabled: false
#
#
# Gates the functionality of a new parameter to the snapshot restore API
# that allows for creation of a new index type that searches a snapshot
# directly in a remote repository without restoring all index data to disk
Expand Down
40 changes: 27 additions & 13 deletions libs/cli/src/main/java/org/opensearch/cli/ExitCodes.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,34 @@
* POSIX exit codes.
*/
public class ExitCodes {
/** No error */
public static final int OK = 0;
public static final int USAGE = 64; /* command line usage error */
public static final int DATA_ERROR = 65; /* data format error */
public static final int NO_INPUT = 66; /* cannot open input */
public static final int NO_USER = 67; /* addressee unknown */
public static final int NO_HOST = 68; /* host name unknown */
public static final int UNAVAILABLE = 69; /* service unavailable */
public static final int CODE_ERROR = 70; /* internal software error */
public static final int CANT_CREATE = 73; /* can't create (user) output file */
public static final int IO_ERROR = 74; /* input/output error */
public static final int TEMP_FAILURE = 75; /* temp failure; user is invited to retry */
public static final int PROTOCOL = 76; /* remote error in protocol */
public static final int NOPERM = 77; /* permission denied */
public static final int CONFIG = 78; /* configuration error */
/** command line usage error */
public static final int USAGE = 64;
/** data format error */
public static final int DATA_ERROR = 65;
/** cannot open input */
public static final int NO_INPUT = 66;
/** addressee unknown */
public static final int NO_USER = 67;
/** host name unknown */
public static final int NO_HOST = 68;
/** service unavailable */
public static final int UNAVAILABLE = 69;
/** internal software error */
public static final int CODE_ERROR = 70;
/** can't create (user) output file */
public static final int CANT_CREATE = 73;
/** input/output error */
public static final int IO_ERROR = 74;
/** temp failure; user is invited to retry */
public static final int TEMP_FAILURE = 75;
/** remote error in protocol */
public static final int PROTOCOL = 76;
/** permission denied */
public static final int NOPERM = 77;
/** configuration error */
public static final int CONFIG = 78;

private ExitCodes() { /* no instance, just constants */ }
}
Loading

0 comments on commit 20f5d1a

Please sign in to comment.