.net service method call error

2019-06-17 Thread Som Som
hello.

I’m trying to deploy a service and call its method. Topology is one server
and one client.



Service:



[Serializable]

public class Service1 : IService, IPlusMinusService

{

[InstanceResource]

private readonly IIgnite _ignite;



private ICache _cache;



public void Init(IServiceContext context)

{

_cache = _ignite.GetCache("Test_Int_Int");

}



public void Execute(IServiceContext context)

{

//throw new NotImplementedException();

}



public void Cancel(IServiceContext context)

{

//throw new NotImplementedException();

}



public void PlusOne()

{

_cache.Put(1, _cache.Get(1) + 1);

}



public void MinusOne()

{

_cache.Put(1, _cache.Get(1) - 1);

}

}





Code:

 using (var ignite = Ignition.StartFromApplicationConfiguration())

{

var cache = ignite.GetOrCreateCache("Test_Int_Int"
);

cache.Put(1, 0);



var cacheGrp = ignite.GetCluster().ForCacheNodes(
"Test_Int_Int");

var services = cacheGrp.GetServices();

services.DeployNodeSingleton("SVC1_1",new Service1());



IPlusMinusService SVC1_1 = services.GetService(
"SVC1_1"); // Returns null

IPlusMinusService proxy =
services.GetServiceProxy("SVC1_1");

proxy.PlusOne();   //Fires an error

}

error log:

2019 12:10:34 PM org.apache.ignite.logger.java.JavaLogger error

SEVERE: Failed to obtain remote job result policy for result from
ComputeTask.result(..) method (will fail the whole task): GridJobResultImp

l [job=C2 [c=ServiceProxyCallable [mtdName=invokeMethod, svcName=SVC1_1,
ignite=null]], sib=GridJobSiblingImpl [sesId=0cca3b46b61-2e1b3707-3

a3a-4819-a903-3b58bb1db2c0,
jobId=1cca3b46b61-2e1b3707-3a3a-4819-a903-3b58bb1db2c0,
nodeId=27895328-1d37-4907-842b-fab79738dbc1, isJobDone=f

alse], jobCtx=GridJobContextImpl
[jobId=1cca3b46b61-2e1b3707-3a3a-4819-a903-3b58bb1db2c0, timeoutObj=null,
attrs={}], node=TcpDiscoveryNode

[id=27895328-1d37-4907-842b-fab79738dbc1, addrs=[0:0:0:0:0:0:0:1,
127.0.0.1, 172.19.91.29], sockAddrs=[DSP-RiskroomDev.bcsprime.local/172.19

.91.29:48500, /0:0:0:0:0:0:0:1:48500, /127.0.0.1:48500], discPort=48500,
order=1, intOrder=1, lastExchangeTime=1560762626538, loc=false, ver

=2.7.0#20181130-sha1:256ae401, isClient=false], ex=class
o.a.i.IgniteException: Service not found: SVC1_1, hasRes=true,
isCancelled=false, i

sOccupied=true]

class org.apache.ignite.IgniteException: Remote job threw user exception
(override or implement ComputeTask.result(..) method if you would l

ike to have automatic failover for this exception): Service not found:
SVC1_1

at
org.apache.ignite.compute.ComputeTaskAdapter.result(ComputeTaskAdapter.java:102)

at
org.apache.ignite.internal.processors.task.GridTaskWorker$5.apply(GridTaskWorker.java:1053)

at
org.apache.ignite.internal.processors.task.GridTaskWorker$5.apply(GridTaskWorker.java:1046)

at
org.apache.ignite.internal.util.IgniteUtils.wrapThreadLoader(IgniteUtils.java:6848)

at
org.apache.ignite.internal.processors.task.GridTaskWorker.result(GridTaskWorker.java:1046)

at
org.apache.ignite.internal.processors.task.GridTaskWorker.onResponse(GridTaskWorker.java:864)

at
org.apache.ignite.internal.processors.task.GridTaskProcessor.processJobExecuteResponse(GridTaskProcessor.java:1081)

at
org.apache.ignite.internal.processors.task.GridTaskProcessor$JobMessageListener.onMessage(GridTaskProcessor.java:1316)

at
org.apache.ignite.internal.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1569)

at
org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:1197)

at
org.apache.ignite.internal.managers.communication.GridIoManager.access$4200(GridIoManager.java:127)

at
org.apache.ignite.internal.managers.communication.GridIoManager$9.run(GridIoManager.java:1093)

at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

at java.lang.Thread.run(Thread.java:748)

Caused by: class org.apache.ignite.IgniteException: Service not found:
SVC1_1

at
org.apache.ignite.internal.processors.closure.GridClosureProcessor$C2.execute(GridClosureProcessor.java:1858)

at
org.apache.ignite.internal.processors.job.GridJobWorker$2.call(GridJobWorker.java:568)

at
org.apache.ignite.internal.util.IgniteUtils.wrapThreadLoader(IgniteUtils.java:6816)

at
org.apache.ignite.internal.processors.job.GridJobWorker.execute0(GridJobWorker.java:562)

at

Re:

2019-01-28 Thread Som Som
.Net part:

using (var ignite =Ignition.StartClient(Ignition
.ClientConfigurationSectionName))

{

var queryEntity = new QueryEntity

{

KeyTypeName = typeof(string).FullName,

KeyType = typeof(string),

ValueTypeName = typeof(int).FullName,

ValueType = typeof(int),

Fields = new[] { newQueryField("ClassCode", typeof(
string)) { IsKeyField =true }, new QueryField("Priority", typeof(int)) {
IsKeyField = false } }

};



queryEntity.TableName =IgniteCacheName
.QUIK_CLASSCODE_PRIORITY;



var cfg = new CacheClientConfiguration(IgniteCacheName
.QUIK_CLASSCODE_PRIORITY, new[] { queryEntity })

{

DataRegionName = "persistent",

Backups = 1,

SqlSchema = "PUBLIC"

};



var c = ignite.GetOrCreateCache(cfg);



c.Put("a", 1);

}



Sql query part:



This query works ok – SELECT _Key, _Val FROM "QUIK.CLASSCODEPRIORITY"

But this one throws an error mentioned above SELECT SecCode, Prioruty FROM
"QUIK.CLASSCODEPRIORITY"

пн, 28 янв. 2019 г., 14:23 Ilya Kasnacheev ilya.kasnach...@gmail.com:

> Hello!
>
> Can you please show your cache configuration and the exact SQL statement
> used?
>
> What happens here is that Ignite expects some composite value type as
> opposed to bare integer. Not so clear why yet.
>
> Regards,
> --
> Ilya Kasnacheev
>
>
> пн, 28 янв. 2019 г. в 14:12, Som Som <2av10...@gmail.com>:
>
>>
>> hi, i'v got a roblem reading the cache throgh the odbc.
>>
>> cahche was created in .net, key type is string, value type is int.
>>
>> error text:
>>
>> SQL Error [5]: javax.cache.CacheException: Failed to execute map
>> query on remote node [nodeId=c3ef8d97-09d0-432d-a0a2-7fd73e8413bc,
>> errMsg=Failed to execute SQL query. General error: "class
>> org.apache.ignite.IgniteCheckedException: Unexpected binary object class
>> [type=class java.lang.Integer]"; SQL statement:
>>
>> SELECT
>>
>> __Z0.CLASSCODE __C0_0,
>>
>> __Z0.PRIORITY __C0_1
>>
>> FROM PUBLIC."QUIK.CLASSCODEPRIORITY" __Z0 [5-197]]
>>
>>   javax.cache.CacheException: Failed to execute map query on remote node
>> [nodeId=c3ef8d97-09d0-432d-a0a2-7fd73e8413bc, errMsg=Failed to execute SQL
>> query. General error: "class org.apache.ignite.IgniteCheckedException:
>> Unexpected binary object class [type=class java.lang.Integer]"; SQL
>> statement:
>>
>> SELECT
>>
>> __Z0.CLASSCODE __C0_0,
>>
>> __Z0.PRIORITY __C0_1
>>
>> FROM PUBLIC."QUIK.CLASSCODEPRIORITY" __Z0 [5-197]]
>>
>>   javax.cache.CacheException: Failed to execute map query on remote node
>> [nodeId=c3ef8d97-09d0-432d-a0a2-7fd73e8413bc, errMsg=Failed to execute SQL
>> query. General error: "class org.apache.ignite.IgniteCheckedException:
>> Unexpected binary object class [type=class java.lang.Integer]"; SQL
>> statement:
>>
>> SELECT
>>
>> __Z0.CLASSCODE __C0_0,
>>
>> __Z0.PRIORITY __C0_1
>>
>> FROM PUBLIC."QUIK.CLASSCODEPRIORITY" __Z0 [5-197]]
>>
>


[no subject]

2019-01-28 Thread Som Som
hi, i'v got a roblem reading the cache throgh the odbc.

cahche was created in .net, key type is string, value type is int.

error text:

SQL Error [5]: javax.cache.CacheException: Failed to execute map query
on remote node [nodeId=c3ef8d97-09d0-432d-a0a2-7fd73e8413bc, errMsg=Failed
to execute SQL query. General error: "class
org.apache.ignite.IgniteCheckedException: Unexpected binary object class
[type=class java.lang.Integer]"; SQL statement:

SELECT

__Z0.CLASSCODE __C0_0,

__Z0.PRIORITY __C0_1

FROM PUBLIC."QUIK.CLASSCODEPRIORITY" __Z0 [5-197]]

  javax.cache.CacheException: Failed to execute map query on remote node
[nodeId=c3ef8d97-09d0-432d-a0a2-7fd73e8413bc, errMsg=Failed to execute SQL
query. General error: "class org.apache.ignite.IgniteCheckedException:
Unexpected binary object class [type=class java.lang.Integer]"; SQL
statement:

SELECT

__Z0.CLASSCODE __C0_0,

__Z0.PRIORITY __C0_1

FROM PUBLIC."QUIK.CLASSCODEPRIORITY" __Z0 [5-197]]

  javax.cache.CacheException: Failed to execute map query on remote node
[nodeId=c3ef8d97-09d0-432d-a0a2-7fd73e8413bc, errMsg=Failed to execute SQL
query. General error: "class org.apache.ignite.IgniteCheckedException:
Unexpected binary object class [type=class java.lang.Integer]"; SQL
statement:

SELECT

__Z0.CLASSCODE __C0_0,

__Z0.PRIORITY __C0_1

FROM PUBLIC."QUIK.CLASSCODEPRIORITY" __Z0 [5-197]]


backup mode

2019-01-07 Thread Som Som
hello.

is it posible to change backup from 0 to 1 in existing cache?


continous query

2018-12-26 Thread Som Som
hello.

i would like to use labda expression for initial and remote filters of
continousquery. simething like this:

[Serializable]

public class ScanQueryFilter3 :ICacheEntryFilter

{

private readonly Expression, bool>>
_pdct;



public ScanQueryFilter3(Expression,
bool>> pdct)

{

_pdct = pdct;

}



public bool Invoke(ICacheEntry entry)

{

return _pdct.Compile().Invoke(entry);

}

}
is it possible? do you have examples?


adding into baseline topology

2018-12-20 Thread Som Som
i am trying to add node into baseline topology:

using (var ignite = Ignition.StartFromApplicationConfiguration())

{

var baselineTopology =
ignite.GetCluster().GetBaselineTopology();

var node = ignite.GetCluster().GetNode(Guid.Parse(
"344BEAA8-4E59-4673-8397-858AB919B895"));

baselineTopology.Add(node);

   ignite.GetCluster().SetBaselineTopology(baselineTopology);

ignite.GetCluster().SetActive(true);

}


But it does not work because node 344be... still not in baseline topologi.
What am i doing wrong?


rest api question

2018-09-13 Thread Som Som
Hi.



What is a right way to add TestEntity(it has 2 fields) into the cache via
REST API.



This is how I created TestEntity cache:



public class TestEntity

{

public string ValueString { get; set; }



public DateTime ValueDateTime { get; set; }

}



class Program

{

static void Main(string[] args)

{

var ignite = Ignition.StartClient(newIgniteClientConfiguration

{

Host = "127.0.0.1"

,

BinaryConfiguration = newApache.Ignite.Core.Binary.
BinaryConfiguration { Serializer = new Apache.Ignite.Core.Binary.
BinaryReflectiveSerializer { ForceTimestamp = true } }

});



var queryEntity = new QueryEntity();

queryEntity.KeyTypeName =typeof(int).FullName;

queryEntity.KeyType = typeof(int);



queryEntity.ValueTypeName =typeof(TestEntity).FullName;

queryEntity.ValueType = typeof(TestEntity);



queryEntity.Fields = new QueryField[]

{ new QueryField("ValueString", typeof(string))

, new QueryField("ValueDateTime",typeof(DateTime))

};



var cache = ignite.GetOrCreateCache(

   newCacheClientConfiguration(
"TestEntity", queryEntity) { SqlSchema = "PUBLIC" });





//cache.Put(1, new TestEntity { ValueString = "test",
ValueDateTime = DateTime.UtcNow });



ignite.Dispose();

}

}


Re: cache doesn't exist

2018-09-12 Thread Som Som
the cache names list is empty then i call the method of non thin client
butmy TestCache is stil exists and i can see it under the thin client. i
cant see the cache from NON thin client if it is created from thin client.

ср, 12 сент. 2018 г., 13:29 Evgenii Zhuravlev :

> Hi,
>
> You can always get the list of the all caches in cluster using
> Ignite.cacheNames() method.
>
> Evgenii
>
> ср, 12 сент. 2018 г. в 13:26, Som Som <2av10...@gmail.com>:
>
>> Hello
>>
>>
>>
>> I created new cache using thin .net client:
>>
>>
>>
>> public class TestEntity
>>
>> {
>>
>> public string ValueString { get; set; }
>>
>>
>>
>> public DateTime ValueDateTime { get; set; }
>>
>> }
>>
>>
>>
>> class Program
>>
>> {
>>
>> static void Main(string[] args)
>>
>> {
>>
>> var ignite = Ignition.StartClient(new
>> IgniteClientConfiguration
>>
>> {
>>
>> Host = "127.0.0.1"
>>
>> ,
>>
>> BinaryConfiguration = newApache.Ignite.Core.Binary.
>> BinaryConfiguration { Serializer = new Apache.Ignite.Core.Binary.
>> BinaryReflectiveSerializer { ForceTimestamp = true } }
>>
>> });
>>
>>
>>
>> var queryEntity = new QueryEntity();
>>
>> queryEntity.KeyTypeName =typeof(int).FullName;
>>
>> queryEntity.KeyType = typeof(int);
>>
>>
>>
>> queryEntity.ValueTypeName =typeof(TestEntity).FullName;
>>
>> queryEntity.ValueType = typeof(TestEntity);
>>
>>
>>
>> queryEntity.Fields = new QueryField[]
>>
>> { new QueryField("ValueString", typeof(string))
>>
>> , new QueryField("ValueDateTime",typeof(DateTime))
>>
>> };
>>
>>
>>
>> var cache = ignite.GetOrCreateCache(
>>
>>newCacheClientConfiguration(
>> "TestEntity", queryEntity) { SqlSchema = "PUBLIC" });
>>
>>
>>
>>
>>
>> cache.Put(1, new TestEntity { ValueString ="test",
>> ValueDateTime = DateTime.UtcNow });
>>
>>
>>
>> ignite.Dispose();
>>
>> }
>>
>> }
>>
>>
>>
>> Then i tried  to get this cache using typical .net client but instead of
>> cache I got an error “Additional information: Cache doesn't exist:
>> TestEntity”:
>>
>>
>>
>> class Program
>>
>> {
>>
>> static void Main(string[] args)
>>
>> {
>>
>> var ignite = Ignition.Start(newIgniteConfiguration
>>
>> {
>>
>> DiscoverySpi = new TcpDiscoverySpi
>>
>> {
>>
>> IpFinder = new TcpDiscoveryStaticIpFinder
>>
>> {
>>
>> Endpoints = new[] { "127.0.0.1" }
>>
>> }
>>
>> }
>>
>> });
>>
>>
>>
>>
>>
>> var cache = ignite.GetCache("TestEntity");
>>
>>
>>
>> ignite.Dispose();
>>
>> }
>>
>> }
>>
>>
>>
>> How can I get a cache correctly?
>>
>


cache doesn't exist

2018-09-12 Thread Som Som
Hello



I created new cache using thin .net client:



public class TestEntity

{

public string ValueString { get; set; }



public DateTime ValueDateTime { get; set; }

}



class Program

{

static void Main(string[] args)

{

var ignite = Ignition.StartClient(newIgniteClientConfiguration

{

Host = "127.0.0.1"

,

BinaryConfiguration = newApache.Ignite.Core.Binary.
BinaryConfiguration { Serializer = new Apache.Ignite.Core.Binary.
BinaryReflectiveSerializer { ForceTimestamp = true } }

});



var queryEntity = new QueryEntity();

queryEntity.KeyTypeName =typeof(int).FullName;

queryEntity.KeyType = typeof(int);



queryEntity.ValueTypeName =typeof(TestEntity).FullName;

queryEntity.ValueType = typeof(TestEntity);



queryEntity.Fields = new QueryField[]

{ new QueryField("ValueString", typeof(string))

, new QueryField("ValueDateTime",typeof(DateTime))

};



var cache = ignite.GetOrCreateCache(

   newCacheClientConfiguration(
"TestEntity", queryEntity) { SqlSchema = "PUBLIC" });





cache.Put(1, new TestEntity { ValueString ="test",
ValueDateTime = DateTime.UtcNow });



ignite.Dispose();

}

}



Then i tried  to get this cache using typical .net client but instead of
cache I got an error “Additional information: Cache doesn't exist:
TestEntity”:



class Program

{

static void Main(string[] args)

{

var ignite = Ignition.Start(newIgniteConfiguration

{

DiscoverySpi = new TcpDiscoverySpi

{

IpFinder = new TcpDiscoveryStaticIpFinder

{

Endpoints = new[] { "127.0.0.1" }

}

}

});





var cache = ignite.GetCache("TestEntity");



ignite.Dispose();

}

}



How can I get a cache correctly?


Re: .net entity based configuration / datetime field error

2018-09-04 Thread Som Som
thank you Pavel. It helped. I added
"IgniteConfiguration.BinaryConfiguration.Serializer
= new BinaryReflectiveSerializer { ForceTimestamp = true }" into config and
removed attribute and it works correctly.

вт, 4 сент. 2018 г., 9:35 Pavel Tupitsyn :

> Hi Som,
>
> The issue here is that Ignite writes DateTime in an internal format when
> [QuerySqlField] attribute is not present, to handle non-UTC values [1].
> This internal format is not SQL-compatible.
>
> There are multiple options to enforce TIMESTAMP format:
>  * Implement IBinarizable
>  * Implement IBinarySerializer
>  * Set IgniteConfiguration.BinaryConfiguration.Serializer = new
> BinaryReflectiveSerializer { ForceTimestamp = true }
>
> The last one enforces TIMESTAMP format globally, and requires all DateTime
> values to be of DateTimeKind.Utc
> (which is actually a good practice for persisting date and time).
>
> Thanks,
> Pavel
>
> [1]
> https://apacheignite-net.readme.io/docs/sql-queries#section-java-type-name-mapping
>
> On Mon, Sep 3, 2018 at 7:10 PM Som Som <2av10...@gmail.com> wrote:
>
>> I’m connecting to the server node via DBeaver (connection settings\ jdbc
>> url - jdbc:ignite:thin://xxx.xx.xx.xx/). I can query DateTime field if I
>> use Attributes Based Configuration and I get an error mentioned below in
>> case of using QueryEntity Based Configuration. How to configure a cache
>> with QueryEntity Based Configuration in .net in order to read DateTime via
>> jdbc.
>>
>>
>>
>> пн, 3 сент. 2018 г., 17:53 Igor Sapego :
>>
>>> Which exactly ODBC driver are you talking about?
>>>
>>> Best Regards,
>>> Igor
>>>
>>>
>>> On Mon, Sep 3, 2018 at 4:48 PM wt  wrote:
>>>
>>>> not sure if it helps but the odbc driver doesnt play nice with date
>>>> fields
>>>> and deals with them in binary format
>>>>
>>>> class org.apache.ignite.binary.BinaryInvalidTypeException
>>>>
>>>> your error looks to be related - have you tried the jdbc driver as a
>>>> test?
>>>>
>>>>
>>>>
>>>> --
>>>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>>>
>>>


Re: .net entity based configuration / datetime field error

2018-09-03 Thread Som Som
I’m connecting to the server node via DBeaver (connection settings\ jdbc
url - jdbc:ignite:thin://xxx.xx.xx.xx/). I can query DateTime field if I
use Attributes Based Configuration and I get an error mentioned below in
case of using QueryEntity Based Configuration. How to configure a cache
with QueryEntity Based Configuration in .net in order to read DateTime via
jdbc.



пн, 3 сент. 2018 г., 17:53 Igor Sapego :

> Which exactly ODBC driver are you talking about?
>
> Best Regards,
> Igor
>
>
> On Mon, Sep 3, 2018 at 4:48 PM wt  wrote:
>
>> not sure if it helps but the odbc driver doesnt play nice with date fields
>> and deals with them in binary format
>>
>> class org.apache.ignite.binary.BinaryInvalidTypeException
>>
>> your error looks to be related - have you tried the jdbc driver as a test?
>>
>>
>>
>> --
>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>
>


.net entity based configuration / datetime field error

2018-09-03 Thread Som Som
Hello.

if  I use Attributes Based Configuration I can put enitity into the cache
via key value api and than read rhis entity through the dbeaver(select *
from testentity)

*Code:*

namespace Example

{

public class TestEntity

{

[QuerySqlField]

public string ValueString { get; set; }



[QuerySqlField]

public DateTime ValueDateTime { get; set; }

}



class Program

{

static void Main(string[] args)

{

var ignite = Ignition.StartClient(newIgniteClientConfiguration {
Host = "127.0.0.1" });



var cache = ignite.GetOrCreateCache(

   new CacheClientConfiguration("TestEntity"
, new QueryEntity[] { newQueryEntity(typeof(TestEntity)) }) { SqlSchema =
"PUBLIC" });



cache.Put(1, new TestEntity { ValueString ="test",
ValueDateTime = DateTime.UtcNow });





ignite.Dispose();

}

}
}



But when I use QueryEntity Based Configuration (that is what I actually
need) a have an error running the same query in dbeaver

*Code:*

namespace Example

{

public class TestEntity

{

//[QuerySqlField]

public string ValueString { get; set; }



//[QuerySqlField]

public DateTime ValueDateTime { get; set; }

}



class Program

{

static void Main(string[] args)

{

var ignite = Ignition.StartClient(newIgniteClientConfiguration {
Host = "127.0.0.1" });



var queryEntity = new QueryEntity();

queryEntity.KeyTypeName =typeof(int).FullName;

queryEntity.KeyType = typeof(int);



queryEntity.ValueTypeName =typeof(TestEntity).FullName;

queryEntity.ValueType = typeof(TestEntity);



queryEntity.Fields = new QueryField[]

{ new QueryField("ValueString", typeof(string))

, new QueryField("ValueDateTime",typeof(DateTime))

};



var cache = ignite.GetOrCreateCache(

   newCacheClientConfiguration(
"TestEntity", queryEntity) { SqlSchema = "PUBLIC" });





cache.Put(1, new TestEntity { ValueString ="test",
ValueDateTime = DateTime.UtcNow });





ignite.Dispose();

}

}
}

*Result in dbeaver (select * from testentity):*

SQL Error [5]: javax.cache.CacheException: Failed to run map query
remotely.Failed to execute map query on the node:
71b3514c-8d19-448d-9ae0-295fca1f4cbc, class
org.apache.ignite.IgniteCheckedException:Failed to execute SQL query.
General error: "class org.apache.ignite.binary.BinaryInvalidTypeException:
Unknown pair [platformId=0, typeId=-1854586790]"; SQL statement:

SELECT

__Z0.VALUESTRING __C0_0,

__Z0.VALUEDATETIME __C0_1

FROM PUBLIC.TESTENTITY __Z0 [5-195]


How to use entity-based configuration correctly to get the correct result
via odbc with DateTime fields?


.net entity with datetime field / entity based conf

2018-09-01 Thread Som Som
Hello.

if  I use Attributes Based Configuration I can put enitity into the cache
via key value api and than read rhis entity through the dbeaver(select *
from testentity)

*Code:*

namespace Example

{

public class TestEntity

{

[QuerySqlField]

public string ValueString { get; set; }



[QuerySqlField]

public DateTime ValueDateTime { get; set; }

}



class Program

{

static void Main(string[] args)

{

var ignite = Ignition.StartClient(newIgniteClientConfiguration {
Host = "127.0.0.1" });



var cache = ignite.GetOrCreateCache(

   new CacheClientConfiguration("TestEntity"
, new QueryEntity[] { newQueryEntity(typeof(TestEntity)) }) { SqlSchema =
"PUBLIC" });



cache.Put(1, new TestEntity { ValueString ="test",
ValueDateTime = DateTime.UtcNow });





ignite.Dispose();

}

}
}



But when I use QueryEntity Based Configuration (that is what I actually
need) a have an error running the same query in dbeaver

*Code:*

namespace Example

{

public class TestEntity

{

//[QuerySqlField]

public string ValueString { get; set; }



//[QuerySqlField]

public DateTime ValueDateTime { get; set; }

}



class Program

{

static void Main(string[] args)

{

var ignite = Ignition.StartClient(newIgniteClientConfiguration {
Host = "127.0.0.1" });



var queryEntity = new QueryEntity();

queryEntity.KeyTypeName =typeof(int).FullName;

queryEntity.KeyType = typeof(int);



queryEntity.ValueTypeName =typeof(TestEntity).FullName;

queryEntity.ValueType = typeof(TestEntity);



queryEntity.Fields = new QueryField[]

{ new QueryField("ValueString", typeof(string))

, new QueryField("ValueDateTime",typeof(DateTime))

};



var cache = ignite.GetOrCreateCache(

   newCacheClientConfiguration(
"TestEntity", queryEntity) { SqlSchema = "PUBLIC" });





cache.Put(1, new TestEntity { ValueString ="test",
ValueDateTime = DateTime.UtcNow });





ignite.Dispose();

}

}
}

*Result in dbeaver (select * from testentity):*

SQL Error [5]: javax.cache.CacheException: Failed to run map query
remotely.Failed to execute map query on the node:
71b3514c-8d19-448d-9ae0-295fca1f4cbc, class
org.apache.ignite.IgniteCheckedException:Failed to execute SQL query.
General error: "class org.apache.ignite.binary.BinaryInvalidTypeException:
Unknown pair [platformId=0, typeId=-1854586790]"; SQL statement:

SELECT

__Z0.VALUESTRING __C0_0,

__Z0.VALUEDATETIME __C0_1

FROM PUBLIC.TESTENTITY __Z0 [5-195]


How to use entity-based configuration correctly to get the correct result
via odbc with DateTime fields?


[no subject]

2018-08-17 Thread Som Som
I’v got an ignite java server node and  a client node which is c#
application

public partial class TestEntityKey

{

public string s1 { get; set; }

public string s2 { get; set; }

}



public partial class TestEntity

{

public string v1 { get; set; }

public string v2 { get; set; }

}



static void Main(string[] args)

{

var ignite = Ignition.StartFromApplicationConfiguration();



var qe = new QueryEntity

{

KeyType = typeof(TestEntityKey),

ValueType = typeof(TestEntity),

Fields = new[]

{

new QueryField {Name = "s1", FieldType =
typeof(string) IsKeyField = true},

new QueryField {Name = "s2", FieldType =
typeof(string) IsKeyField = true },

new QueryField {Name = "v1", FieldType =
typeof(string) },

new QueryField {Name = "v2", FieldType =
typeof(string) },

}

};



var testCache = ignite.GetOrCreateCache

(

new CacheConfiguration

{

Name = "TestEntity",

QueryEntities = new[]

{

qe

},

SqlSchema = "PUBLIC"

}

);

Console.WriteLine("Press any key...");

Console.ReadKey();



ignite.Dispose();

}

I started client application then added one row into TestEntity table via
DBeaver, there was no problem on that point. Than I added one line of code
into my client application

*Console**.WriteLine(**$"\n**{ToString(testCache.FirstOrDefault())}**\n"*
*);”*

and got an error: “Requesting mapping from grid failed for [platformId=1,
typeId=-232515692]” after that I added one more line just before the first
one

testCache.Put(new TestEntityKey(), newTestEntity());

and after that I saw two rows of my TestEntity table without anybproblems.

Isn’t it an error?


sql query log

2018-08-16 Thread Som Som
hi.

how can i log all the sql queries on the server node side?


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);
>>
>>
>>
>>

Fwd: continous query remote filter issue

2018-08-09 Thread Som Som
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

{

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
.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 -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
[tryStop=false, timeout=0]]

[16:26:33] Message queue limit is set to 0 which may lead to potential
OOMEs when running cache operations in FULL_ASYNC or PRIMARY_SYNC modes due
to message queues growth on sender and receiver sides.

[16:26:33] Security status [authentication=off, tls/ssl=off]

[16:26:35] Performance suggestions for grid  (fix if possible)

[16:26:35] To disable, set -DIGNITE_PERFORMANCE_SUGGESTIONS_DISABLED=true

[16:26:35]   ^-- Enable G1 Garbage Collector (add '-XX:+UseG1GC'

continous query remote filter issue

2018-08-08 Thread Som Som
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

{

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
.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 -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
[tryStop=false, timeout=0]]

[16:26:33] Message queue limit is set to 0 which may lead to potential
OOMEs when running cache operations in FULL_ASYNC or PRIMARY_SYNC modes due
to message queues growth on sender and receiver sides.

[16:26:33] Security status [authentication=off, tls/ssl=off]

[16:26:35] Performance suggestions for grid  (fix if possible)

[16:26:35] To disable, set -DIGNITE_PERFORMANCE_SUGGESTIONS_DISABLED=true

[16:26:35]   ^-- Enable G1 Garbage Collector (add '-XX:+UseG1GC' to JVM
options)

[16:26:35]   ^-- Specify JVM heap max size (add '-Xmx[g|G|m|M|k|K]'
to JVM options)

[16:26:35]   ^-- Set max direct memory size if getting 'OOME: Direct buffer
memory' (add '-XX:MaxDirectMemorySize=[g|G|m|M|k|K]' to JVM options)

[16:26:35]   ^-- Disable processing of calls to 

Re: remote filter of continous query.

2018-08-07 Thread Som Som
can i use both remote java and c# filters in this case or not?

вт, 7 авг. 2018 г., 17:13 Ilya Kasnacheev :

> Hello!
>
> My guess is that you need to start all of your nodes (including server
> nodes) as C# nodes in order to use remote filters or a lot of other
> features that run code remotely.
>
> You can probably even use Apache.Ignite.exe for that.
>
> Regards,
>
> --
> Ilya Kasnacheev
>
> 2018-08-07 17:11 GMT+03:00 Som Som <2av10...@gmail.com>:
>
>> Hi.
>>
>> i'm trying to set up a remote filter for continous query using c# client
>> and i see an error on the console window of my server node: ...platforms
>> are not available... What could be the reason for that?
>>
>
>


remote filter of continous query.

2018-08-07 Thread Som Som
Hi.

i'm trying to set up a remote filter for continous query using c# client
and i see an error on the console window of my server node: ...platforms
are not available... What could be the reason for that?


Re: odbc / cursor is in open state allready

2018-07-13 Thread Som Som
hi. yes, that's it.

when is the new release with the fix planned? or how can get a fixed
version of driver?

13 июл. 2018 г. 10:20 ДП пользователь "Pavel Vinokurov" <
vinokurov.pa...@gmail.com> написал:

Hi,

Probably this issue relates to
https://issues.apache.org/jira/browse/IGNITE-8838

Thanks,
Pavel

2018-07-12 15:36 GMT+03:00 Som Som <2av10...@gmail.com>:

> 2.5.0
>
> чт, 12 июл. 2018 г., 12:47 Igor Sapego :
>
>> Hello,
>>
>> What is the Ignite version you are using?
>>
>> Best Regards,
>> Igor
>>
>>
>> On Wed, Jul 11, 2018 at 7:47 PM Som Som <2av10...@gmail.com> wrote:
>>
>>> There is a system ("DS") which publishes data into MS db via odbc and *it
>>> works without any problems*.
>>>
>>> So i created cache instead of MS db table “T”, then as a test i
>>> connected via DBeaver and inserted test row and there was no problem. Next
>>> i installed ignite odbc driver and created dsn, but when i tryed to publish
>>> data from data "DS" only one row was inserted into the table and  i saw
>>> errors in "DS" log file: “Error: SQL Error DBTable ‘T’ DB ODBC error: Query
>>> cursor is in open state already.”
>>>
>>>
>>>
>>> Cache was created with the following code:
>>>
>>>
>>>
>>> var cache = ignite.GetOrCreateCache(
>>>
>>> new CacheConfiguration
>>>
>>> {
>>>
>>> SqlSchema = "PUBLIC",
>>>
>>> Name = "T",
>>>
>>> WriteSynchronizationMode =
>>> CacheWriteSynchronizationMode.FullAsync,
>>>
>>> QueryEntities = new[] { newQueryEntity(typeof
>>> (TKey), typeof(T)) }
>>>
>>> });
>>>
>>>
>>>
>>> What could be the problem?
>>>
>>


-- 

Regards

Pavel Vinokurov


Re: odbc / cursor is in open state allready

2018-07-12 Thread Som Som
2.5.0

чт, 12 июл. 2018 г., 12:47 Igor Sapego :

> Hello,
>
> What is the Ignite version you are using?
>
> Best Regards,
> Igor
>
>
> On Wed, Jul 11, 2018 at 7:47 PM Som Som <2av10...@gmail.com> wrote:
>
>> There is a system ("DS") which publishes data into MS db via odbc and *it
>> works without any problems*.
>>
>> So i created cache instead of MS db table “T”, then as a test i connected
>> via DBeaver and inserted test row and there was no problem. Next i
>> installed ignite odbc driver and created dsn, but when i tryed to publish
>> data from data "DS" only one row was inserted into the table and  i saw
>> errors in "DS" log file: “Error: SQL Error DBTable ‘T’ DB ODBC error: Query
>> cursor is in open state already.”
>>
>>
>>
>> Cache was created with the following code:
>>
>>
>>
>> var cache = ignite.GetOrCreateCache(
>>
>> new CacheConfiguration
>>
>> {
>>
>> SqlSchema = "PUBLIC",
>>
>> Name = "T",
>>
>> WriteSynchronizationMode =
>> CacheWriteSynchronizationMode.FullAsync,
>>
>> QueryEntities = new[] { newQueryEntity(typeof(TKey),
>> typeof(T)) }
>>
>> });
>>
>>
>>
>> What could be the problem?
>>
>


odbc / cursor is in open state allready

2018-07-11 Thread Som Som
There is a system ("DS") which publishes data into MS db via odbc and *it
works without any problems*.

So i created cache instead of MS db table “T”, then as a test i connected
via DBeaver and inserted test row and there was no problem. Next i
installed ignite odbc driver and created dsn, but when i tryed to publish
data from data "DS" only one row was inserted into the table and  i saw
errors in "DS" log file: “Error: SQL Error DBTable ‘T’ DB ODBC error: Query
cursor is in open state already.”



Cache was created with the following code:



var cache = ignite.GetOrCreateCache(

new CacheConfiguration

{

SqlSchema = "PUBLIC",

Name = "T",

WriteSynchronizationMode =CacheWriteSynchronizationMode
.FullAsync,

QueryEntities = new[] { newQueryEntity(typeof(TKey),
typeof(T)) }

});



What could be the problem?


can't see caches via DBeaver

2018-07-05 Thread Som Som
Hello.



I installed DBeaver in order to browse caches, configured the driver
accordingly the instruction. As a result DBeaver successfully connected to
server node, but there was no "City" cache in tables folder. Cache was
created with the code attached below.



Server node configuration:



http://www.springframework.org/schema/beans;

   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;

   xsi:schemaLocation="

   http://www.springframework.org/schema/beans

   http://www.springframework.org/schema/beans/spring-beans.xsd;>



  

< bean class=
"org.apache.ignite.configuration.DataStorageConfiguration">

  

< list >

  < bean class=
"org.apache.ignite.configuration.DataRegionConfiguration">







  

  





  



  



  







Code snippet:



public class City

{

public int Id;

public string Name;



}



class Program

{



static void Main(string[] args)

{



var cfg = new IgniteConfiguration

{

DiscoverySpi = new TcpDiscoverySpi

{

IpFinder = new TcpDiscoveryStaticIpFinder

{

Endpoints = new[] { "xxx.xxx.xxx.xxx" }

}

},

ClientMode = true,

};

var ignite = Ignition.Start(cfg);



var cityCache = ignite.GetOrCreateCache(new
CacheConfiguration
{ Name = "City", DataRegionName = "DR0" });



//cityCache.Put(1, new City { Id = 1, Name = "TestCity0" });



foreach (var city in cityCache)

{

}



ignite.Dispose();

}

}

}


cache keys comparision

2018-04-25 Thread Som Som
hello,

how does ignite compare the keys of cache? for example c# dictionary key
object has two methods gethashcode and equals.


Re: continuous query - changes from local server only

2018-02-08 Thread Som Som
i've got both client and server nodes on each of 3 physical servers, that
is my cluster. there is a partitioned cache, each server node stores only a
part of keys. i start the application on my dev machine that app is also
client of the cluster further i put new key into the cluster. i would like
to see this change only in client which is located with server node which
stores this new key.

8 февр. 2018 г. 11:41 ДП пользователь "dkarachentsev" <
dkarachent...@gridgain.com> написал:

Hi,

You may fuse filter for that, for example:

ContinuousQuery qry = new ContinuousQuery<>();

fine al Set nodes = new
HashSet<>(client.cluster().forDataNodes("cache")
.forHost(client.cluster().localNode()).nodes());

qry.setRemoteFilterFactory(new
Factory>() {
@Override public CacheEntryEventFilter
create() {
return new CacheEntryEventFilter() {
@IgniteInstanceResource
private Ignite ignite;

@Override public boolean evaluate(
CacheEntryEvent event) throws CacheEntryListenerException {
// Server nodes on current host
return nodes.contains(ignite.cluster().localNode());
}
};
}
});

Thanks!
-Dmitry



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/


continuous query - changes from local server only

2018-02-07 Thread Som Som
hi.

I have a cache with cachemode = partitioned and 2 server nodes that share
parts of the cache data according to the affinity function. Then I run the
client node on one of the computers where the server node is located. How
to configure a continuous query on the client node to receive events only
from server nodes located on the same machine?