Hi Kamal,

Partitions in Cassandra are controlled by the partition key you selected.
Using Ignite-Cassandra module you have two options to specify Cassandra
partition key:

- Use POJO persistence strategy along with @AffinityKeyMapped annotation
for your key classes. In a such way all you partition key fields for
Cassandra table will be detected automatically.

- Use POJO persistence strategy and prepare Cassandra persistence
descriptor (
http://apacheignite.gridgain.org/docs/base-concepts#persistencesettingsbean)
where you can manually specify all your mappings to Cassandra including
partition key.

For more details you can look at the "base concepts" page
http://apacheignite.gridgain.org/docs/base-concepts and examples
http://apacheignite.gridgain.org/docs/examples

Just want to clarify once again - Cassandra partitions and Ignite
partitions are two absolutely different concepts. It doesn't make sense to
map Ignite partitions to the same set of Cassandra partitions - you'll just
have significant Cassandra performance degradation on large data sets.
Cassandra partitioning is all about evenly distributing data among the
cluster nodes. It's absolutely normal to have billions partitions in
Cassandra.


Igor Rudyak


On Fri, Jul 15, 2016 at 12:03 AM, Kamal C <kamaltar...@gmail.com> wrote:

> Val,
>
> I too have some concerns to use cassandra partitioned table. For initial
> version, I'm using PRIMITIVE / BLOB
> persistent strategy to store the key-value pair. Thanks for the support :)
>
> Igor,
>
> Still, I'm not clear. Cassandra and Ignite uses different partition
> strategy. Assume a Ignite Cache is configured
> to have 64 partitions and POJO persistent strategy is used in cassandra,
> Then,
>
> PersonKey key = new PersonKey(id, companyId); // companyId is mapped as
> affinity key.
>
> If the range of companyId is [1-10000]. I don't want to create that many
> partitions in the
> cassandra table.
>
>
> Regards,
> Kamal C
>
>
>
> On Fri, Jul 15, 2016 at 5:13 AM, Igor Rudyak <irud...@gmail.com> wrote:
>
>> Hi Kamal,
>>
>> Ignite Cassandra module takes into account AffinityFunction when
>> persisting values into Cassandra(
>> https://apacheignite.readme.io/docs/overview). Thus key/values having
>> the same Affinity and collocated on one Ignite node will be also collocated
>> on one node in Cassandra.
>>
>> Cassandra and Ignite partitions are two absolutely different animals, it
>> doesn't make sense to compare them. Just check that you are using
>> @AffinityKeyMapped annotation for your key classes. In a such way all
>> the values having same affinity will be persisted on the same Cassandra
>> node.
>>
>> Igor Rudyak
>>
>>
>> On Thu, Jul 14, 2016 at 4:12 PM, vkulichenko <
>> valentin.kuliche...@gmail.com> wrote:
>>
>>> Hi Kamal,
>>>
>>>
>>> Kamal wrote
>>> > 1. In Ignite partitioned cache, number of partitions can be configured
>>> >    using AffinityFunction. How to configure the same for the
>>> >    Cassandra table ?
>>> >
>>> > 2. Will the partitioner used by Cassandra (MurMur3) and the Ignite
>>> >     returns the same partition number for a cache key ?
>>>
>>> Ignite and Cassandra use completely different partitioning strategy and I
>>> don't think it will be an easy task to collocate them. But from my
>>> experience, it's actually better not to do this, but have Cassandra and
>>> Ignite on separate physical servers and scale them separately. Most
>>> likely
>>> you will need different number of nodes for Ignite and Cassandra to fit
>>> your
>>> performance requirements.
>>>
>>>
>>> Kamal wrote
>>> > 3. Say a cache is configured to hold 2 lakh elements in memory
>>> >     and rest of them in cassandra. If the cache contains more than
>>> >     2 lakh elements, Then,
>>> >
>>> > a. Calling cache.size() method returns count as 2 lakh
>>> > b. Using cache.iterator() able to iterate only the elements available
>>> >     in the memory
>>> > c. With cache.removeAll() able to delete the entries in cassandra
>>> >     that are available in the memory.
>>>
>>> Answer on all the three questions is YES.
>>>
>>>
>>> Kamal wrote
>>> > How to get the total size of a cache ? (memory + cassandra)
>>>
>>> Data which is evicted from Ignite is not in cache anymore. You have to
>>> use
>>> Cassandra APIs to get the number entries in its storage.
>>>
>>> -Val
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://apache-ignite-users.70518.x6.nabble.com/Cassandra-Cache-Store-Example-tp6206p6315.html
>>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>>>
>>
>>
>

Reply via email to