Re: continous query remote filter issue

2018-08-09 Thread Ilya Kasnacheev
Hello!

I have just created sample project with your code (by running two
standalone nodes with peerAssemblyLoadingMode="CurrentAppDomain" as well as
one client with project code) and it runs just fine. Both Hello World
closure and filter are executed just fine.

This is slightly puzzling to me, as I would expect cache key-value types to
NOT be peer loaded, but still, it works.

Please share reproducer project if it fails to work for you after checking
configurations.

Regards,

-- 
Ilya Kasnacheev

2018-08-09 17:58 GMT+03:00 Som Som <2av10...@gmail.com>:

> in first example i have not deployd HelloAction class manually but it
> works correctly it means that class was successfully transfered and
> deployed. but why this does not work in case of EmployeeEventFilter class?
> is it an error?
>
> чт, 9 авг. 2018 г., 15:46 Ilya Kasnacheev :
>
>> Hello!
>>
>> I'm not sure that C# has peer class loading. Are you sure that you have
>> this filter's code deployed on your server nodes?
>>
>> Regards,
>>
>> --
>> Ilya Kasnacheev
>>
>> 2018-08-09 15:23 GMT+03:00 Som Som <2av10...@gmail.com>:
>>
>>> is there any information?
>>>
>>> -- Forwarded message -
>>> From: Som Som <2av10...@gmail.com>
>>> Date: ср, 8 авг. 2018 г., 16:46
>>> Subject: continous query remote filter issue
>>> To: 
>>>
>>>
>>> hello.
>>>
>>> It looks like peerAssemblyLoadingMode flag doesn’t work correctly in
>>> case of CacheEntryEventFilter:
>>>
>>>
>>>
>>> As an example:
>>>
>>>
>>>
>>> 1)  This code works fine and I see “Hello world” on the server console.
>>> It means that HelloAction class was successfully transferred to server.
>>>
>>>
>>>
>>> class Program
>>>
>>> {
>>>
>>> static void Main(string[] args)
>>>
>>> {
>>>
>>> using (var ignite = Ignition.StartFromApplicationConfigurat
>>> ion())
>>>
>>> {
>>>
>>> var remotes = ignite.GetCluster().ForRemotes();
>>>
>>> remotes.GetCompute().Broadcast(newHelloAction());
>>>
>>> }
>>>
>>> }
>>>
>>>
>>>
>>> class HelloAction : IComputeAction
>>>
>>> {
>>>
>>> public void Invoke()
>>>
>>> {
>>>
>>> Console.WriteLine("Hello, World!");
>>>
>>> }
>>>
>>> }
>>>
>>> }
>>>
>>> 2)  But this code that sends the filter class to the remote server
>>> node generates an error and I receive 4 entries of Employee instead of
>>> 2 as expected:
>>>
>>> class Program
>>>
>>> {
>>>
>>> public class Employee
>>>
>>> {
>>>
>>> public Employee(string name, long salary)
>>>
>>> {
>>>
>>> Name = name;
>>>
>>> Salary = salary;
>>>
>>> }
>>>
>>>
>>>
>>> [QuerySqlField]
>>>
>>> public string Name { get; set; }
>>>
>>>
>>>
>>> [QuerySqlField]
>>>
>>> public long Salary { get; set; }
>>>
>>>
>>>
>>> public override string ToString()
>>>
>>> {
>>>
>>> return string.Format("{0} [name={1}, salary={2}]",
>>> typeof(Employee).Name, Name, Salary);
>>>
>>> }
>>>
>>> }
>>>
>>>
>>>
>>> class EmployeeEventListener :ICacheEntryEventListener>> Employee>
>>>
>>> {
>>>
>>> public void OnEvent(IEnumerable>> Employee>> evts)
>>>
>>> {
>>>
>>> foreach(var evt in evts)
>>>
>>> Console.WriteLine(evt.Value);
>>>
>>> }
>>>
>>> }
>>>
>>>
>>>
>>> class EmployeeEventFilter :ICacheEntryEventFilter
>>>
>>> {
>>>
>>> public bool Evaluate(ICacheEntryEvent evt)
>>>
>>> {
>>>
>>> return evt.Value.Salary > 5000;
>>>
>>> }
>>>
>>> }
>>>
>>>
>>>
>>> static void Main(string[] args)
>>>
>>> {
>>>
>>> using (var ignite = Ignition.StartFromApplicationConfigurat
>>> ion())
>>>
>>> {
>>>
>>> var employeeCache = ignite.GetOrCreateCache>> mployee>(
>>>
>>> new CacheConfiguration("employee", newQueryEntity(
>>> typeof(int), typeof(Employee))) { SqlSchema = "PUBLIC" });
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> var query = new ContinuousQuery(new
>>> EmployeeEventListener())
>>>
>>> {
>>>
>>> Filter = new EmployeeEventFilter()
>>>
>>> };
>>>
>>>
>>>
>>> var queryHandle = employeeCache.QueryContinuous(query);
>>>
>>>
>>>
>>> employeeCache.Put(1, newEmployee("James Wilson", 1000));
>>>
>>> employeeCache.Put(2, new Employee("Daniel Adams",
>>> 2000));
>>>
>>> employeeCache.Put(3, newEmployee("Cristian Moss",
>>> 7000));
>>>
>>> employeeCache.Put(4, newEmployee("Allison Mathis",
>>> 8000));
>>>
>>>
>>>
>>> Console.WriteLine("Press any key...");
>>>
>>> Console.ReadKey();

Re: continous query remote filter issue

2018-08-09 Thread Som Som
in first example i have not deployd HelloAction class manually but it works
correctly it means that class was successfully transfered and deployed. but
why this does not work in case of EmployeeEventFilter class? is it an error?

чт, 9 авг. 2018 г., 15:46 Ilya Kasnacheev :

> Hello!
>
> I'm not sure that C# has peer class loading. Are you sure that you have
> this filter's code deployed on your server nodes?
>
> Regards,
>
> --
> Ilya Kasnacheev
>
> 2018-08-09 15:23 GMT+03:00 Som Som <2av10...@gmail.com>:
>
>> is there any information?
>>
>> -- Forwarded message -
>> From: Som Som <2av10...@gmail.com>
>> Date: ср, 8 авг. 2018 г., 16:46
>> Subject: continous query remote filter issue
>> To: 
>>
>>
>> hello.
>>
>> It looks like peerAssemblyLoadingMode flag doesn’t work correctly in case
>> of CacheEntryEventFilter:
>>
>>
>>
>> As an example:
>>
>>
>>
>> 1)  This code works fine and I see “Hello world” on the server console.
>> It means that HelloAction class was successfully transferred to server.
>>
>>
>>
>> class Program
>>
>> {
>>
>> static void Main(string[] args)
>>
>> {
>>
>> using (var ignite = Ignition
>> .StartFromApplicationConfiguration())
>>
>> {
>>
>> var remotes = ignite.GetCluster().ForRemotes();
>>
>> remotes.GetCompute().Broadcast(newHelloAction());
>>
>> }
>>
>> }
>>
>>
>>
>> class HelloAction : IComputeAction
>>
>> {
>>
>> public void Invoke()
>>
>> {
>>
>> Console.WriteLine("Hello, World!");
>>
>> }
>>
>> }
>>
>> }
>>
>> 2)  But this code that sends the filter class to the remote server
>> node generates an error and I receive 4 entries of Employee instead of 2
>> as expected:
>>
>> class Program
>>
>> {
>>
>> public class Employee
>>
>> {
>>
>> public Employee(string name, long salary)
>>
>> {
>>
>> Name = name;
>>
>> Salary = salary;
>>
>> }
>>
>>
>>
>> [QuerySqlField]
>>
>> public string Name { get; set; }
>>
>>
>>
>> [QuerySqlField]
>>
>> public long Salary { get; set; }
>>
>>
>>
>> public override string ToString()
>>
>> {
>>
>> return string.Format("{0} [name={1}, salary={2}]", typeof
>> (Employee).Name, Name, Salary);
>>
>> }
>>
>> }
>>
>>
>>
>> class EmployeeEventListener :ICacheEntryEventListener> Employee>
>>
>> {
>>
>> public void OnEvent(IEnumerable> Employee>> evts)
>>
>> {
>>
>> foreach(var evt in evts)
>>
>> Console.WriteLine(evt.Value);
>>
>> }
>>
>> }
>>
>>
>>
>> class EmployeeEventFilter :ICacheEntryEventFilter
>>
>> {
>>
>> public bool Evaluate(ICacheEntryEvent evt)
>>
>> {
>>
>> return evt.Value.Salary > 5000;
>>
>> }
>>
>> }
>>
>>
>>
>> static void Main(string[] args)
>>
>> {
>>
>> using (var ignite = Ignition
>> .StartFromApplicationConfiguration())
>>
>> {
>>
>> var employeeCache = ignite.GetOrCreateCache> >(
>>
>> new CacheConfiguration("employee", newQueryEntity(
>> typeof(int), typeof(Employee))) { SqlSchema = "PUBLIC" });
>>
>>
>>
>>
>>
>>
>>
>> var query = new ContinuousQuery(new
>> EmployeeEventListener())
>>
>> {
>>
>> Filter = new EmployeeEventFilter()
>>
>> };
>>
>>
>>
>> var queryHandle = employeeCache.QueryContinuous(query);
>>
>>
>>
>> employeeCache.Put(1, newEmployee("James Wilson", 1000));
>>
>> employeeCache.Put(2, new Employee("Daniel Adams", 2000));
>>
>> employeeCache.Put(3, newEmployee("Cristian Moss", 7000));
>>
>> employeeCache.Put(4, newEmployee("Allison Mathis",
>> 8000));
>>
>>
>>
>> Console.WriteLine("Press any key...");
>>
>> Console.ReadKey();
>>
>> }
>>
>> }
>>
>> }
>>
>> Server node console output:
>>
>> [16:26:33]__  
>>
>> [16:26:33]   /  _/ ___/ |/ /  _/_  __/ __/
>>
>> [16:26:33]  _/ // (7 7// /  / / / _/
>>
>> [16:26:33] /___/\___/_/|_/___/ /_/ /___/
>>
>> [16:26:33]
>>
>> [16:26:33] ver. 2.7.0.20180721#19700101-sha1:DEV
>>
>> [16:26:33] 2018 Copyright(C) Apache Software Foundation
>>
>> [16:26:33]
>>
>> [16:26:33] Ignite documentation: http://ignite.apache.org
>>
>> [16:26:33]
>>
>> [16:26:33] Quiet mode.
>>
>> [16:26:33]   ^-- Logging to file
>> 'C:\Ignite\apache-ignite-fabric-2.7.0.20180721-bin\work\log\ignite-b1061a07.0.log'
>>
>> [16:26:33]   ^-- Logging by 'JavaLogger [quiet=true, config=null]'
>>
>> [16:26:33]   ^-- To see **FULL** console log here add
>> 

Re: continous query remote filter issue

2018-08-09 Thread Ilya Kasnacheev
Hello!

I'm not sure that C# has peer class loading. Are you sure that you have
this filter's code deployed on your server nodes?

Regards,

-- 
Ilya Kasnacheev

2018-08-09 15:23 GMT+03:00 Som Som <2av10...@gmail.com>:

> is there any information?
>
> -- Forwarded message -
> From: Som Som <2av10...@gmail.com>
> Date: ср, 8 авг. 2018 г., 16:46
> Subject: continous query remote filter issue
> To: 
>
>
> hello.
>
> It looks like peerAssemblyLoadingMode flag doesn’t work correctly in case
> of CacheEntryEventFilter:
>
>
>
> As an example:
>
>
>
> 1)  This code works fine and I see “Hello world” on the server console.
> It means that HelloAction class was successfully transferred to server.
>
>
>
> class Program
>
> {
>
> static void Main(string[] args)
>
> {
>
> using (var ignite = Ignition.StartFromApplicationConfigurat
> ion())
>
> {
>
> var remotes = ignite.GetCluster().ForRemotes();
>
> remotes.GetCompute().Broadcast(newHelloAction());
>
> }
>
> }
>
>
>
> class HelloAction : IComputeAction
>
> {
>
> public void Invoke()
>
> {
>
> Console.WriteLine("Hello, World!");
>
> }
>
> }
>
> }
>
> 2)  But this code that sends the filter class to the remote server
> node generates an error and I receive 4 entries of Employee instead of 2
> as expected:
>
> class Program
>
> {
>
> public class Employee
>
> {
>
> public Employee(string name, long salary)
>
> {
>
> Name = name;
>
> Salary = salary;
>
> }
>
>
>
> [QuerySqlField]
>
> public string Name { get; set; }
>
>
>
> [QuerySqlField]
>
> public long Salary { get; set; }
>
>
>
> public override string ToString()
>
> {
>
> return string.Format("{0} [name={1}, salary={2}]", typeof(
> Employee).Name, Name, Salary);
>
> }
>
> }
>
>
>
> class EmployeeEventListener :ICacheEntryEventListener Employee>
>
> {
>
> public void OnEvent(IEnumerable>
> evts)
>
> {
>
> foreach(var evt in evts)
>
> Console.WriteLine(evt.Value);
>
> }
>
> }
>
>
>
> class EmployeeEventFilter :ICacheEntryEventFilter
>
> {
>
> public bool Evaluate(ICacheEntryEvent evt)
>
> {
>
> return evt.Value.Salary > 5000;
>
> }
>
> }
>
>
>
> static void Main(string[] args)
>
> {
>
> using (var ignite = Ignition.StartFromApplicationConfigurat
> ion())
>
> {
>
> var employeeCache = ignite.GetOrCreateCache >(
>
> new CacheConfiguration("employee", newQueryEntity(
> typeof(int), typeof(Employee))) { SqlSchema = "PUBLIC" });
>
>
>
>
>
>
>
> var query = new ContinuousQuery(new
> EmployeeEventListener())
>
> {
>
> Filter = new EmployeeEventFilter()
>
> };
>
>
>
> var queryHandle = employeeCache.QueryContinuous(query);
>
>
>
> employeeCache.Put(1, newEmployee("James Wilson", 1000));
>
> employeeCache.Put(2, new Employee("Daniel Adams", 2000));
>
> employeeCache.Put(3, newEmployee("Cristian Moss", 7000));
>
> employeeCache.Put(4, newEmployee("Allison Mathis", 8000));
>
>
>
> Console.WriteLine("Press any key...");
>
> Console.ReadKey();
>
> }
>
> }
>
> }
>
> Server node console output:
>
> [16:26:33]__  
>
> [16:26:33]   /  _/ ___/ |/ /  _/_  __/ __/
>
> [16:26:33]  _/ // (7 7// /  / / / _/
>
> [16:26:33] /___/\___/_/|_/___/ /_/ /___/
>
> [16:26:33]
>
> [16:26:33] ver. 2.7.0.20180721#19700101-sha1:DEV
>
> [16:26:33] 2018 Copyright(C) Apache Software Foundation
>
> [16:26:33]
>
> [16:26:33] Ignite documentation: http://ignite.apache.org
>
> [16:26:33]
>
> [16:26:33] Quiet mode.
>
> [16:26:33]   ^-- Logging to file 'C:\Ignite\apache-ignite-
> fabric-2.7.0.20180721-bin\work\log\ignite-b1061a07.0.log'
>
> [16:26:33]   ^-- Logging by 'JavaLogger [quiet=true, config=null]'
>
> [16:26:33]   ^-- To see **FULL** console log here add -DIGNITE_QUIET=false
> or "-v" to ignite.{sh|bat}
>
> [16:26:33]
>
> [16:26:33] OS: Windows Server 2016 10.0 amd64
>
> [16:26:33] VM information: Java(TM) SE Runtime Environment 1.8.0_161-b12
> Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 25.161-b12
>
> [16:26:33] Please set system property '-Djava.net.preferIPv4Stack=true'
> to avoid possible problems in mixed environments.
>
> [16:26:33] Configured plugins:
>
> [16:26:33]   ^-- None
>
> [16:26:33]
>
> [16:26:33] Configured failure handler: [hnd=StopNodeOrHaltFailureHandler
>