ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Mashenkov (JIRA)" <j...@apache.org>
Subject [jira] [Created] (IGNITE-6280) Cassandra ignores AffinityKeyMapped annotation in parent classes.
Date Wed, 06 Sep 2017 13:03:00 GMT
Andrew Mashenkov created IGNITE-6280:

             Summary: Cassandra ignores AffinityKeyMapped annotation in parent classes.
                 Key: IGNITE-6280
                 URL: https://issues.apache.org/jira/browse/IGNITE-6280
             Project: Ignite
          Issue Type: Bug
          Components: cassandra
    Affects Versions: 2.1
            Reporter: Andrew Mashenkov

By default, using @AffinityKeyMapped annotation force Ignire to override user _keyPersistence_
configuration that may cause confusing results.

PFA repro attached.

h3. Description
1. Let there is 2 keys A and B that has same fields with one difference. Key A has affinity
key in parent class. So, it looks like this.

class BaseKey {
 Object affinityKey

class A extends BaseKey {
 int id;

class B {
 Object affinityKey;

 int uid;

2. Let we make different affinity mapping for Cassandra store, that looks like a valid case
<keyPersistence class="..."  strategy="POJO">
         <field name="affinityKey" column="partID"/>
         <field name="uid" column="uid"/>

3. We have different behavior for these similar cases that makes user confused.
For key A this will work fine and expected DDL will be generated.
For key B we'll get different DDL as Ignite will remove "_uid_" field from "_partitionKey_".

So, we should either to not allow Ignite to override key mapping or force Ignite to check
if parent classes has @AffinityKeyMapped annotation.

This message was sent by Atlassian JIRA

View raw message