Re: Can not create Affinity Key

2018-04-18 Thread Fff
Ilya, Thanks a lot for your help.  



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


Can not create Affinity Key

2018-03-14 Thread Fff
Hi,

I have a problem to create proper Affinity Key. I have numerous events per
visitor in my cache, so my goal is to set VisitorId to be my affinity key,
which is defined as composite key in the VisitorKey class and later on pass
to the cacheConfiguration as cache Key.
Cache is created, however cache key is empty and when I try to insert via
JDBC it tells me that key is missing. I will appreciate any help.


public class VisitorKey {

private final UUID eventId;
@AffinityKeyMapped
private final UUID visitorId;

public VisitorKey(UUID eventId, UUID visitorId) {
this.eventId = eventId;
this.visitorId = visitorId;
}

public UUID getEventId() {
return eventId;
}

public UUID getvisitorId() {
return visitorId;
}

}

public class Test {

@QuerySqlField
private UUID eventId;
@QuerySqlField(index = true)
private UUID visitorId;
private transient VisitorKey key;

public Test(UUID eventId, UUID visitorId) {
this.eventId = eventId;
this.visitorId = visitorId;

}

public VisitorKey getKey() {
if (key == null) {
key = new VisitorKey(eventId, visitorId);
}
return key;
}

public UUID getEventId() {
return eventId;
}

public UUID getvisitorId() {
return visitorId;
}


Ignition.ignite().getOrCreateCache(getCacheConfigurationTest())

private CacheConfiguration getCacheConfigurationTest() {
CacheConfiguration cacheConfig = new
CacheConfiguration<>("test");   
cacheConfig.setCacheMode(CacheMode.PARTITIONED);
cacheConfig.setAtomicityMode(CacheAtomicityMode.ATOMIC);
cacheConfig.setSqlSchema(PUBLIC);
cacheConfig.setBackups(BACKUP_FACTOR);
cacheConfig.setAffinity(new RendezvousAffinityFunction(false,
PARTITIONS_FACTOR));
return cacheConfig;
}





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


Re: sql insert with composite primary key

2017-11-29 Thread Fff
HI,
Thanks for your help!
We define it using QueryEntity by providing 'keyFields' property:




triggerId
biEventId

  



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