RE: Ignite node is down

2022-08-24 Thread Ilya Korol

Hi,

According to logs you have the following:

[17:02:04,774][INFO][grid-nio-worker-tcp-comm-0-#40%MATCHERWORKER%][TcpCommunicationSpi] 
Accepted incoming communication connection 
[locAddr=/xx.xx.xxx.IP2:47100, rmtAddr=/xx.xx.xxx.IP1:52166]
*[18:54:12,125][SEVERE][exchange-worker-#65%MATCHERWORKER%][G] Blocked 
system-critical thread has been detected. This can lead to cluster-wide 
undefined behaviour [workerName=grid-nio-worker-tcp-comm-0, 
threadName=grid-nio-worker-tcp-comm-0-#40%MATCHERWORKER%, blockedFor=10s]*
[18:54:14,059][WARNING][exchange-worker-#65%MATCHERWORKER%][G] Thread 
[name="grid-nio-worker-tcp-comm-0-#40%MATCHERWORKER%", id=63, 
state=RUNNABLE, blockCnt=0, waitCnt=0]


[18:54:14,062][INFO][tcp-disco-sock-reader-[d6d591bd 
xx.xx.xxx.IP4:48633]-#8%MATCHERWORKER%][TcpDiscoverySpi] Finished 
serving remote node connection [rmtAddr=/xx.xx.xxx.IP4:48633, rmtPort=48633
[18:54:14,067][INFO][tcp-disco-srvr-[:47500]-#3%MATCHERWORKER%][TcpDiscoverySpi] 
TCP discovery accepted incoming connection [rmtAddr=/xx.xx.xxx.IP3, 
rmtPort=39939]
[18:54:14,067][INFO][tcp-disco-srvr-[:47500]-#3%MATCHERWORKER%][TcpDiscoverySpi] 
TCP discovery spawning a new thread for connection 
[rmtAddr=/xx.xx.xxx.IP3, rmtPort=39939]
[18:54:14,068][INFO][tcp-disco-sock-reader-[]-#11%MATCHERWORKER%][TcpDiscoverySpi] 
Started serving remote node connection [rmtAddr=/xx.xx.xxx.IP3:39939, 
rmtPort=39939]
[18:54:14,072][INFO][tcp-disco-sock-reader-[439d63a3 
xx.xx.xxx.IP3:39939]-#11%MATCHERWORKER%][TcpDiscoverySpi] Initialized 
connection with remote server node 
[nodeId=439d63a3-4d24-4e53-9507-581ce7e2347e, rmtAddr=/xx.xx.xxx.IP3:39939]
[18:54:14,075][INFO][tcp-disco-sock-reader-[439d63a3 
xx.xx.xxx.IP3:39939]-#11%MATCHERWORKER%][TcpDiscoverySpi] Finished 
serving remote node connection [rmtAddr=/xx.xx.xxx.IP3:39939, rmtPort=39939
[18:54:14,097][WARNING][exchange-worker-#65%MATCHERWORKER%][] Possible 
failure suppressed accordingly to a configured handler 
[hnd=StopNodeOrHaltFailureHandler [tryStop=false, timeout=0, 
super=AbstractFailureHandler [ignoredFailureTypes=UnmodifiableSet 
[SYSTEM_WORKER_BLOCKED, SYSTEM_CRITICAL_OPERATION_TIMEOUT]]], 
failureCtx=FailureContext [type=SYSTEM_WORKER_BLOCKED, err=class 
o.a.i.IgniteException: GridWorker [name=grid-nio-worker-tcp-comm-0, 
igniteInstanceName=MATCHERWORKER, finished=false, 
heartbeatTs=1660915454055]]]
class org.apache.ignite.IgniteException: GridWorker 
[name=grid-nio-worker-tcp-comm-0, igniteInstanceName=MATCHERWORKER, 
finished=false, heartbeatTs=1660915454055]
    at 
org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance$3.apply(IgnitionEx.java:1810)
    at 
org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance$3.apply(IgnitionEx.java:1805)
    at 
org.apache.ignite.internal.worker.WorkersRegistry.onIdle(WorkersRegistry.java:234)
    at 
org.apache.ignite.internal.util.worker.GridWorker.onIdle(GridWorker.java:297)
    at 
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body0(GridCachePartitionExchangeManager.java:3096)
    at 
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body(GridCachePartitionExchangeManager.java:3063)
    at 
org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:120)

    at java.base/java.lang.Thread.run(Thread.java:829)

It would be great to have a thread-dump for corresponding time, to see 
what kind of work did *grid-nio-worker-tcp-comm-0-#40%MATCHERWORKER%* 
perform. (Actually its better to have logs and thread-dumps for 
corresponding time from whole cluster).
You mentioned that this is one of the worker nodes, what does it mean? 
Do you run some specific tasks there, like IgniteCompute tasks, or 
something like this?


Meanwhile you can also try to update your setup, to modern versions like 
2.13.




On  2022/08/25 05:04:43 BEELA GAYATRI via user wrote:
> TCS Confidential
>
> Dear Team,
>
>
> We have 4 worker nodes in baseline topology .Every time one of the 
nodes is getting down with message " Node is out of topology (probably, 
due to short-time network problems)". Ignite log and configuration is 
attached in the mail.

> Here are few queries
>
> 1. Why every time the one of the node is getting down with that error
>
> 1. If the node is getting down , is there any way the node can be 
started automatically without manual intervention??

> 2.
>
> Thanks & Regards,
> Gayatri Beela
>
>
> TCS Confidential
> =-=-=
> Notice: The information contained in this e-mail
> message and/or attachments to it may contain
> confidential or privileged information. If you are
> not the intended recipient, any dissemination, use,
> review, distribution, printing or copying of the
> information contained in this e-mail message
> and/or attachments to it are strictly prohibited. If
> you have received this communication in error,
> please notify us by reply e-mail or telephone and
> immediately and permanently delete the messag

Re: count cache key number

2022-08-24 Thread Stephen Darlington
There are a number of ways to tackle this. 

If your cache split the key into distinct fields rather that a concatenated 
string, you could SQL-enable your cache and get your count as a simple SELECT 
statement.

Alternatively, there’s an affinity compute task that takes a partition 
(affinityCallAsync 
).
 If you use that and a ScanQuery that fetches records from a specific partition 
(ScanQuery 
),
 you’ll get something like a map-reduce. (You could also use the map-reduce 
API, but an affinity call is probably easier.)

> On 24 Aug 2022, at 11:59, wkhapy...@gmail.com wrote:
> 
> hi
> do I pass cache in distribute compute than use cache scan ,that faster than I 
> use a cache scan in client api.
> 
> ---Original---
> From: "wkhapy...@gmail.com"
> Date: Wed, Aug 24, 2022 17:06 PM
> To: "user";
> Subject: count cache key number
> 
> Hi,
> I have a cache ,it's key like 
>"mobile:14"
>"mobile:140001",
> "address:test1",
> "address:test2",
> "address:test3"。
>I want to count mobile number and address number。
>address number is 3 and mobile number is 2。I see Ignite doc has mapreduce 
> job,but it seem not example iterator cache key。 is there any method to 
> iterator key in mapreduce job。Thank you very much
> 
> wkhapy...@gmail.com



Re: distributed-computing error System.Runtime.Serialization.ISerializable

2022-08-24 Thread Charlin S
Hi,
New error with new changes
System.AggregateException
  HResult=0x80131500
  Message=One or more errors occurred. (Topology projection is empty.)
  Source=System.Private.CoreLib
  StackTrace:
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean
waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at Apache.Ignite.Core.Impl.Common.Future`1.Get()
   at Apache.Ignite.Core.Impl.Compute.Compute.Call[TJobRes](IComputeFunc`1
clo)
   at ConsoleApp2.CacheUtils.ComputeTest_OnIgnite_OnIgnite(String
searchCriteria) in
D:\NGSourceCode\POC\ConsoleApp2\ConsoleApp2\CacheUtils.cs:line 75
   at ConsoleApp2.Program.Main(String[] args) in
D:\NGSourceCode\POC\ConsoleApp2\ConsoleApp2\Program.cs:line 19

Inner Exception 1:
ClusterGroupEmptyException: Topology projection is empty.

Inner Exception 2:
JavaException: class
org.apache.ignite.internal.cluster.ClusterGroupEmptyCheckedException:
Topology projection is empty.
at
org.apache.ignite.internal.processors.task.GridTaskWorker.getTaskTopology(GridTaskWorker.java:689)
at
org.apache.ignite.internal.processors.task.GridTaskWorker.body(GridTaskWorker.java:502)
at
org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:120)
at
org.apache.ignite.internal.processors.task.GridTaskProcessor.startTask(GridTaskProcessor.java:843)
at
org.apache.ignite.internal.processors.task.GridTaskProcessor.execute(GridTaskProcessor.java:508)
at
org.apache.ignite.internal.processors.task.GridTaskProcessor.execute(GridTaskProcessor.java:476)
at
org.apache.ignite.internal.IgniteComputeImpl.executeAsync0(IgniteComputeImpl.java:564)
at
org.apache.ignite.internal.processors.platform.compute.PlatformCompute.executeNative0(PlatformCompute.java:329)
at
org.apache.ignite.internal.processors.platform.compute.PlatformCompute.processClosures(PlatformCompute.java:294)
at
org.apache.ignite.internal.processors.platform.compute.PlatformCompute.processInStreamOutObject(PlatformCompute.java:137)
at
org.apache.ignite.internal.processors.platform.PlatformTargetProxyImpl.inStreamOutObject(PlatformTargetProxyImpl.java:79)

Regards,
Charlin



On Wed, 24 Aug 2022 at 17:16, Pavel Tupitsyn  wrote:

> > Sorry to bother you,does scan in distribute compute faster than use a
> scan in client?
>
> Depends on the use case. Always measure your own scenario.
>
> On Wed, Aug 24, 2022 at 2:34 PM wkhapy...@gmail.com 
> wrote:
>
>> Sorry to bother you,does scan in distribute compute faster than use a
>> scan in client?
>>
>> ---Original---
>> *From:* "Pavel Tupitsyn"
>> *Date:* Wed, Aug 24, 2022 19:14 PM
>> *To:* "user";
>> *Subject:* Re: distributed-computing error
>> System.Runtime.Serialization.ISerializable
>>
>> This line is the problem:
>> public ICache IgniteCache { get; set; }
>>
>> You can't serialize an Ignite cache. Instead, use [InstanceResource] -
>> uncomment the line you already have, then get the cache by name:
>>
>> [InstanceResource] private readonly IIgnite _ignite;
>> public string CacheName { get; set; }
>>
>> ...
>>
>> var cache = _ignite.GetCache(CacheName);
>> cache.Query(...)
>>
>> On Wed, Aug 24, 2022 at 1:31 PM Charlin S  wrote:
>>
>>> Hi,
>>> The exception details are as follows.
>>> System.AggregateException
>>>   HResult=0x80131500
>>>   Message=One or more errors occurred. (Serializing delegates is not
>>> supported on this platform.)
>>>   Source=System.Private.CoreLib
>>>   StackTrace:
>>>at System.Threading.Tasks.Task`1.GetResultCore(Boolean
>>> waitCompletionNotification)
>>>at System.Threading.Tasks.Task`1.get_Result()
>>>at Apache.Ignite.Core.Impl.Common.Future`1.Get()
>>>at
>>> Apache.Ignite.Core.Impl.Compute.Compute.Apply[TArg,TJobRes](IComputeFunc`2
>>> clo, TArg arg)
>>>at ConsoleApp2.CacheUtils.ComputeTest_OnIgnite(String searchCriteria)
>>> in D:\NGSourceCode\POC\ConsoleApp2\ConsoleApp2\CacheUtils.cs:line 76
>>>at ConsoleApp2.Program.Main(String[] args) in
>>> D:\NGSourceCode\POC\ConsoleApp2\ConsoleApp2\Program.cs:line 19
>>>
>>>   This exception was originally thrown at this call stack:
>>>
>>> System.MulticastDelegate.GetObjectData(System.Runtime.Serialization.SerializationInfo,
>>> System.Runtime.Serialization.StreamingContext)
>>>
>>> Apache.Ignite.Core.Impl.Binary.SerializableSerializer.WriteBinary(T,
>>> Apache.Ignite.Core.Impl.Binary.BinaryWriter)
>>> Apache.Ignite.Core.Impl.Binary.BinaryWriter.Write(T)
>>> Apache.Ignite.Core.Impl.Binary.BinaryWriter.WriteObject(string, T)
>>>
>>> Apache.Ignite.Core.Impl.Binary.BinaryReflectiveSerializerInternal.Apache.Ignite.Core.Impl.Binary.IBinarySerializerInternal.WriteBinary(T,
>>> Apache.Ignite.Core.Impl.Binary.BinaryWriter)
>>> Apache.Ignite.Core.Impl.Binary.BinaryWriter.Write(T)
>>> Apache.Ignite.Core.Impl.Binary.BinaryWriter.WriteObject(string, T)
>>>
>>> Apache.Ignite.Core.Impl.Binary.BinaryReflectiveSerializerInternal.Apache.Ignite.Core.Impl.Binary.IBinarySerializerInternal.WriteBinary(T,
>>> Apache.Ignite.Core.Impl.Binary.BinaryWriter)
>>> Apache.Ignite.

Re: distributed-computing error System.Runtime.Serialization.ISerializable

2022-08-24 Thread Pavel Tupitsyn
> Sorry to bother you,does scan in distribute compute faster than use a
scan in client?

Depends on the use case. Always measure your own scenario.

On Wed, Aug 24, 2022 at 2:34 PM wkhapy...@gmail.com 
wrote:

> Sorry to bother you,does scan in distribute compute faster than use a scan
> in client?
>
> ---Original---
> *From:* "Pavel Tupitsyn"
> *Date:* Wed, Aug 24, 2022 19:14 PM
> *To:* "user";
> *Subject:* Re: distributed-computing error
> System.Runtime.Serialization.ISerializable
>
> This line is the problem:
> public ICache IgniteCache { get; set; }
>
> You can't serialize an Ignite cache. Instead, use [InstanceResource] -
> uncomment the line you already have, then get the cache by name:
>
> [InstanceResource] private readonly IIgnite _ignite;
> public string CacheName { get; set; }
>
> ...
>
> var cache = _ignite.GetCache(CacheName);
> cache.Query(...)
>
> On Wed, Aug 24, 2022 at 1:31 PM Charlin S  wrote:
>
>> Hi,
>> The exception details are as follows.
>> System.AggregateException
>>   HResult=0x80131500
>>   Message=One or more errors occurred. (Serializing delegates is not
>> supported on this platform.)
>>   Source=System.Private.CoreLib
>>   StackTrace:
>>at System.Threading.Tasks.Task`1.GetResultCore(Boolean
>> waitCompletionNotification)
>>at System.Threading.Tasks.Task`1.get_Result()
>>at Apache.Ignite.Core.Impl.Common.Future`1.Get()
>>at
>> Apache.Ignite.Core.Impl.Compute.Compute.Apply[TArg,TJobRes](IComputeFunc`2
>> clo, TArg arg)
>>at ConsoleApp2.CacheUtils.ComputeTest_OnIgnite(String searchCriteria)
>> in D:\NGSourceCode\POC\ConsoleApp2\ConsoleApp2\CacheUtils.cs:line 76
>>at ConsoleApp2.Program.Main(String[] args) in
>> D:\NGSourceCode\POC\ConsoleApp2\ConsoleApp2\Program.cs:line 19
>>
>>   This exception was originally thrown at this call stack:
>>
>> System.MulticastDelegate.GetObjectData(System.Runtime.Serialization.SerializationInfo,
>> System.Runtime.Serialization.StreamingContext)
>>
>> Apache.Ignite.Core.Impl.Binary.SerializableSerializer.WriteBinary(T,
>> Apache.Ignite.Core.Impl.Binary.BinaryWriter)
>> Apache.Ignite.Core.Impl.Binary.BinaryWriter.Write(T)
>> Apache.Ignite.Core.Impl.Binary.BinaryWriter.WriteObject(string, T)
>>
>> Apache.Ignite.Core.Impl.Binary.BinaryReflectiveSerializerInternal.Apache.Ignite.Core.Impl.Binary.IBinarySerializerInternal.WriteBinary(T,
>> Apache.Ignite.Core.Impl.Binary.BinaryWriter)
>> Apache.Ignite.Core.Impl.Binary.BinaryWriter.Write(T)
>> Apache.Ignite.Core.Impl.Binary.BinaryWriter.WriteObject(string, T)
>>
>> Apache.Ignite.Core.Impl.Binary.BinaryReflectiveSerializerInternal.Apache.Ignite.Core.Impl.Binary.IBinarySerializerInternal.WriteBinary(T,
>> Apache.Ignite.Core.Impl.Binary.BinaryWriter)
>> Apache.Ignite.Core.Impl.Binary.BinaryWriter.Write(T)
>> Apache.Ignite.Core.Impl.Binary.BinaryWriter.WriteObject(string, T)
>> ...
>> [Call Stack Truncated]
>>
>> Inner Exception 1:
>> SerializationException: Serializing delegates is not supported on this
>> platform.
>>
>> Note: I am having two 2 server nodes and running the POC application on a
>> client node.
>>
>> Regards,
>> Charlin
>>
>>
>>
>> On Wed, 24 Aug 2022 at 15:02, Pavel Tupitsyn 
>> wrote:
>>
>>> 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 
>>> 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 c

Re: distributed-computing error System.Runtime.Serialization.ISerializable

2022-08-24 Thread wkhapy123


Re: distributed-computing error System.Runtime.Serialization.ISerializable

2022-08-24 Thread Pavel Tupitsyn
This line is the problem:
public ICache IgniteCache { get; set; }

You can't serialize an Ignite cache. Instead, use [InstanceResource] -
uncomment the line you already have, then get the cache by name:

[InstanceResource] private readonly IIgnite _ignite;
public string CacheName { get; set; }

...

var cache = _ignite.GetCache(CacheName);
cache.Query(...)

On Wed, Aug 24, 2022 at 1:31 PM Charlin S  wrote:

> Hi,
> The exception details are as follows.
> System.AggregateException
>   HResult=0x80131500
>   Message=One or more errors occurred. (Serializing delegates is not
> supported on this platform.)
>   Source=System.Private.CoreLib
>   StackTrace:
>at System.Threading.Tasks.Task`1.GetResultCore(Boolean
> waitCompletionNotification)
>at System.Threading.Tasks.Task`1.get_Result()
>at Apache.Ignite.Core.Impl.Common.Future`1.Get()
>at
> Apache.Ignite.Core.Impl.Compute.Compute.Apply[TArg,TJobRes](IComputeFunc`2
> clo, TArg arg)
>at ConsoleApp2.CacheUtils.ComputeTest_OnIgnite(String searchCriteria)
> in D:\NGSourceCode\POC\ConsoleApp2\ConsoleApp2\CacheUtils.cs:line 76
>at ConsoleApp2.Program.Main(String[] args) in
> D:\NGSourceCode\POC\ConsoleApp2\ConsoleApp2\Program.cs:line 19
>
>   This exception was originally thrown at this call stack:
>
> System.MulticastDelegate.GetObjectData(System.Runtime.Serialization.SerializationInfo,
> System.Runtime.Serialization.StreamingContext)
>
> Apache.Ignite.Core.Impl.Binary.SerializableSerializer.WriteBinary(T,
> Apache.Ignite.Core.Impl.Binary.BinaryWriter)
> Apache.Ignite.Core.Impl.Binary.BinaryWriter.Write(T)
> Apache.Ignite.Core.Impl.Binary.BinaryWriter.WriteObject(string, T)
>
> Apache.Ignite.Core.Impl.Binary.BinaryReflectiveSerializerInternal.Apache.Ignite.Core.Impl.Binary.IBinarySerializerInternal.WriteBinary(T,
> Apache.Ignite.Core.Impl.Binary.BinaryWriter)
> Apache.Ignite.Core.Impl.Binary.BinaryWriter.Write(T)
> Apache.Ignite.Core.Impl.Binary.BinaryWriter.WriteObject(string, T)
>
> Apache.Ignite.Core.Impl.Binary.BinaryReflectiveSerializerInternal.Apache.Ignite.Core.Impl.Binary.IBinarySerializerInternal.WriteBinary(T,
> Apache.Ignite.Core.Impl.Binary.BinaryWriter)
> Apache.Ignite.Core.Impl.Binary.BinaryWriter.Write(T)
> Apache.Ignite.Core.Impl.Binary.BinaryWriter.WriteObject(string, T)
> ...
> [Call Stack Truncated]
>
> Inner Exception 1:
> SerializationException: Serializing delegates is not supported on this
> platform.
>
> Note: I am having two 2 server nodes and running the POC application on a
> client node.
>
> Regards,
> Charlin
>
>
>
> On Wed, 24 Aug 2022 at 15:02, Pavel Tupitsyn  wrote:
>
>> 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 
>> 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 : IComputeFunc>
>>> {
>>> // [InstanceResource] private readonly I

Re: count cache key number

2022-08-24 Thread wkhapy123


Re: distributed-computing error System.Runtime.Serialization.ISerializable

2022-08-24 Thread Charlin S
Hi,
The exception details are as follows.
System.AggregateException
  HResult=0x80131500
  Message=One or more errors occurred. (Serializing delegates is not
supported on this platform.)
  Source=System.Private.CoreLib
  StackTrace:
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean
waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at Apache.Ignite.Core.Impl.Common.Future`1.Get()
   at
Apache.Ignite.Core.Impl.Compute.Compute.Apply[TArg,TJobRes](IComputeFunc`2
clo, TArg arg)
   at ConsoleApp2.CacheUtils.ComputeTest_OnIgnite(String searchCriteria) in
D:\NGSourceCode\POC\ConsoleApp2\ConsoleApp2\CacheUtils.cs:line 76
   at ConsoleApp2.Program.Main(String[] args) in
D:\NGSourceCode\POC\ConsoleApp2\ConsoleApp2\Program.cs:line 19

  This exception was originally thrown at this call stack:

System.MulticastDelegate.GetObjectData(System.Runtime.Serialization.SerializationInfo,
System.Runtime.Serialization.StreamingContext)
Apache.Ignite.Core.Impl.Binary.SerializableSerializer.WriteBinary(T,
Apache.Ignite.Core.Impl.Binary.BinaryWriter)
Apache.Ignite.Core.Impl.Binary.BinaryWriter.Write(T)
Apache.Ignite.Core.Impl.Binary.BinaryWriter.WriteObject(string, T)

Apache.Ignite.Core.Impl.Binary.BinaryReflectiveSerializerInternal.Apache.Ignite.Core.Impl.Binary.IBinarySerializerInternal.WriteBinary(T,
Apache.Ignite.Core.Impl.Binary.BinaryWriter)
Apache.Ignite.Core.Impl.Binary.BinaryWriter.Write(T)
Apache.Ignite.Core.Impl.Binary.BinaryWriter.WriteObject(string, T)

Apache.Ignite.Core.Impl.Binary.BinaryReflectiveSerializerInternal.Apache.Ignite.Core.Impl.Binary.IBinarySerializerInternal.WriteBinary(T,
Apache.Ignite.Core.Impl.Binary.BinaryWriter)
Apache.Ignite.Core.Impl.Binary.BinaryWriter.Write(T)
Apache.Ignite.Core.Impl.Binary.BinaryWriter.WriteObject(string, T)
...
[Call Stack Truncated]

Inner Exception 1:
SerializationException: Serializing delegates is not supported on this
platform.

Note: I am having two 2 server nodes and running the POC application on a
client node.

Regards,
Charlin



On Wed, 24 Aug 2022 at 15:02, Pavel Tupitsyn  wrote:

> 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  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 : IComputeFunc>
>> {
>> // [InstanceResource] private readonly IIgnite _ignite;
>> public ICache IgniteCache { get; set; }
>>
>> public string _searchCriteria { get; set; }
>> public TestModelComputeFunc(ICache igniteCache, string
>> searchCriteria)
>> {
>> IgniteCache = igniteCache;
>> _searchCriteria = searchCriteria;
>> }
>> public List Invoke()
>> {
>> List objs = new List();
>> string query = "select * from ComputeTestModel where
>>  TestField1 = ?";
>> SqlFieldsQuery fieldsQuery =  new SqlFieldsQuery(query

Re: distributed-computing error System.Runtime.Serialization.ISerializable

2022-08-24 Thread Pavel Tupitsyn
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  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 : IComputeFunc>
> {
> // [InstanceResource] private readonly IIgnite _ignite;
> public ICache IgniteCache { get; set; }
>
> public string _searchCriteria { get; set; }
> public TestModelComputeFunc(ICache igniteCache, string
> searchCriteria)
> {
> IgniteCache = igniteCache;
> _searchCriteria = searchCriteria;
> }
> public List Invoke()
> {
> List objs = new List();
> 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 ComputeTest_OnIgnite(string
> searchCriteria)
> {
> //CacheInstance.Instance.ComputeTestICache defined in another class public
> ICache ComputeTestModelICache { get; set; }
>
> ComputeTestComputeFunc calls = new
> ComputeTestComputeFunc(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 cacheObject = new
> ComputeTestComputeFunc(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
>
>
>


count cache key number

2022-08-24 Thread wkhapy...@gmail.com
Hi,
I have a cache ,it's key like 
   "mobile:14"
   "mobile:140001",
"address:test1",
"address:test2",
"address:test3"。
   I want to count mobile number and address number。
   address number is 3 and mobile number is 2。I see Ignite doc has mapreduce 
job,but it seem not example iterator cache key。 is there any method to iterator 
key in mapreduce job。Thank you very much



wkhapy...@gmail.com


distributed-computing error System.Runtime.Serialization.ISerializable

2022-08-24 Thread Charlin S
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 : IComputeFunc>
{
// [InstanceResource] private readonly IIgnite _ignite;
public ICache IgniteCache { get; set; }

public string _searchCriteria { get; set; }
public TestModelComputeFunc(ICache igniteCache, string
searchCriteria)
{
IgniteCache = igniteCache;
_searchCriteria = searchCriteria;
}
public List Invoke()
{
List objs = new List();
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 ComputeTest_OnIgnite(string
searchCriteria)
{
//CacheInstance.Instance.ComputeTestICache defined in another class public
ICache ComputeTestModelICache { get; set; }

ComputeTestComputeFunc calls = new
ComputeTestComputeFunc(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 cacheObject = new
ComputeTestComputeFunc(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