You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by bluehu <hu...@gmail.com> on 2015/12/03 03:08:07 UTC

We want to add an "dynamic create index" interface to ignite replacing index annotation, do you have any suggestions?




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/We-want-to-add-an-dynamic-create-index-interface-to-ignite-replacing-index-annotation-do-you-have-an-tp2122.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: We want to add an "dynamic create index" interface to ignite replacing index annotation, do you have any suggestions?

Posted by Dmitriy Setrakyan <ds...@apache.org>.
Sergi,

Have you had a chance to come up with the design suggestions?

D.

On Sun, Dec 6, 2015 at 11:04 PM, Sergi Vladykin <se...@gmail.com>
wrote:

> Hi,
>
> ALTER TABLE ADD COLUMN will not work because it copies the whole table
> with new column in H2.
>
> I think you are right, we need to modify GridH2Table in place, though we
> need to make sure that
> dynamic indexes will be consistent with other existing indexes and no
> concurrent updates are lost.
>
> There are multiple ways to notify other nodes, I think I will come up with
> design soon.
>
> Sergi
>
>
> 2015-12-04 5:29 GMT+03:00 bluehu <hu...@gmail.com>:
>
>> This ticket meets our requirement, I am trying to add “addIndex”
>> interface in
>> IgniteCache(IgniteCacheProxy) as you said.
>>
>> I have studied the code on ignite index, including these classes:
>> QueryProcessor, IgniteH2Indexing, GridH2Table, GridH2TreeIndex,
>> TypeDescriptor, TableDescriptor, RowDescriptor, IndexDescriptor, etc..
>>
>> I had wanted to use SQL on h2database like "ALTER TABLE ADD [column]..."
>> to
>> add a new column and it's index to GridH2Table, but I found "ALTER
>> TABLE..."
>> can not specify engine like this "engine
>> "org.apache.ignite.internal.processors.query.h2.opt.GridH2Table$Engine"",
>> so
>> I give up this way.
>>
>> Now I trying to modify the object of GridH2Table directly through
>> QueryProcessor and IgniteH2Indexing, including GridH2Table's member:
>> Column,
>> RowDescriptor and GridH2TreeIndex.
>> the stack like this:
>> <
>> http://apache-ignite-users.70518.x6.nabble.com/file/n2138/QQ%E6%88%AA%E5%9B%BE20151204102451.png
>> >
>>
>>
>> I have two questions at present:
>> 1.Is my thinking the right direction?
>> 2.How can I notify other ignite node to add index?
>>
>>
>>
>> --
>> View this message in context:
>> http://apache-ignite-users.70518.x6.nabble.com/We-want-to-add-an-dynamic-create-index-interface-to-ignite-replacing-index-annotation-do-you-have-an-tp2122p2138.html
>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>>
>
>

Re: We want to add an "dynamic create index" interface to ignite replacing index annotation, do you have any suggestions?

Posted by Sergi Vladykin <se...@gmail.com>.
Hi,

ALTER TABLE ADD COLUMN will not work because it copies the whole table with
new column in H2.

I think you are right, we need to modify GridH2Table in place, though we
need to make sure that
dynamic indexes will be consistent with other existing indexes and no
concurrent updates are lost.

There are multiple ways to notify other nodes, I think I will come up with
design soon.

Sergi


2015-12-04 5:29 GMT+03:00 bluehu <hu...@gmail.com>:

> This ticket meets our requirement, I am trying to add “addIndex” interface
> in
> IgniteCache(IgniteCacheProxy) as you said.
>
> I have studied the code on ignite index, including these classes:
> QueryProcessor, IgniteH2Indexing, GridH2Table, GridH2TreeIndex,
> TypeDescriptor, TableDescriptor, RowDescriptor, IndexDescriptor, etc..
>
> I had wanted to use SQL on h2database like "ALTER TABLE ADD [column]..." to
> add a new column and it's index to GridH2Table, but I found "ALTER
> TABLE..."
> can not specify engine like this "engine
> "org.apache.ignite.internal.processors.query.h2.opt.GridH2Table$Engine"",
> so
> I give up this way.
>
> Now I trying to modify the object of GridH2Table directly through
> QueryProcessor and IgniteH2Indexing, including GridH2Table's member:
> Column,
> RowDescriptor and GridH2TreeIndex.
> the stack like this:
> <
> http://apache-ignite-users.70518.x6.nabble.com/file/n2138/QQ%E6%88%AA%E5%9B%BE20151204102451.png
> >
>
>
> I have two questions at present:
> 1.Is my thinking the right direction?
> 2.How can I notify other ignite node to add index?
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/We-want-to-add-an-dynamic-create-index-interface-to-ignite-replacing-index-annotation-do-you-have-an-tp2122p2138.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>

Re: We want to add an "dynamic create index" interface to ignite replacing index annotation, do you have any suggestions?

Posted by bluehu <hu...@gmail.com>.
This ticket meets our requirement, I am trying to add “addIndex” interface in
IgniteCache(IgniteCacheProxy) as you said.

I have studied the code on ignite index, including these classes:
QueryProcessor, IgniteH2Indexing, GridH2Table, GridH2TreeIndex,
TypeDescriptor, TableDescriptor, RowDescriptor, IndexDescriptor, etc..

I had wanted to use SQL on h2database like "ALTER TABLE ADD [column]..." to
add a new column and it's index to GridH2Table, but I found "ALTER TABLE..."
can not specify engine like this "engine
"org.apache.ignite.internal.processors.query.h2.opt.GridH2Table$Engine"", so
I give up this way.

Now I trying to modify the object of GridH2Table directly through
QueryProcessor and IgniteH2Indexing, including GridH2Table's member: Column,
RowDescriptor and GridH2TreeIndex.
the stack like this:
<http://apache-ignite-users.70518.x6.nabble.com/file/n2138/QQ%E6%88%AA%E5%9B%BE20151204102451.png> 


I have two questions at present:
1.Is my thinking the right direction?
2.How can I notify other ignite node to add index?



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/We-want-to-add-an-dynamic-create-index-interface-to-ignite-replacing-index-annotation-do-you-have-an-tp2122p2138.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: We want to add an "dynamic create index" interface to ignite replacing index annotation, do you have any suggestions?

Posted by Dmitriy Setrakyan <ds...@apache.org>.
Looks like we already have a ticket for it, but no one started on it yet:
https://issues.apache.org/jira/browse/IGNITE-735

Feel free to pick it up. We should start from proposing the API first,
something like IgniteCache.addIndex(…). Once we agree on the API, we can
start discussing the implementation details.

Sounds good?

D.

On Wed, Dec 2, 2015 at 6:08 PM, bluehu <hu...@gmail.com> wrote:

>
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/We-want-to-add-an-dynamic-create-index-interface-to-ignite-replacing-index-annotation-do-you-have-an-tp2122.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>