Skip to content

Commit f867acf

Browse files
Merge branch 'main' of github.com:opensearch-project/OpenSearch into ac-pr-final-1
2 parents 5fb7d51 + 1c8d171 commit f867acf

216 files changed

Lines changed: 3032 additions & 3044 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/check-compatibility.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,18 @@ jobs:
5252
with:
5353
name: results.txt
5454

55+
- name: Find Comment
56+
uses: peter-evans/find-comment@v2
57+
id: fc
58+
with:
59+
issue-number: ${{ github.event.number }}
60+
comment-author: 'github-actions[bot]'
61+
body-includes: 'Compatibility status:'
62+
5563
- name: Add comment on the PR
5664
uses: peter-evans/create-or-update-comment@v3
5765
with:
66+
comment-id: ${{ steps.fc.outputs.comment-id }}
5867
issue-number: ${{ github.event.number }}
5968
body-path: results.txt
69+
edit-mode: replace

.github/workflows/gradle-check.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878

7979
- name: Create Comment Success
8080
if: ${{ github.event_name == 'pull_request_target' && success() && env.result == 'SUCCESS' }}
81-
uses: peter-evans/create-or-update-comment@v2
81+
uses: peter-evans/create-or-update-comment@v3
8282
with:
8383
issue-number: ${{ env.pr_number }}
8484
body: |
@@ -104,7 +104,7 @@ jobs:
104104
105105
- name: Create Comment Flaky
106106
if: ${{ github.event_name == 'pull_request_target' && success() && env.result != 'SUCCESS' }}
107-
uses: peter-evans/create-or-update-comment@v2
107+
uses: peter-evans/create-or-update-comment@v3
108108
with:
109109
issue-number: ${{ env.pr_number }}
110110
body: |
@@ -116,7 +116,7 @@ jobs:
116116
117117
- name: Create Comment Failure
118118
if: ${{ github.event_name == 'pull_request_target' && failure() }}
119-
uses: peter-evans/create-or-update-comment@v2
119+
uses: peter-evans/create-or-update-comment@v3
120120
with:
121121
issue-number: ${{ env.pr_number }}
122122
body: |

.github/workflows/poc-checklist.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
issues: write
1212
steps:
1313
- name: Add comment
14-
uses: peter-evans/create-or-update-comment@v2
14+
uses: peter-evans/create-or-update-comment@v3
1515
with:
1616
issue-number: ${{ github.event.issue.number }}
1717
body: |

CHANGELOG.md

Lines changed: 6 additions & 118 deletions
Large diffs are not rendered by default.
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
9+
package org.opensearch.common;
10+
11+
import org.openjdk.jmh.annotations.Benchmark;
12+
import org.openjdk.jmh.annotations.BenchmarkMode;
13+
import org.openjdk.jmh.annotations.Fork;
14+
import org.openjdk.jmh.annotations.Measurement;
15+
import org.openjdk.jmh.annotations.Mode;
16+
import org.openjdk.jmh.annotations.Param;
17+
import org.openjdk.jmh.annotations.Scope;
18+
import org.openjdk.jmh.annotations.Setup;
19+
import org.openjdk.jmh.annotations.State;
20+
import org.openjdk.jmh.annotations.Warmup;
21+
import org.openjdk.jmh.infra.Blackhole;
22+
23+
import java.util.Random;
24+
import java.util.function.Supplier;
25+
26+
@Fork(value = 3)
27+
@Warmup(iterations = 3, time = 1)
28+
@Measurement(iterations = 1, time = 1)
29+
@BenchmarkMode(Mode.Throughput)
30+
public class ArrayRoundingBenchmark {
31+
32+
@Benchmark
33+
public void round(Blackhole bh, Options opts) {
34+
Rounding.Prepared rounding = opts.supplier.get();
35+
for (long key : opts.queries) {
36+
bh.consume(rounding.round(key));
37+
}
38+
}
39+
40+
@State(Scope.Benchmark)
41+
public static class Options {
42+
@Param({
43+
"1",
44+
"2",
45+
"3",
46+
"4",
47+
"5",
48+
"6",
49+
"7",
50+
"8",
51+
"9",
52+
"10",
53+
"12",
54+
"14",
55+
"16",
56+
"18",
57+
"20",
58+
"22",
59+
"24",
60+
"26",
61+
"29",
62+
"32",
63+
"37",
64+
"41",
65+
"45",
66+
"49",
67+
"54",
68+
"60",
69+
"64",
70+
"74",
71+
"83",
72+
"90",
73+
"98",
74+
"108",
75+
"118",
76+
"128",
77+
"144",
78+
"159",
79+
"171",
80+
"187",
81+
"204",
82+
"229",
83+
"256" })
84+
public Integer size;
85+
86+
@Param({ "binary", "linear" })
87+
public String type;
88+
89+
@Param({ "uniform", "skewed_edge", "skewed_center" })
90+
public String distribution;
91+
92+
public long[] queries;
93+
public Supplier<Rounding.Prepared> supplier;
94+
95+
@Setup
96+
public void setup() {
97+
Random random = new Random(size);
98+
long[] values = new long[size];
99+
for (int i = 1; i < values.length; i++) {
100+
values[i] = values[i - 1] + 100;
101+
}
102+
103+
long range = values[values.length - 1] - values[0] + 100;
104+
long mean, stddev;
105+
queries = new long[1000000];
106+
107+
switch (distribution) {
108+
case "uniform": // all values equally likely.
109+
for (int i = 0; i < queries.length; i++) {
110+
queries[i] = values[0] + (nextPositiveLong(random) % range);
111+
}
112+
break;
113+
case "skewed_edge": // distribution centered at p90 with ± 5% stddev.
114+
mean = values[0] + (long) (range * 0.9);
115+
stddev = (long) (range * 0.05);
116+
for (int i = 0; i < queries.length; i++) {
117+
queries[i] = Math.max(values[0], mean + (long) (random.nextGaussian() * stddev));
118+
}
119+
break;
120+
case "skewed_center": // distribution centered at p50 with ± 5% stddev.
121+
mean = values[0] + (long) (range * 0.5);
122+
stddev = (long) (range * 0.05);
123+
for (int i = 0; i < queries.length; i++) {
124+
queries[i] = Math.max(values[0], mean + (long) (random.nextGaussian() * stddev));
125+
}
126+
break;
127+
default:
128+
throw new IllegalArgumentException("invalid distribution: " + distribution);
129+
}
130+
131+
switch (type) {
132+
case "binary":
133+
supplier = () -> new Rounding.BinarySearchArrayRounding(values, size, null);
134+
break;
135+
case "linear":
136+
supplier = () -> new Rounding.BidirectionalLinearSearchArrayRounding(values, size, null);
137+
break;
138+
default:
139+
throw new IllegalArgumentException("invalid type: " + type);
140+
}
141+
}
142+
143+
private static long nextPositiveLong(Random random) {
144+
return random.nextLong() & Long.MAX_VALUE;
145+
}
146+
}
147+
}

distribution/src/config/opensearch.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,10 @@ ${path.logs}
9898
# node.attr.remote_store.translog.repository: my-repo-1
9999
#
100100
# ---------------------------------- Experimental Features -----------------------------------
101-
#
102101
# Gates the visibility of the experimental segment replication features until they are production ready.
103102
#
104103
#opensearch.experimental.feature.segment_replication_experimental.enabled: false
105104
#
106-
#
107-
# Gates the visibility of the index setting that allows persisting data to remote store along with local disk.
108-
# Once the feature is ready for production release, this feature flag can be removed.
109-
#
110-
#opensearch.experimental.feature.remote_store.enabled: false
111-
#
112-
#
113105
# Gates the functionality of a new parameter to the snapshot restore API
114106
# that allows for creation of a new index type that searches a snapshot
115107
# directly in a remote repository without restoring all index data to disk

libs/cli/src/main/java/org/opensearch/cli/ExitCodes.java

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,34 @@
3636
* POSIX exit codes.
3737
*/
3838
public class ExitCodes {
39+
/** No error */
3940
public static final int OK = 0;
40-
public static final int USAGE = 64; /* command line usage error */
41-
public static final int DATA_ERROR = 65; /* data format error */
42-
public static final int NO_INPUT = 66; /* cannot open input */
43-
public static final int NO_USER = 67; /* addressee unknown */
44-
public static final int NO_HOST = 68; /* host name unknown */
45-
public static final int UNAVAILABLE = 69; /* service unavailable */
46-
public static final int CODE_ERROR = 70; /* internal software error */
47-
public static final int CANT_CREATE = 73; /* can't create (user) output file */
48-
public static final int IO_ERROR = 74; /* input/output error */
49-
public static final int TEMP_FAILURE = 75; /* temp failure; user is invited to retry */
50-
public static final int PROTOCOL = 76; /* remote error in protocol */
51-
public static final int NOPERM = 77; /* permission denied */
52-
public static final int CONFIG = 78; /* configuration error */
41+
/** command line usage error */
42+
public static final int USAGE = 64;
43+
/** data format error */
44+
public static final int DATA_ERROR = 65;
45+
/** cannot open input */
46+
public static final int NO_INPUT = 66;
47+
/** addressee unknown */
48+
public static final int NO_USER = 67;
49+
/** host name unknown */
50+
public static final int NO_HOST = 68;
51+
/** service unavailable */
52+
public static final int UNAVAILABLE = 69;
53+
/** internal software error */
54+
public static final int CODE_ERROR = 70;
55+
/** can't create (user) output file */
56+
public static final int CANT_CREATE = 73;
57+
/** input/output error */
58+
public static final int IO_ERROR = 74;
59+
/** temp failure; user is invited to retry */
60+
public static final int TEMP_FAILURE = 75;
61+
/** remote error in protocol */
62+
public static final int PROTOCOL = 76;
63+
/** permission denied */
64+
public static final int NOPERM = 77;
65+
/** configuration error */
66+
public static final int CONFIG = 78;
5367

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

0 commit comments

Comments
 (0)