You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by William Kemper <do...@gmail.com> on 2015/06/25 00:17:07 UTC

What is the Ignite equivalent of GridCacheProjection?

In the GridGain API one could use a GridCacheProjection (
http://doc.gridgain.org/latest/GridCacheProjection) to create a kind of
'view' of a cache. I don't see equivalent functionality in Ignite. I see
that CacheInterceptor may be configured for a cache, but it does not seem
to provide a 'view' into an existing cache in the same way a
GridCacheProjection could.

Re: What is the Ignite equivalent of GridCacheProjection?

Posted by vkulichenko <va...@gmail.com>.
William,

There is no exact equivalent of GridCacheProjection in Ignite, but it
provides an ability to create and destroy caches on the fly. So instead of
creating a view on a bigger cache, you can create a separate cache for some
subset of data.

Can you describe your use case in more details so that we can suggest
correct solution?

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/What-is-the-Ignite-equivalent-of-GridCacheProjection-tp577p578.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: What is the Ignite equivalent of GridCacheProjection?

Posted by Valentin Kulichenko <va...@gmail.com>.
William,

You don't need a projection for you use case - just create a separate cache
for each user. You can use Ignite.getOrCreateCache() method for this. This
will give you the same functionality, but won't require any additional code
to support multiple users (like having user ID in model classes and
implementing projection filters). It will also be more performant in some
cases. E.g., iterations are much faster, because you iterate through the
data for particular user only instead of going through all entries applying
the filter to each of them.

-Val

On Wed, Jun 24, 2015 at 8:43 PM, William Kemper <do...@gmail.com> wrote:

> We weren't using the type projection. We were using a predicate to
> implement access control logic in a multiuser application. It was nice
> because it worked for all the methods in the cache API (including queries)
> and because gridgain would do all the heavy lifting for us. Is the feature
> on the roadmap?
>
> On Wed, Jun 24, 2015 at 6:24 PM, dsetrakyan <ds...@apache.org> wrote:
>
>> William Kemper wrote
>> > In the GridGain API one could use a GridCacheProjection (
>> > http://doc.gridgain.org/latest/GridCacheProjection) to create a kind of
>> > 'view' of a cache. I don't see equivalent functionality in Ignite. I see
>> > that CacheInterceptor may be configured for a cache, but it does not
>> seem
>> > to provide a 'view' into an existing cache in the same way a
>> > GridCacheProjection could.
>>
>> One of the main reasons GridCacheProjection existed was because in
>> GridGain
>> you could not transact across  different caches. Therefore, users were
>> forced to put different types of data into the same cache and then create
>> GridCacheProjections to have different views on the same cache.
>>
>> In Ignite you can transact and query across multiple caches, so there is
>> no
>> real need for a GridCacheProjection, since you can simply put different
>> types of data into different caches.
>>
>>
>>
>> -----
>> D.
>> --
>> View this message in context:
>> http://apache-ignite-users.70518.x6.nabble.com/What-is-the-Ignite-equivalent-of-GridCacheProjection-tp577p579.html
>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>>
>
>

Re: What is the Ignite equivalent of GridCacheProjection?

Posted by William Kemper <do...@gmail.com>.
We weren't using the type projection. We were using a predicate to
implement access control logic in a multiuser application. It was nice
because it worked for all the methods in the cache API (including queries)
and because gridgain would do all the heavy lifting for us. Is the feature
on the roadmap?

On Wed, Jun 24, 2015 at 6:24 PM, dsetrakyan <ds...@apache.org> wrote:

> William Kemper wrote
> > In the GridGain API one could use a GridCacheProjection (
> > http://doc.gridgain.org/latest/GridCacheProjection) to create a kind of
> > 'view' of a cache. I don't see equivalent functionality in Ignite. I see
> > that CacheInterceptor may be configured for a cache, but it does not seem
> > to provide a 'view' into an existing cache in the same way a
> > GridCacheProjection could.
>
> One of the main reasons GridCacheProjection existed was because in GridGain
> you could not transact across  different caches. Therefore, users were
> forced to put different types of data into the same cache and then create
> GridCacheProjections to have different views on the same cache.
>
> In Ignite you can transact and query across multiple caches, so there is no
> real need for a GridCacheProjection, since you can simply put different
> types of data into different caches.
>
>
>
> -----
> D.
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/What-is-the-Ignite-equivalent-of-GridCacheProjection-tp577p579.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>

Re: What is the Ignite equivalent of GridCacheProjection?

Posted by dsetrakyan <ds...@apache.org>.
William Kemper wrote
> In the GridGain API one could use a GridCacheProjection (
> http://doc.gridgain.org/latest/GridCacheProjection) to create a kind of
> 'view' of a cache. I don't see equivalent functionality in Ignite. I see
> that CacheInterceptor may be configured for a cache, but it does not seem
> to provide a 'view' into an existing cache in the same way a
> GridCacheProjection could.

One of the main reasons GridCacheProjection existed was because in GridGain
you could not transact across  different caches. Therefore, users were
forced to put different types of data into the same cache and then create
GridCacheProjections to have different views on the same cache.

In Ignite you can transact and query across multiple caches, so there is no
real need for a GridCacheProjection, since you can simply put different
types of data into different caches.



-----
D.
--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/What-is-the-Ignite-equivalent-of-GridCacheProjection-tp577p579.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.