Distributed SQL joins affinity key configuration

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Distributed SQL joins affinity key configuration

Sergi
Guys,

I'm about to finish distributed SQL joins feature for Ignite and we need to
decide
what to do with configuration because currently I don't see how to change
it and
not to brake backward compatibility.

Currently we declare SQL schema for cache using indexedTypes with
annotations
or CacheTypeMetadata. Now we will need to specify affinity key field name
for every type.
By default if it is not specified we will assume that it is a *_KEY* field
which is actual
cache key at SQL layer.

I know about two ways to specify affinity keys in IgniteCache:

1. Using @AffinityKeyMapped to annotate fields or methods inside of cache
key class.

We could use it in SQL as is but there is a possible problem: if user did
not specify
@QuerySqlField annotation for that field. It may be was done intentionally
or
by mistake. The code which should start a distributed join for this case
must
throw exception as I understand.

2. Using custom AffinityKeyMapper which allows to extract affinity key from
key.

With it we can extract affinity key from cache key, but for SQL we need a
affinity field name. Probably we need additional method affinityKeyName() or
something like that but it will brake backward compatibility.

Thoughts?

Sergi
Reply | Threaded
Open this post in threaded view
|

Re: Distributed SQL joins affinity key configuration

dsetrakyan
I thought that there is a way to specify affinity keys in XML configuration
as well. Am I wrong?

On Mon, Oct 12, 2015 at 1:44 PM, Sergi Vladykin <[hidden email]>
wrote:

> Guys,
>
> I'm about to finish distributed SQL joins feature for Ignite and we need to
> decide
> what to do with configuration because currently I don't see how to change
> it and
> not to brake backward compatibility.
>
> Currently we declare SQL schema for cache using indexedTypes with
> annotations
> or CacheTypeMetadata. Now we will need to specify affinity key field name
> for every type.
> By default if it is not specified we will assume that it is a *_KEY* field
> which is actual
> cache key at SQL layer.
>
> I know about two ways to specify affinity keys in IgniteCache:
>
> 1. Using @AffinityKeyMapped to annotate fields or methods inside of cache
> key class.
>
> We could use it in SQL as is but there is a possible problem: if user did
> not specify
> @QuerySqlField annotation for that field. It may be was done intentionally
> or
> by mistake. The code which should start a distributed join for this case
> must
> throw exception as I understand.
>
> 2. Using custom AffinityKeyMapper which allows to extract affinity key from
> key.
>
> With it we can extract affinity key from cache key, but for SQL we need a
> affinity field name. Probably we need additional method affinityKeyName()
> or
> something like that but it will brake backward compatibility.
>
> Thoughts?
>
> Sergi
>