Please share the exception with full stack trace (you've only shared some
warnings, which may or may not be a problem).

On Wed, Aug 24, 2022 at 10:26 AM Charlin S <charli...@hotelhub.com> wrote:

>
> I have a requirement to fetch the data using distributed-computing
> function and  error at
> var res = CacheInstance.Instance.InstanceObject.GetCompute().Call(calls);
>
> //  InstanceObject singleton object for Ignite
>
> [11:16:34,865][WARNING][main][Marshaller] Type
> 'System.Collections.Generic.Dictionary`2[System.Int64,Apache.Ignite.Core.Impl.Binary.BinaryFullTypeDescriptor]'
> implements 'System.Runtime.Serialization.ISerializable'. It will be written
> in Ignite binary format, however, the following limitations apply: DateTime
> fields would not work in SQL; sbyte, ushort, uint, ulong fields would not
> work in DML.
> [11:16:34,889][WARNING][main][Marshaller] Type
> 'System.Collections.Generic.Dictionary`2[System.String,System.Byte]'
> implements 'System.Runtime.Serialization.ISerializable'. It will be written
> in Ignite binary format, however, the following limitations apply: DateTime
> fields would not work in SQL; sbyte, ushort, uint, ulong fields would not
> work in DML.
> [11:16:34,895][WARNING][main][Marshaller] Type
> 'System.Func`2[Apache.Ignite.Core.Impl.Binary.BinaryReader,Apache.Ignite.Core.Impl.Compute.ComputeJobHolder]'
> implements 'System.Runtime.Serialization.ISerializable'. It will be written
> in Ignite binary format, however, the following limitations apply: DateTime
> fields would not work in SQL; sbyte, ushort, uint, ulong fields would not
> work in DML.
>
> Kindly help me on this and I have shared the implementation below.
>
>  public class ComputeTestModel : IBinarizable
>     {
>
>         [QuerySqlField]
>         public string TestField1 { get; set; }
>         [QuerySqlField]
>         public string TestField2 { get; set; }
>         [QuerySqlField]
>         public string TestField3 { get; set; }
>
>
>         public void ReadBinary(IBinaryReader reader){}//not added
> implementation here
>         public void WriteBinary(IBinaryWriter writer){}//not added
> implementation here
>     }
>
>
> class TestModelComputeFunc<T> : IComputeFunc<List<ComputeTestModel>>
>     {
>         // [InstanceResource] private readonly IIgnite _ignite;
>         public ICache<string, T> IgniteCache { get; set; }
>
>         public string _searchCriteria { get; set; }
>         public TestModelComputeFunc(ICache<string, T> igniteCache, string
> searchCriteria)
>         {
>             IgniteCache = igniteCache;
>             _searchCriteria = searchCriteria;
>         }
>         public List<ComputeTestModel> Invoke()
>         {
>             List<ComputeTestModel> objs = new List<ComputeTestModel>();
>             string query = "select * from ComputeTestModel where
>  TestField1 = ?";
>             SqlFieldsQuery fieldsQuery =  new SqlFieldsQuery(query,
> _searchCriteria);
>             IFieldsQueryCursor queryCursor =
> IgniteCache.Query(fieldsQuery);
>             if (queryCursor != null)
>             {
>                 foreach (var cacheEntry in queryCursor)
>                 {
>                     objs.Add(new ComputeTestModel
>                     {
>                         TestField1 = cacheEntry[0] as string,
>                         TestField2 = cacheEntry[1] as string,
> TestField3 = cacheEntry[2] as string
>
>                     });
>                 }
>                 return objs;
>
>             }
>             return null;
>         }
>     }
> }
>
> public static class CacheUtilsTest
>     {
> public static List<ComputeTestModel> ComputeTest_OnIgnite(string
> searchCriteria)
>         {
> //CacheInstance.Instance.ComputeTestICache defined in another class public
> ICache<string, ComputeTestModel> ComputeTestModelICache { get; set; }
>
>             ComputeTestComputeFunc<ComputeTestModel> calls = new
> ComputeTestComputeFunc<ComputeTestModel>(CacheInstance.Instance.ComputeTestICache,
> searchCriteria);
>
>             // Execute the collection of calls on the cluster.
>             var res =
> CacheInstance.Instance.InstanceObject.GetCompute().Call(calls);
>  //exception thrown here
>
>
> /*
> //another aproach
> ComputeTestComputeFunc<ComputeTestModel> cacheObject = new
> ComputeTestComputeFunc<ComputeTestModel>(CacheInstance.Instance.ComputeTestICache,
> searchCriteria);
> // var calls = CacheInstance.Instance.ComputeTestICache.Select(s =>
> cacheObject).ToList();
>
>              // Execute the collection of calls on the cluster.
>             var res =
> CacheInstance.Instance.InstanceObject.GetCompute().Call(calls);
>  //exception thrown here
> */
>             return null;
>         }
>
> }
>
>
> class Program
>     {
>
>         static void Main(string[] args)
>         {
>             // Console.WriteLine("Hello World!");
>             var saticCache = CacheInstance.Instance.InstanceObject;
>
>             var res = CacheUtilsTest.ComputeTest_OnIgnite("A");
>             int ans= res.Count();
>             Console.ReadKey();
>
>         }
>     }
>
> Regards,
> Charlin
>
>
>

Reply via email to