Skip to content

Commit

Permalink
Merge pull request #358 from elastic/main
Browse files Browse the repository at this point in the history
🤖 ESQL: Merge upstream
  • Loading branch information
elasticsearchmachine authored Nov 4, 2022
2 parents 792d614 + af537cc commit 7cc9bb6
Show file tree
Hide file tree
Showing 111 changed files with 3,587 additions and 507 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class StablePluginBuildPluginFuncTest extends AbstractGradleFuncTest {
import org.elasticsearch.plugin.api.NamedComponent;
import org.elasticsearch.plugin.scanner.test_classes.ExtensibleClass;
@NamedComponent(name = "componentA")
@NamedComponent( "componentA")
public class A extends ExtensibleClass {
}
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public Map<String, Map<String, String>> scanForNamedClasses(Collection<ClassRead
"Lorg/elasticsearch/plugin/api/NamedComponent;"/*NamedComponent.class*/,
(classname, map) -> new AnnotationVisitor(Opcodes.ASM9) {
@Override
public void visit(String name, Object value) {
assert name.equals("name");
public void visit(String key, Object value) {
assert key.equals("value");
assert value instanceof String;
map.put(value.toString(), classname);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ class NamedComponentScannerSpec extends Specification {
package p;
import org.elasticsearch.plugin.api.*;
import org.elasticsearch.plugin.scanner.test_classes.*;
@NamedComponent(name = "a_component")
@NamedComponent("a_component")
public class A extends ExtensibleClass {}
"""
), "p/B.class", InMemoryJavaCompiler.compile(
"p.B", """
package p;
import org.elasticsearch.plugin.api.*;
import org.elasticsearch.plugin.scanner.test_classes.*;
@NamedComponent(name = "b_component")
@NamedComponent("b_component")
public class B implements ExtensibleInterface{}
"""
)
Expand Down Expand Up @@ -136,15 +136,15 @@ class NamedComponentScannerSpec extends Specification {
package p;
import org.elasticsearch.plugin.api.*;
import org.elasticsearch.plugin.scanner.test_classes.*;
@NamedComponent(name = "a_component")
@NamedComponent("a_component")
public class A extends CustomExtensibleClass {}
""",
"p.B",
"""
package p;
import org.elasticsearch.plugin.api.*;
import org.elasticsearch.plugin.scanner.test_classes.*;
@NamedComponent(name = "b_component")
@NamedComponent("b_component")
public class B implements CustomExtensibleInterface{}
"""
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
* The name used for registration and lookup
* @return a name
*/
String name();
String value();
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

package org.elasticsearch.plugin.scanner.test_classes;

@org.elasticsearch.plugin.api.NamedComponent(name = "test_named_component")
@org.elasticsearch.plugin.api.NamedComponent("test_named_component")
public class TestNamedComponent implements ExtensibleInterface {

}
5 changes: 5 additions & 0 deletions docs/changelog/91019.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 91019
summary: Store write load in the `IndexMetadata` during data streams rollovers
area: Allocation
type: enhancement
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/91231.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 91231
summary: Fix index expression options for requests with a single name or pattern
area: Infra/Core
type: bug
issues: []
6 changes: 6 additions & 0 deletions docs/changelog/91234.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 91234
summary: Low priority trained model deployments
area: Machine Learning
type: enhancement
issues:
- 91024
5 changes: 5 additions & 0 deletions docs/changelog/91289.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 91289
summary: Fix `TransportActionProxy` for local execution
area: Network
type: bug
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/91299.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 91299
summary: Add ability to filter and sort buckets by `change_point` numeric values
area: Machine Learning
type: enhancement
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/91306.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 91306
summary: Rename `NamedComponent` name parameter to value
area: Infra/Plugins
type: enhancement
issues: []
5 changes: 3 additions & 2 deletions docs/reference/data-streams/set-up-tsds.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,9 @@ To automatically create your TSDS, submit an indexing request that
targets the TSDS's name. This name must match one of your index template's
index patterns.

To test the following example, update the timestamps to within the 24 hours after
your current time.
IMPORTANT: To test the following example, update the timestamps to within three hours of
your current time. Data added to a TSDS must always fall within an
<<tsds-accepted-time-range,accepted time range>>.

[source,console]
----
Expand Down
20 changes: 20 additions & 0 deletions docs/reference/data-streams/tsds.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,26 @@ value borders the `index.time_series.start_time` for the new write index. This
ensures the `@timestamp` ranges for neighboring backing indices always border
but never overlap.

[discrete]
[[tsds-accepted-time-range]]
==== Accepted time range for adding data

A TSDS is designed to ingest current metrics data. When the TSDS is first
created the initial backing index has:

* an `index.time_series.start_time` value set to `now - index.look_ahead_time`
* an `index.time_series.end_time` value set to `now + index.look_ahead_time`

Only data that falls inside that range can be indexed.

In our <<tsds-create-index-settings-component-template,TSDS example>>,
`index.look_ahead_time` is set to three hours, so only documents with a
`@timestamp` value that is within three hours previous or subsequent to the
present time are accepted for indexing.

You can use the <<indices-get-data-stream,get data stream API>> to check the
accepted time range for writing to any TSDS.

[discrete]
[[dimension-based-routing]]
==== Dimension-based routing
Expand Down
22 changes: 13 additions & 9 deletions docs/reference/ml/anomaly-detection/apis/get-record.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,19 @@ configuration. For example, `max`.
(string) The description of the function in which the anomaly occurs, as
specified in the detector configuration.

`geo_results.actual_point`::
(string) The actual value for the bucket formatted as a `geo_point`. If the
detector function is `lat_long`, this is a comma delimited string of the
latitude and longitude.

`geo_results.typical_point`::
(string) The typical value for the bucket formatted as a `geo_point`. If the
detector function is `lat_long`, this is a comma delimited string of the
latitude and longitude.
`geo_results`::
(optional, object) If the detector function is `lat_long`, this object contains
comma delimited strings for the latitude and longitude of the actual and typical values.
+
.Properties of `geo_results`
[%collapsible%open]
====
`actual_point`::
(string) The actual value for the bucket formatted as a `geo_point`.
`typical_point`::
(string) The typical value for the bucket formatted as a `geo_point`.
====

`influencers`::
(array) If `influencers` was specified in the detector configuration, this array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,10 @@ The peak number of requests processed in a 1 minute period for
all nodes in the deployment. This is calculated as the sum of
each node's `peak_throughput_per_minute` value.

`priority`:::
(string)
The deployment priority.

`rejected_execution_count`:::
(integer)
The sum of `rejected_execution_count` for all nodes in the deployment.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,26 @@ The total number of allocations this model is assigned across {ml} nodes.
Increasing this value generally increases the throughput.
Defaults to 1.

`priority`::
(Optional, string)
The priority of the deployment. The default value is `normal`.

There are two priority settings:
+
--
* `normal`: Use this for deployments in production.
The deployment allocations are distributed so that node processors are not oversubscribed.
* `low`: Use this for testing model functionality.
The intention is that these deployments are not sent a high volume of input.
The deployment is required to have a single allocation with just one thread.
Low priority deployments may be assigned on nodes that already utilize all their processors
but will be given a lower CPU priority than normal deployments. Low priority deployments may be unassigned in order
to satisfy more allocations of normal priority deployments.
--

WARNING: Heavy usage of low priority deployments may impact performance of normal
priority deployments.

`queue_capacity`::
(Optional, integer)
Controls how many inference requests are allowed in the queue at a time.
Expand Down Expand Up @@ -116,7 +136,8 @@ The API returns the following results:
"model_bytes": 265632637,
"threads_per_allocation" : 1,
"number_of_allocations" : 1,
"queue_capacity" : 1024
"queue_capacity" : 1024,
"priority": "normal"
},
"routing_table": {
"uckeG3R8TLe2MMNBQ6AGrw": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public interface Nameable {
default String name() {
NamedComponent[] annotationsByType = this.getClass().getAnnotationsByType(NamedComponent.class);
if (annotationsByType.length == 1) {
return annotationsByType[0].name();
return annotationsByType[0].value();
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
* The name used for registration and lookup
* @return a name
*/
String name();
String value();
}
Loading

0 comments on commit 7cc9bb6

Please sign in to comment.