Skip to content

Commit 0086e78

Browse files
committed
cleanup from merging
Signed-off-by: TJ Neuenfeldt <tjneu@amazon.com>
1 parent 4ed2b3c commit 0086e78

16 files changed

+33
-53
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1111
- Introduce SecureHttpTransportParameters experimental API (to complement SecureTransportParameters counterpart) ([#18572](https://github.com/opensearch-project/OpenSearch/issues/18572))
1212
- Create equivalents of JSM's AccessController in the java agent ([#18346](https://github.com/opensearch-project/OpenSearch/issues/18346))
1313
- Introduced a new cluster-level API to fetch remote store metadata (segments and translogs) for each shard of an index. ([#18257](https://github.com/opensearch-project/OpenSearch/pull/18257))
14+
- Add last index request timestamp columns to the `_cat/indices` API. ([10766](https://github.com/opensearch-project/OpenSearch/issues/10766))
15+
- Introduce a new pull-based ingestion plugin for file-based indexing (for local testing) ([#18591](https://github.com/opensearch-project/OpenSearch/pull/18591))
1416
- Add support for search pipeline in search and msearch template ([#18564](https://github.com/opensearch-project/OpenSearch/pull/18564))
1517
- Add support for non-timing info in profiler ([#18460](https://github.com/opensearch-project/OpenSearch/issues/18460))
1618

@@ -31,6 +33,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
3133
### Fixed
3234
- Add task cancellation checks in aggregators ([#18426](https://github.com/opensearch-project/OpenSearch/pull/18426))
3335
- Fix concurrent timings in profiler ([#18540](https://github.com/opensearch-project/OpenSearch/pull/18540))
36+
- Cannot communicate with HTTP/2 when reactor-netty is enabled ([#18599](https://github.com/opensearch-project/OpenSearch/pull/18599))
3437

3538
### Security
3639

server/src/main/java/org/opensearch/plugins/SearchPlugin.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@
9696
* @opensearch.api
9797
*/
9898
public interface SearchPlugin {
99-
10099
/**
101100
* The new {@link ScoreFunction}s defined by this plugin.
102101
*/

server/src/main/java/org/opensearch/search/internal/ContextIndexSearcher.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,10 @@ private ContextIndexSearcher(
152152
this.searchContext = searchContext;
153153
}
154154

155-
public void setQueryProfiler(QueryProfiler profiler) {
155+
public void setProfiler(QueryProfiler profiler) {
156156
this.profiler = profiler;
157157
}
158158

159-
public QueryProfiler getQueryProfiler() {
160-
return profiler;
161-
}
162-
163159
/**
164160
* Add a {@link Runnable} that will be run on a regular basis while accessing documents in the
165161
* DirectoryReader but also while collecting them and check for query cancellation or timeout.
@@ -217,12 +213,7 @@ public Weight createWeight(Query query, ScoreMode scoreMode, float boost) throws
217213
// createWeight() is called for each query in the tree, so we tell the queryProfiler
218214
// each invocation so that it can build an internal representation of the query
219215
// tree
220-
ContextualProfileBreakdown profile = null;
221-
try {
222-
profile = profiler.getQueryBreakdown(query);
223-
} catch (Exception e) {
224-
throw new RuntimeException(e);
225-
}
216+
ContextualProfileBreakdown profile = profiler.getQueryBreakdown(query);
226217
Timer timer = profile.getTimer(QueryTimingType.CREATE_WEIGHT);
227218
timer.start();
228219
final Weight weight;

server/src/main/java/org/opensearch/search/profile/AbstractInternalProfileTree.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,4 @@ private void updateParent(int childToken) {
210210
tree.set(parent, parentNode);
211211
}
212212

213-
public PB getStackTop() {
214-
assert stack.isEmpty() == false;
215-
return breakdowns.get(stack.peekLast());
216-
}
217-
218213
}

server/src/main/java/org/opensearch/search/profile/AbstractProfileBreakdown.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232

3333
package org.opensearch.search.profile;
3434

35-
import org.opensearch.common.annotation.PublicApi;
36-
3735
import java.util.HashMap;
3836
import java.util.Map;
3937
import java.util.TreeMap;
@@ -47,7 +45,6 @@
4745
*
4846
* @opensearch.internal
4947
*/
50-
@PublicApi(since = "3.0.0")
5148
public abstract class AbstractProfileBreakdown {
5249

5350
public static final String NODE_TIME_RAW = "time_in_nanos";

server/src/main/java/org/opensearch/search/profile/AbstractProfiler.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,13 @@
3232

3333
package org.opensearch.search.profile;
3434

35-
import org.opensearch.common.annotation.PublicApi;
36-
3735
import java.util.List;
3836

3937
/**
4038
* Base class for a profiler
4139
*
4240
* @opensearch.internal
4341
*/
44-
@PublicApi(since = "3.0.0")
4542
public abstract class AbstractProfiler<PB extends AbstractProfileBreakdown, E> {
4643

4744
protected final AbstractInternalProfileTree<PB, E> profileTree;

server/src/main/java/org/opensearch/search/profile/ContextualProfileBreakdown.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,27 @@
1010

1111
import org.apache.lucene.index.LeafReaderContext;
1212
import org.apache.lucene.search.Collector;
13-
import org.opensearch.common.annotation.PublicApi;
1413

1514
import java.util.List;
1615
import java.util.Map;
1716

1817
/**
19-
* A {@link AbstractProfileBreakdown} for query timings with contexts.
18+
* Provide contextual profile breakdowns which are associated with freestyle context. Used when concurrent
19+
* search over segments is activated and each collector needs own non-shareable profile breakdown instance.
20+
*
21+
* @opensearch.internal
2022
*/
21-
@PublicApi(since = "3.0.0")
2223
public abstract class ContextualProfileBreakdown extends AbstractProfileBreakdown {
2324

24-
/**
25-
* Sole constructor.
26-
*
27-
* @param metrics
28-
*/
2925
public ContextualProfileBreakdown(Map<String, Class<? extends ProfileMetric>> metrics) {
3026
super(metrics);
3127
}
3228

29+
/**
30+
* Return (or create) contextual profile breakdown instance
31+
* @param context freestyle context
32+
* @return contextual profile breakdown instance
33+
*/
3334
public abstract ContextualProfileBreakdown context(Object context);
3435

3536
public void associateCollectorToLeaves(Collector collector, LeafReaderContext leaf) {}

server/src/main/java/org/opensearch/search/profile/Profilers.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public QueryProfiler addQueryProfiler() {
7272
QueryProfiler profiler = isConcurrentSegmentSearchEnabled
7373
? new ConcurrentQueryProfiler(new ConcurrentQueryProfileTree())
7474
: new QueryProfiler(new InternalQueryProfileTree());
75-
searcher.setQueryProfiler(profiler);
75+
searcher.setProfiler(profiler);
7676
queryProfilers.add(profiler);
7777
return profiler;
7878
}

server/src/main/java/org/opensearch/search/profile/Timer.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232

3333
package org.opensearch.search.profile;
3434

35-
import org.opensearch.common.annotation.PublicApi;
36-
3735
import java.util.HashMap;
3836
import java.util.Map;
3937

@@ -53,7 +51,6 @@
5351
*
5452
* @opensearch.internal
5553
*/
56-
@PublicApi(since = "3.0.0")
5754
public class Timer extends ProfileMetric {
5855
public static final String TIMING_TYPE_COUNT_SUFFIX = "_count";
5956
public static final String TIMING_TYPE_START_TIME_SUFFIX = "_start_time";
@@ -62,7 +59,7 @@ public class Timer extends ProfileMetric {
6259
private long timing, count, lastCount, start, earliestTimerStartTime;
6360

6461
public Timer() {
65-
super("");
62+
this(0, 0, 0, 0, 0);
6663
}
6764

6865
public Timer(long timing, long count, long lastCount, long start, long earliestTimerStartTime) {

server/src/main/java/org/opensearch/search/profile/query/ConcurrentQueryProfiler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public List<ProfileResult> getTree() {
8181
*/
8282
@Override
8383
public void startRewriteTime() {
84-
Timer rewriteTimer = new Timer("rewrite_timer");
84+
Timer rewriteTimer = new Timer();
8585
threadToRewriteTimers.computeIfAbsent(getCurrentThreadId(), k -> new LinkedList<>()).add(rewriteTimer);
8686
rewriteTimer.start();
8787
}

0 commit comments

Comments
 (0)