Skip to content

Commit

Permalink
Merge origin/master into fix/limitInInnerQueries
Browse files Browse the repository at this point in the history
  • Loading branch information
Luegg committed Aug 4, 2021
2 parents 5cb4017 + 2d7d3bd commit 9f40d30
Show file tree
Hide file tree
Showing 58 changed files with 4,426 additions and 412 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,33 @@ jobs:
commit_email: [email protected]
auto_merge: 'false'
manual_backport_command_template: 'backport --pr %pullNumber%'
backport_and_merge:
name: Backport and Merge PR
if: |
github.event.pull_request.merged == true
&& contains(github.event.pull_request.labels.*.name, 'auto-backport-and-merge')
&& (
(github.event.action == 'labeled' && github.event.label.name == 'auto-backport-and-merge')
|| (github.event.action == 'closed')
)
runs-on: ubuntu-latest
steps:
- name: Checkout Actions
uses: actions/checkout@v2
with:
repository: 'elastic/kibana-github-actions'
ref: main
path: ./actions

- name: Install Actions
run: npm install --production --prefix ./actions

- name: Run Backport
uses: ./actions/backport
with:
github_token: ${{secrets.ELASTICSEARCHMACHINE_TOKEN}}
commit_user: elasticsearchmachine
commit_email: [email protected]
target_pr_labels: 'backport, auto-merge'
auto_merge: 'false'
manual_backport_command_template: 'backport --pr %pullNumber%'
1 change: 1 addition & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions build-tools-internal/version.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
elasticsearch = 8.0.0
lucene = 8.9.0

bundled_jdk_vendor = adoptopenjdk
bundled_jdk = 16.0.1+9
bundled_jdk_vendor = openjdk
bundled_jdk = 16.0.2+7@d4a915d82b4c4fbb9bde534da945d746

checkstyle = 8.42

Expand Down Expand Up @@ -53,4 +53,4 @@ jimfs = 1.2
jimfs_guava = 30.1-jre

# test framework
networknt_json_schema_validator = 1.0.48
networknt_json_schema_validator = 1.0.48
9 changes: 9 additions & 0 deletions docs/changelog/75981.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pr: 75981
summary: Bump bundled JDK to 16.0.2
area: Packaging
type: upgrade
issues: []
versions:
- v8.0.0
- v7.14.1
- v7.15.0
6 changes: 4 additions & 2 deletions docs/reference/ml/anomaly-detection/apis/delete-job.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ Deletes an existing {anomaly-job}.

* Requires the `manage_ml` cluster privilege. This privilege is included in the
`machine_learning_admin` built-in role.
* Before you can delete a job, you must delete the {dfeeds} that are associated
with it. See <<ml-delete-datafeed>>.
* Before you can delete a job, you must close it (unless you specify the `force`
parameter). See <<ml-close-job>>.

Expand All @@ -36,6 +34,10 @@ are granted to anyone over the `.ml-*` indices.
It is not currently possible to delete multiple jobs using wildcards or a comma
separated list.

If you delete a job that has a {dfeed}, the request will first attempt to
delete the {dfeed}, as though <<ml-delete-datafeed>> was called with the same
`timeout` and `force` parameters as this delete request.

[[ml-delete-job-path-parms]]
== {api-path-parms-title}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
import org.elasticsearch.painless.symbol.IRDecorations.IRDSize;
import org.elasticsearch.painless.symbol.IRDecorations.IRDStoreType;
import org.elasticsearch.painless.symbol.IRDecorations.IRDSymbol;
import org.elasticsearch.painless.symbol.IRDecorations.IRDThisMethod;
import org.elasticsearch.painless.symbol.IRDecorations.IRDTypeParameters;
import org.elasticsearch.painless.symbol.IRDecorations.IRDUnaryType;
import org.elasticsearch.painless.symbol.IRDecorations.IRDValue;
Expand Down Expand Up @@ -1650,6 +1651,7 @@ public void visitInvokeCallMember(InvokeCallMemberNode irInvokeCallMemberNode, W
methodWriter.writeDebugInfo(irInvokeCallMemberNode.getLocation());

LocalFunction localFunction = irInvokeCallMemberNode.getDecorationValue(IRDFunction.class);
PainlessMethod thisMethod = irInvokeCallMemberNode.getDecorationValue(IRDThisMethod.class);
PainlessMethod importedMethod = irInvokeCallMemberNode.getDecorationValue(IRDMethod.class);
PainlessClassBinding classBinding = irInvokeCallMemberNode.getDecorationValue(IRDClassBinding.class);
PainlessInstanceBinding instanceBinding = irInvokeCallMemberNode.getDecorationValue(IRDInstanceBinding.class);
Expand All @@ -1669,6 +1671,16 @@ public void visitInvokeCallMember(InvokeCallMemberNode irInvokeCallMemberNode, W
} else {
methodWriter.invokeVirtual(CLASS_TYPE, localFunction.getAsmMethod());
}
} else if (thisMethod != null) {
methodWriter.loadThis();

for (ExpressionNode irArgumentNode : irArgumentNodes) {
visit(irArgumentNode, writeScope);
}

Method asmMethod = new Method(thisMethod.javaMethod.getName(),
thisMethod.methodType.dropParameterTypes(0, 1).toMethodDescriptorString());
methodWriter.invokeVirtual(CLASS_TYPE, asmMethod);
} else if (importedMethod != null) {
for (ExpressionNode irArgumentNode : irArgumentNodes) {
visit(irArgumentNode, writeScope);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
import org.elasticsearch.painless.symbol.Decorations.StandardPainlessMethod;
import org.elasticsearch.painless.symbol.Decorations.StaticType;
import org.elasticsearch.painless.symbol.Decorations.TargetType;
import org.elasticsearch.painless.symbol.Decorations.ThisPainlessMethod;
import org.elasticsearch.painless.symbol.Decorations.TypeParameters;
import org.elasticsearch.painless.symbol.Decorations.UnaryType;
import org.elasticsearch.painless.symbol.Decorations.UpcastPainlessCast;
Expand Down Expand Up @@ -1714,6 +1715,7 @@ public void visitCallLocal(ECallLocal userCallLocalNode, SemanticScope semanticS
ScriptScope scriptScope = semanticScope.getScriptScope();

FunctionTable.LocalFunction localFunction = null;
PainlessMethod thisMethod = null;
PainlessMethod importedMethod = null;
PainlessClassBinding classBinding = null;
int classBindingOffset = 0;
Expand All @@ -1728,44 +1730,47 @@ public void visitCallLocal(ECallLocal userCallLocalNode, SemanticScope semanticS
localFunction = null;
}

if (localFunction != null) {
semanticScope.setUsesInstanceMethod();
} else {
importedMethod = scriptScope.getPainlessLookup().lookupImportedPainlessMethod(methodName, userArgumentsSize);
if (localFunction == null) {
thisMethod = scriptScope.getPainlessLookup().lookupPainlessMethod(
scriptScope.getScriptClassInfo().getBaseClass(), false, methodName, userArgumentsSize);

if (importedMethod == null) {
classBinding = scriptScope.getPainlessLookup().lookupPainlessClassBinding(methodName, userArgumentsSize);
if (thisMethod == null) {
importedMethod = scriptScope.getPainlessLookup().lookupImportedPainlessMethod(methodName, userArgumentsSize);

// check to see if this class binding requires an implicit this reference
if (classBinding != null && classBinding.typeParameters.isEmpty() == false &&
classBinding.typeParameters.get(0) == scriptScope.getScriptClassInfo().getBaseClass()) {
classBinding = null;
}
if (importedMethod == null) {
classBinding = scriptScope.getPainlessLookup().lookupPainlessClassBinding(methodName, userArgumentsSize);

if (classBinding == null) {
// This extra check looks for a possible match where the class binding requires an implicit this
// reference. This is a temporary solution to allow the class binding access to data from the
// base script class without need for a user to add additional arguments. A long term solution
// will likely involve adding a class instance binding where any instance can have a class binding
// as part of its API. However, the situation at run-time is difficult and will modifications that
// are a substantial change if even possible to do.
classBinding = scriptScope.getPainlessLookup().lookupPainlessClassBinding(methodName, userArgumentsSize + 1);

if (classBinding != null) {
if (classBinding.typeParameters.isEmpty() == false &&
classBinding.typeParameters.get(0) == scriptScope.getScriptClassInfo().getBaseClass()) {
classBindingOffset = 1;
} else {
classBinding = null;
}
// check to see if this class binding requires an implicit this reference
if (classBinding != null && classBinding.typeParameters.isEmpty() == false &&
classBinding.typeParameters.get(0) == scriptScope.getScriptClassInfo().getBaseClass()) {
classBinding = null;
}

if (classBinding == null) {
instanceBinding = scriptScope.getPainlessLookup().lookupPainlessInstanceBinding(methodName, userArgumentsSize);
// This extra check looks for a possible match where the class binding requires an implicit this
// reference. This is a temporary solution to allow the class binding access to data from the
// base script class without need for a user to add additional arguments. A long term solution
// will likely involve adding a class instance binding where any instance can have a class binding
// as part of its API. However, the situation at run-time is difficult and will modifications that
// are a substantial change if even possible to do.
classBinding = scriptScope.getPainlessLookup().lookupPainlessClassBinding(methodName, userArgumentsSize + 1);

if (classBinding != null) {
if (classBinding.typeParameters.isEmpty() == false &&
classBinding.typeParameters.get(0) == scriptScope.getScriptClassInfo().getBaseClass()) {
classBindingOffset = 1;
} else {
classBinding = null;
}
}

if (classBinding == null) {
instanceBinding = scriptScope.getPainlessLookup().lookupPainlessInstanceBinding(methodName, userArgumentsSize);

if (instanceBinding == null) {
throw userCallLocalNode.createError(new IllegalArgumentException(
"Unknown call [" + methodName + "] with [" + userArgumentNodes + "] arguments."));
if (instanceBinding == null) {
throw userCallLocalNode.createError(new IllegalArgumentException(
"Unknown call [" + methodName + "] with [" + userArgumentNodes + "] arguments."));
}
}
}
}
Expand All @@ -1775,10 +1780,18 @@ public void visitCallLocal(ECallLocal userCallLocalNode, SemanticScope semanticS
List<Class<?>> typeParameters;

if (localFunction != null) {
semanticScope.setUsesInstanceMethod();
semanticScope.putDecoration(userCallLocalNode, new StandardLocalFunction(localFunction));

typeParameters = new ArrayList<>(localFunction.getTypeParameters());
valueType = localFunction.getReturnType();
} else if (thisMethod != null) {
semanticScope.setUsesInstanceMethod();
semanticScope.putDecoration(userCallLocalNode, new ThisPainlessMethod(thisMethod));

scriptScope.markNonDeterministic(thisMethod.annotations.containsKey(NonDeterministicAnnotation.class));
typeParameters = new ArrayList<>(thisMethod.typeParameters);
valueType = thisMethod.returnType;
} else if (importedMethod != null) {
semanticScope.putDecoration(userCallLocalNode, new StandardPainlessMethod(importedMethod));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@
import org.elasticsearch.painless.symbol.Decorations.StandardPainlessMethod;
import org.elasticsearch.painless.symbol.Decorations.StaticType;
import org.elasticsearch.painless.symbol.Decorations.TargetType;
import org.elasticsearch.painless.symbol.Decorations.ThisPainlessMethod;
import org.elasticsearch.painless.symbol.Decorations.TypeParameters;
import org.elasticsearch.painless.symbol.Decorations.UnaryType;
import org.elasticsearch.painless.symbol.Decorations.UpcastPainlessCast;
Expand Down Expand Up @@ -239,6 +240,7 @@
import org.elasticsearch.painless.symbol.IRDecorations.IRDSize;
import org.elasticsearch.painless.symbol.IRDecorations.IRDStoreType;
import org.elasticsearch.painless.symbol.IRDecorations.IRDSymbol;
import org.elasticsearch.painless.symbol.IRDecorations.IRDThisMethod;
import org.elasticsearch.painless.symbol.IRDecorations.IRDTypeParameters;
import org.elasticsearch.painless.symbol.IRDecorations.IRDUnaryType;
import org.elasticsearch.painless.symbol.IRDecorations.IRDValue;
Expand Down Expand Up @@ -1221,6 +1223,10 @@ public void visitCallLocal(ECallLocal callLocalNode, ScriptScope scriptScope) {
if (scriptScope.hasDecoration(callLocalNode, StandardLocalFunction.class)) {
LocalFunction localFunction = scriptScope.getDecoration(callLocalNode, StandardLocalFunction.class).getLocalFunction();
irInvokeCallMemberNode.attachDecoration(new IRDFunction(localFunction));
} else if (scriptScope.hasDecoration(callLocalNode, ThisPainlessMethod.class)) {
PainlessMethod thisMethod =
scriptScope.getDecoration(callLocalNode, ThisPainlessMethod.class).getThisPainlessMethod();
irInvokeCallMemberNode.attachDecoration(new IRDThisMethod(thisMethod));
} else if (scriptScope.hasDecoration(callLocalNode, StandardPainlessMethod.class)) {
PainlessMethod importedMethod =
scriptScope.getDecoration(callLocalNode, StandardPainlessMethod.class).getStandardPainlessMethod();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,19 @@ public LocalFunction getLocalFunction() {
}
}

public static class ThisPainlessMethod implements Decoration {

private final PainlessMethod thisPainlessMethod;

public ThisPainlessMethod(PainlessMethod thisPainlessMethod) {
this.thisPainlessMethod = Objects.requireNonNull(thisPainlessMethod);
}

public PainlessMethod getThisPainlessMethod() {
return thisPainlessMethod;
}
}

public static class StandardPainlessClassBinding implements Decoration {

private final PainlessClassBinding painlessClassBinding;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,19 @@ public IRDFunction(LocalFunction value) {
}
}

/** describes a method for a node on the script class; which method depends on node type */
public static class IRDThisMethod extends IRDecoration<PainlessMethod> {

public IRDThisMethod(PainlessMethod value) {
super(value);
}

@Override
public String toString() {
return PainlessLookupUtility.buildPainlessMethodKey(getValue().javaMethod.getName(), getValue().typeParameters.size());
}
}

/** describes the call to a class binding */
public static class IRDClassBinding extends IRDecoration<PainlessClassBinding> {

Expand Down
Loading

0 comments on commit 9f40d30

Please sign in to comment.