【问题标题】:Apache Ignite Scan Query is not working in .netApache Ignite 扫描查询在 .net 中不起作用
【发布时间】:2021-10-29 11:02:15
【问题描述】:

我在 Azure Kubernetes 服务上使用 Apache Ignite。 我最近需要从 Ignite 获取注册设备列表。 但是扫描查询不起作用。

这是我的设备对象;

public class Device
{
   [Required]
   public string Id { get; set; }
   public bool IsActive { get; set; }
   public DateTime FirstRegisterDateTime { get; set; }
   public Guid FirstRegisterUserId { get; set; }
}

过滤器类如下;

class RegisterDateFilter : ICacheEntryFilter<string, Device>
{
    public DateTime LastSyncDateTime { get; set; }
    public bool Invoke(ICacheEntry<string, Device> entry)
    {
        return entry.Value.FirstRegisterDateTime >= LastSyncDateTime;
    }
}

最后,当我尝试在我的方法中调用 Scan Query 时,如下所示;

DateTime lastSyncDateTime = engineManager.GetLastSuccededJobTime(JobConstants.DEVICE_JOB);
using (var cursor = cacheManager.DeviceCache.Query(new ScanQuery<string, Device>(new RegisterDateFilter { LastSyncDateTime = lastSyncDateTime })))
{
    foreach (var entry in cursor)
    {
        //logic
    }
}

执行扫描查询时,会出现以下错误。

平台不可用 [nodeId=*****-c534-48ae-a5a8-ceb2fff52c72] (使用 Apache.Ignite.Core.Ignition.Start() 或 Apache.Ignite.exe 启动 点燃.NET 节点; ignite::Ignition::Start() 或 ignite.exe 启动 点燃 C++ 节点)。

我还分享了 apache 官方示例。没发现有什么问题?

【问题讨论】:

    标签: ignite thin-client


    【解决方案1】:

    看起来您的服务器节点是纯 Java 的,以 ignite.sh 开头。请确保所有服务器节点都从 .NET 启动,以便可以评估基于 .NET 的过滤器。

    https://ignite.apache.org/docs/latest/net-specific/net-platform-interoperability#mixed-platform-clusters

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-03-07
      • 1970-01-01
      • 1970-01-01
      • 2017-02-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多