Skip to content

[Backport 8.5] Query and Container API enhancements + bug fixes #6678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci/DockerFile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG DOTNET_VERSION=6.0.300
ARG DOTNET_VERSION=6.0.401
FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION} AS elasticsearch-net-build

ARG USER_ID
Expand Down
2 changes: 1 addition & 1 deletion .ci/make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ OUTPUT_DIR="$repo/${output_folder}"
REPO_BINDING="${OUTPUT_DIR}:/sln/${output_folder}"
mkdir -p "$OUTPUT_DIR"

DOTNET_VERSION=${DOTNET_VERSION-6.0.300}
DOTNET_VERSION=${DOTNET_VERSION-6.0.401}

echo -e "\033[34;1mINFO:\033[0m PRODUCT ${product}\033[0m"
echo -e "\033[34;1mINFO:\033[0m VERSION ${STACK_VERSION}\033[0m"
Expand Down
2 changes: 1 addition & 1 deletion .ci/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ $ STACK_VERSION=8.0.0-SNAPSHOT ./.ci/run-tests
|-------------------------|-------------|-------------|
| `STACK_VERSION` | `N/A` | The elasticsearch version to target
| `TEST_SUITE` | `basic` | `free` or `platinum` sets which test suite to run and which container to run against. |
| `DOTNET_VERSION` | `6.0.300` | The .NET sdk version used to grab the proper container |
| `DOTNET_VERSION` | `6.0.401` | The .NET sdk version used to grab the proper container |

If you want to manually spin up elasticsearch for these tests and call the runner afterwards you can use

Expand Down
2 changes: 1 addition & 1 deletion .ci/run-repository.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ param(
$NODE_NAME,

[string]
$DOTNET_VERSION = "6.0.300"
$DOTNET_VERSION = "6.0.401"
)

$ESC = [char]27
Expand Down
2 changes: 1 addition & 1 deletion .ci/run-repository.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ script_path=$(dirname $(realpath -s $0))
source $script_path/functions/imports.sh
set -euo pipefail

DOTNET_VERSION=${DOTNET_VERSION-6.0.300}
DOTNET_VERSION=${DOTNET_VERSION-6.0.401}
ELASTICSEARCH_URL=${ELASTICSEARCH_URL-"$elasticsearch_url"}
elasticsearch_container=${elasticsearch_container-}

Expand Down
2 changes: 1 addition & 1 deletion .ci/run-tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ param (
$TEST_SUITE = "free",

[string]
$DOTNET_VERSION = "6.0.300"
$DOTNET_VERSION = "6.0.401"
)

$ESC = [char]27
Expand Down
2 changes: 1 addition & 1 deletion .ci/test-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ TEST_SUITE:
- platinum

DOTNET_VERSION:
- 6.0.300
- 6.0.401

exclude: ~
7 changes: 4 additions & 3 deletions .github/workflows/integration-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ jobs:
stack_version: [
'8.1.3',
'8.2.3',
'8.3.2',
'8.4.0-SNAPSHOT',
'8.3.3',
'8.4.2',
'8.5.0-SNAPSHOT',
'latest-8'
]

Expand All @@ -34,7 +35,7 @@ jobs:
uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.300'
dotnet-version: '6.0.401'
- uses: actions/cache@v2
with:
path: ~/.nuget/packages
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/make-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
# Add version and backport labels automatically
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.300'
dotnet-version: '6.0.401'
- name: Install dotnet-script
run: dotnet tool install release-notes --tool-path dotnet-tool

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/make-release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:

- uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.300'
dotnet-version: '6.0.401'
- name: Install dotnet-script
run: dotnet tool install release-notes --tool-path dotnet-tool

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.300'
dotnet-version: '6.0.401'
- uses: actions/cache@v2
with:
path: ~/.nuget/packages
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.300'
dotnet-version: '6.0.401'
- uses: actions/cache@v2
with:
path: ~/.nuget/packages
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.300'
dotnet-version: '6.0.401'
- uses: actions/cache@v2
with:
path: ~/.nuget/packages
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unified-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.300'
dotnet-version: '6.0.401'

- run: "./.ci/make.sh assemble ${{ matrix.stack_version }}"
name: Assemble ${{ matrix.stack_version }}
4 changes: 3 additions & 1 deletion benchmarks/Benchmarks/Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>$(SolutionRoot)\build\keys\keypair.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Elastic.Clients.Elasticsearch\Elastic.Clients.Elasticsearch.csproj" />
<ProjectReference Include="$(SolutionRoot)\src\Elastic.Clients.Elasticsearch\Elastic.Clients.Elasticsearch.csproj" />
<PackageReference Include="NEST" Version="7.16.0" />
</ItemGroup>

Expand Down
136 changes: 136 additions & 0 deletions benchmarks/Benchmarks/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,155 @@
using BenchmarkDotNet.Reports;
using BenchmarkDotNet.Running;
using Elastic.Clients.Elasticsearch;
using Elastic.Clients.Elasticsearch.Enrich;
using Elastic.Clients.Elasticsearch.QueryDsl;
using Elastic.Transport;
using Nest;
using System.Globalization;
using System.Text;
using Policy = Elastic.Clients.Elasticsearch.Enrich.Policy;

var config = ManualConfig.Create(DefaultConfig.Instance);
config.SummaryStyle = new SummaryStyle(CultureInfo.CurrentCulture, true, BenchmarkDotNet.Columns.SizeUnit.B, null);
config.AddDiagnoser(MemoryDiagnoser.Default);

BenchmarkRunner.Run<Benchmarks.BulkIngest>(config);

//var thing = new Benchmarks.DescriptorValues();
//thing.Setup();

//var a = new EnrichPutPolicyRequestDescriptorV2<Benchmarks.SampleData>("test");

//a.Match(new Policy { Name = "test-name" });

//var settings = new ElasticsearchClientSettings();
//var serializer = new DefaultRequestResponseSerializer(settings);
//var stream = new MemoryStream();

//serializer.Serialize(a, stream);

//stream.Position = 0;
//var sr = new StreamReader(stream);
//var result = sr.ReadToEnd();

//Console.ReadKey();

namespace Benchmarks
{
//public class DescriptorValues
//{
// private EnrichPutPolicyRequestDescriptor<SampleData>? _data1;
// private EnrichPutPolicyRequestDescriptorV2<SampleData>? _data2;
// private EnrichPutPolicyRequestDescriptorV3<SampleData>? _data3;
// private EnrichPutPolicyRequestDescriptorV4<SampleData>? _data4;

// //private Existing<SampleData>? _basicData1;
// //private NewV1<SampleData>? _basicData2;
// //private NewV2<SampleData>? _basicData3;

// private readonly EnrichPutPolicyRequestDescriptor<SampleData> _existing = new("test");
// private readonly EnrichPutPolicyRequestDescriptorV2<SampleData> _newV1 = new("test");
// private readonly EnrichPutPolicyRequestDescriptorV3<SampleData> _newV2 = new("test");
// private readonly EnrichPutPolicyRequestDescriptorV4<SampleData> _newV3 = new("test");
// private readonly Policy? _policy = new() { Name = "TEST" };

// private readonly EnrichPutPolicyRequestDescriptor<SampleData> _serializableExisting = new("test");
// private readonly EnrichPutPolicyRequestDescriptorV2<SampleData> _serializableNewV1 = new("test");
// private readonly EnrichPutPolicyRequestDescriptorV3<SampleData> _serializableNewV2 = new("test");
// private readonly EnrichPutPolicyRequestDescriptorV4<SampleData> _serializableNewV3 = new("test");

// private static readonly ElasticsearchClientSettings Settings = new();

// private readonly DefaultRequestResponseSerializer _serializer = new(Settings);
// private readonly MemoryStream _stream = new();

// [GlobalSetup]
// public void Setup()
// {
// _serializableExisting.GeoMatch(_policy);
// _serializableNewV1.GeoMatch(_policy);
// _serializableNewV2.GeoMatch(_policy);
// _serializableNewV3.GeoMatch(_policy);
// }

// [Benchmark]
// public void Existing() => _data1 = new EnrichPutPolicyRequestDescriptor<SampleData>("name");

// [Benchmark]
// public void NewV1() => _data2 = new EnrichPutPolicyRequestDescriptorV2<SampleData>("name");

// [Benchmark]
// public void NewV2() => _data3 = new EnrichPutPolicyRequestDescriptorV3<SampleData>("name");

// [Benchmark]
// public void NewV3() => _data4 = new EnrichPutPolicyRequestDescriptorV4<SampleData>("name");

// //[Benchmark]
// //public void Existing() => _basicData1 = new Existing<SampleData>();

// //[Benchmark]
// //public void NewV1() => _basicData2 = new NewV1<SampleData>();

// //[Benchmark]
// //public void NewV2() => _basicData3 = new NewV2<SampleData>();

// [Benchmark]
// public void SetExisting() => _existing.GeoMatch(_policy);

// [Benchmark]
// public void SetNewV1() => _newV1.GeoMatch(_policy);

// [Benchmark]
// public void SetNewV2() => _newV2.GeoMatch(_policy);

// [Benchmark]
// public void SetNewV3() => _newV3.GeoMatch(_policy);

// [Benchmark]
// public void SerialiseExisting()
// {
// _stream.Position = 0;
// _serializer.Serialize(_serializableExisting, _stream);
// }

// [Benchmark]
// public void SerialiseNewV1()
// {
// _stream.Position = 0;
// _serializer.Serialize(_serializableNewV1, _stream);
// }

// [Benchmark]
// public void SerialiseNewV2()
// {
// _stream.Position = 0;
// _serializer.Serialize(_serializableNewV2, _stream);
// }

// [Benchmark]
// public void SerialiseNewV3()
// {
// _stream.Position = 0;
// _serializer.Serialize(_serializableNewV3, _stream);
// }
//}

// RESULT OF ABOVE:
//| Method | Mean [ns] | Error [ns] | StdDev [ns] | Gen 0 | Gen 1 | Allocated [B] |
//|------------------ |-----------:|-----------:|------------:|-------:|-------:|--------------:|
//| Existing | 116.408 ns | 2.1955 ns | 2.1563 ns | 0.0942 | 0.0002 | 592 B |
//| NewV1 | 113.021 ns | 1.8475 ns | 1.8145 ns | 0.0943 | 0.0004 | 592 B |
//| NewV2 | 115.728 ns | 2.2291 ns | 2.0851 ns | 0.0905 | 0.0002 | 568 B |
//| NewV3 | 112.813 ns | 2.2198 ns | 3.1118 ns | 0.0867 | 0.0002 | 544 B |
//| SetExisting | 1.688 ns | 0.0384 ns | 0.0340 ns | - | - | - |
//| SetNewV1 | 2.200 ns | 0.0232 ns | 0.0217 ns | - | - | - |
//| SetNewV2 | 2.555 ns | 0.0289 ns | 0.0256 ns | - | - | - |
//| SetNewV3 | 1.691 ns | 0.0306 ns | 0.0286 ns | - | - | - |
//| SerialiseExisting | 461.120 ns | 9.0066 ns | 8.4248 ns | 0.0687 | - | 432 B |
//| SerialiseNewV1 | 472.239 ns | 8.4655 ns | 7.9186 ns | 0.0687 | - | 432 B |
//| SerialiseNewV2 | 476.059 ns | 9.2350 ns | 10.2647 ns | 0.0687 | - | 432 B |
//| SerialiseNewV3 | 483.717 ns | 9.5424 ns | 8.9260 ns | 0.0687 | - | 432 B |

public class BulkIngest
{
//private static readonly List<SampleData> Data = Enumerable.Range(0, 100).Select(r => new SampleData()).ToList();
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/Benchmarks/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@
"elastic.clients.elasticsearch": {
"type": "Project",
"dependencies": {
"Elastic.Transport": "0.3.2"
"Elastic.Transport": "[0.3.2, )"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/Profiling/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"elastic.clients.elasticsearch": {
"type": "Project",
"dependencies": {
"Elastic.Transport": "0.3.2"
"Elastic.Transport": "[0.3.2, )"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.300",
"version": "6.0.401",
"rollForward": "minor",
"allowPrerelease": false
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"elastic.clients.elasticsearch": {
"type": "Project",
"dependencies": {
"Elastic.Transport": "0.3.2"
"Elastic.Transport": "[0.3.2, )"
}
}
},
Expand Down Expand Up @@ -256,7 +256,7 @@
"elastic.clients.elasticsearch": {
"type": "Project",
"dependencies": {
"Elastic.Transport": "0.3.2"
"Elastic.Transport": "[0.3.2, )"
}
}
},
Expand Down Expand Up @@ -516,9 +516,9 @@
"elastic.clients.elasticsearch": {
"type": "Project",
"dependencies": {
"Elastic.Transport": "0.3.2",
"System.Reflection.Emit": "4.3.0",
"System.Reflection.Emit.Lightweight": "4.3.0"
"Elastic.Transport": "[0.3.2, )",
"System.Reflection.Emit": "[4.3.0, )",
"System.Reflection.Emit.Lightweight": "[4.3.0, )"
}
}
},
Expand Down Expand Up @@ -660,7 +660,7 @@
"elastic.clients.elasticsearch": {
"type": "Project",
"dependencies": {
"Elastic.Transport": "0.3.2"
"Elastic.Transport": "[0.3.2, )"
}
}
},
Expand Down Expand Up @@ -762,7 +762,7 @@
"elastic.clients.elasticsearch": {
"type": "Project",
"dependencies": {
"Elastic.Transport": "0.3.2"
"Elastic.Transport": "[0.3.2, )"
}
}
},
Expand Down Expand Up @@ -864,7 +864,7 @@
"elastic.clients.elasticsearch": {
"type": "Project",
"dependencies": {
"Elastic.Transport": "0.3.2"
"Elastic.Transport": "[0.3.2, )"
}
}
}
Expand Down
Loading