What's new in Apache Ignite.NET 2.11
Apache Ignite 2.11 has been released. On .NET side there are new examples, thin client DataStreamer, .NET 5 support, and more.
Data Streamer in Thin Client
Data streamer API - the most efficient way to load large amounts of data into Ignite - is now available in the .NET thin client.
- Thin streamer automatically buffers the data and groups it into batches and sends it in parallel to multiple nodes.
- If a server node fails, corresponding operations are retried transparently: at-least-once delivery is guaranteed.
IIgniteClient client = GetClient();
using (IDataStreamerClient<int, int> streamer = client.GetDataStreamer<int, int>("my-cache"))
{
streamer.Add(1, 1);
streamer.Add(2, 2);
await streamer.FlushAsync();
}
Performance is comparable to the existing thick API:
| Method | Mean | Error |
|------------------ |---------:|--------:|
| StreamThinClient | 106.5 ms | 3.25 ms |
| StreamThickClient | 109.7 ms | 2.19 ms |
(150000 entries, Core i7-9700K, Ubuntu 20.04, .NET 5.0.5).
Data Streamer API Improvements
Existing data streamer API has been updated.
AddData
andRemoveData
methods return aTask
for the current batch, and this task can’t be awaited, which is confusing. Those methods were marked as obsolete. Instead, voidAdd
andRemove
methods were added together withGetCurrentBatchTask
. Current batch task is not needed in most use cases, soAddData
calls can be simply replaced withAdd
.FlushAsync
has been added for non-blocking flush. Note thatDispose
callsFlush
, so it is recommended to callFlushAsync
manually in async scenarios.long AutoFlushFrequency
is replaced withTimeSpan AutoFlushInterval
.
.NET 5 Support
.NET 5 is now officially supported, including single-file application scenarios.
Here is how to create and pack an Ignite.NET server application into a single executable file, including all the required Ignite files (including jars):
mkdir ignite-single-file-test && cd ignite-single-file-test
dotnet new console
dotnet add package Apache.Ignite
- Add
Apache.Ignite.Core.Ignition.Start();
line to theMain
method dotnet publish --runtime linux-x64 /p:PublishSingleFile=true /p:IncludeAllContentForSelfExtract=true --self-contained true --output pub
(make sure to fixruntime
if you are not on Linux, e.g.win-x64
)
As a result, there is a self-contained ignite-single-file-test
executable file in the pub
directory which can be copied to any machine and executed there. The only requirement is a compatible JDK. This approach simplifies deployments, including modern containerized environments.
See Ignite on .NET 5 post for more info on other .NET 5 features.
Reworked Examples
Examples were reworked from .NET Framework to .NET Core:
- Run on any OS.
- Can be run from command line or any IDE (Visual Studio, VS Code, Rider).
- Can be easily installed from NuGet as a
dotnet new
template.
See README for more details.
Links
- Main blog post: https://blogs.apache.org/ignite/entry/apache-ignite-2-11-stabilization
- Full release notes: https://github.com/apache/ignite/blob/master/RELEASE_NOTES.txt
- Download: https://ignite.apache.org/download