ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitriy Setrakyan <dsetrak...@apache.org>
Subject Re: Re: Re: Using different SQL to load cache every time?
Date Mon, 26 Oct 2015 11:50:48 GMT
On Sun, Oct 25, 2015 at 6:17 PM, Edison <xeseo@163.com> wrote:

> It's pretty simple. In the top API, they'll call method like read(String
> sql, List<Object> parameters), then I'll use Ignite to read from the cache
> or db(if not hit).
>

Hm… not sure how you can know if SQL is a hit or a miss. What if you only
have a partial state in memory and the rest on disk? Is this possible?


> The thing is, every time the sql provide could be different.
> So how could I make a CacheStore to accept different sql dynamically?
>
Or, in which context should I save the sql so that I can pick it out in
> CacheStore?
>

The only method in CacheStore which can work with free-form SQL is
loadCache() method. Please see the javadoc here:
http://s.apache.org/loadCache


>
>
>
> At 2015-10-24 07:59:14, "Dmitriy Setrakyan" <dsetrakyan@apache.org> wrote:
>
> I don’t think I understand the use case. Can you please explain the
> sequence of API calls you plan to make and the desired effect?
>
> On Fri, Oct 23, 2015 at 2:32 AM, Edison <xeseo@163.com> wrote:
>
>>
>> Actually, I'm trying to implement SQL ACID function.
>> For the top user, they only need to provide the table and sql.
>> Then, in a common interface, I'll make the the adapter to accept the sql
>> and do the real ACID operation on the cache as well as database.
>> Thus, the sql to run from the top user could be different every time.
>>
>>
>> At 2015-10-23 15:57:51, "Dmitriy Setrakyan" <dsetrakyan@apache.org>
>> wrote:
>>
>> I am a bit confused with the question. In the subject it says “load
>> cache”, but in the body it says “query cache”.
>>
>> If the question is about “loading cache", then, as Sergi suggested, you
>> need to implement your own CacheStore. You can take any of the cache stores
>> already provided and adapt them for your needs. More on CacheStore here:
>> https://apacheignite.readme.io/docs/persistent-store
>>
>> If the question is about “querying cache” in memory, then you can create
>> SQL queries dynamically on the fly and execute them over Ignite data grid.
>> More on SQL here: https://apacheignite.readme.io/docs/sql-queries
>>
>> D.
>>
>> On Thu, Oct 22, 2015 at 11:40 PM, Edison <xeseo@163.com> wrote:
>>
>>> Hi,
>>>
>>> Instead of given the SQL in EntryMapping, is it possible to use dynamic
>>> SQL to query the cache every time?
>>> If yes, how?
>>>
>>> Thanks,
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>>
>
>
>
>
>

Mime
View raw message