无法更改 .NET apache ignite 瘦客户端的 AllowOverwrite 数据流选项

Can't change AllowOverwrite data streamer option for .NET apache ignite thin client

我尝试使用瘦客户端数据流 (.NET apache ignite) 删除一些数据,但最终出现异常:

DataStreamer can't remove data when AllowOverwrite is false.

我的问题是,当我尝试将 AllowOverwrite 更改为 true 时,它​​不受尊重。

using Apache.Ignite.Core;
using Apache.Ignite.Core.Client;

IgniteClientConfiguration _configuration = new()
{
    Endpoints = new[] { "127.0.0.1:10800" }
};

using (var client = Ignition.StartClient(_configuration))
{
    var cache = client.GetOrCreateCache<int, string>("myCache");
    using (var dataStreamer = client.GetDataStreamer<int, string>("myCache"))
    {
        Console.WriteLine($"AllowOverwrite default value: {dataStreamer.Options.AllowOverwrite}");

        // Set AllowOverwrite to true
        dataStreamer.Options.AllowOverwrite = true;
        Console.WriteLine($"AllowOverwrite: {dataStreamer.Options.AllowOverwrite}"); // Set not repected

        dataStreamer.Remove(1);
    }
}

/*
    Results in:
    AllowOverwrite default value: False
    AllowOverwrite: False
    Unhandled exception. Apache.Ignite.Core.Client.IgniteClientException: DataStreamer 
    can't remove data when AllowOverwrite is false.
       at Apache.Ignite.Core.Impl.Client.Datastream.DataStreamerClient`2.Remove(TK key)
*/

备注:

关于我在这里缺少什么的任何建议? 谢谢

您正在修改创建后的数据流,这是不支持的。创建实例后,您只能获取其配置的副本。改为提供完整的初始化配置:

var options = new DataStreamerClientOptions {AllowOverwrite = false};
    
using (var streamer = Client.GetDataStreamer<int, object>(cache.Name, options))
{
    ...
}

I couldn't find any related config to enable this option when starting the server node/s

这不是服务器配置,只是关于数据流。