[infinispan-dev] Externalizer and Commands ID ranges

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

[infinispan-dev] Externalizer and Commands ID ranges

Sanne Grinovero-3
Hi all,
I've just updated the table at the bottom of
https://docs.jboss.org/author/display/ISPN/Plugging+Infinispan+With+User+Defined+Externalizers

to reserve a range for usage of custom externalizers in Hibernate Search.

I'm also going to need custom commands; do we need to similarly
reserve ranges for Command IDs ?

Sanne
_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] Externalizer and Commands ID ranges

Galder Zamarreno

On Sep 8, 2011, at 2:05 AM, Sanne Grinovero wrote:

> Hi all,
> I've just updated the table at the bottom of
> https://docs.jboss.org/author/display/ISPN/Plugging+Infinispan+With+User+Defined+Externalizers
>
> to reserve a range for usage of custom externalizers in Hibernate Search.
>
> I'm also going to need custom commands; do we need to similarly
> reserve ranges for Command IDs ?

We should have. It should be documented in https://docs.jboss.org/author/display/ISPN/Writing+custom+commands+in+Infinispan

>
> Sanne
> _______________________________________________
> infinispan-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] Externalizer and Commands ID ranges

Sanne Grinovero-3
I've added a new table as suggested by Galder, and sent a pull request
to constrain Query in the range I just defined [1]

For this case we only have a single byte to share across all commands.
Is it reasonable to reserve 100 values for Infinispan core, and blocks
of 20 for needing modules?

1 - https://github.com/infinispan/infinispan/pull/526

Sanne

On 12 September 2011 12:48, Galder Zamarreño <[hidden email]> wrote:

>
> On Sep 8, 2011, at 2:05 AM, Sanne Grinovero wrote:
>
>> Hi all,
>> I've just updated the table at the bottom of
>> https://docs.jboss.org/author/display/ISPN/Plugging+Infinispan+With+User+Defined+Externalizers
>>
>> to reserve a range for usage of custom externalizers in Hibernate Search.
>>
>> I'm also going to need custom commands; do we need to similarly
>> reserve ranges for Command IDs ?
>
> We should have. It should be documented in https://docs.jboss.org/author/display/ISPN/Writing+custom+commands+in+Infinispan
>
>>
>> Sanne
>> _______________________________________________
>> infinispan-dev mailing list
>> [hidden email]
>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>
> --
> Galder Zamarreño
> Sr. Software Engineer
> Infinispan, JBoss Cache
>
>
> _______________________________________________
> infinispan-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>

_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] Externalizer and Commands ID ranges

Galder Zamarreno

On Sep 12, 2011, at 1:32 PM, Sanne Grinovero wrote:

> I've added a new table as suggested by Galder, and sent a pull request
> to constrain Query in the range I just defined [1]
>
> For this case we only have a single byte to share across all commands.
> Is it reasonable to reserve 100 values for Infinispan core, and blocks
> of 20 for needing modules?
>
> 1 - https://github.com/infinispan/infinispan/pull/526

No need to reserve for Infinispan core cos that's indexed differently to the externally provided commands. Same thing happens for externally defined Externalizers.

What you need to be worrying about is that you're not using same ids as other external commands.

Blocks of 20 sounds good for commands/modules.

>
> Sanne
>
> On 12 September 2011 12:48, Galder Zamarreño <[hidden email]> wrote:
>>
>> On Sep 8, 2011, at 2:05 AM, Sanne Grinovero wrote:
>>
>>> Hi all,
>>> I've just updated the table at the bottom of
>>> https://docs.jboss.org/author/display/ISPN/Plugging+Infinispan+With+User+Defined+Externalizers
>>>
>>> to reserve a range for usage of custom externalizers in Hibernate Search.
>>>
>>> I'm also going to need custom commands; do we need to similarly
>>> reserve ranges for Command IDs ?
>>
>> We should have. It should be documented in https://docs.jboss.org/author/display/ISPN/Writing+custom+commands+in+Infinispan
>>
>>>
>>> Sanne
>>> _______________________________________________
>>> infinispan-dev mailing list
>>> [hidden email]
>>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>>
>> --
>> Galder Zamarreño
>> Sr. Software Engineer
>> Infinispan, JBoss Cache
>>
>>
>> _______________________________________________
>> infinispan-dev mailing list
>> [hidden email]
>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>>
>
> _______________________________________________
> infinispan-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] Externalizer and Commands ID ranges

Sanne Grinovero-3
On 13 September 2011 11:25, Galder Zamarreño <[hidden email]> wrote:

>
> On Sep 12, 2011, at 1:32 PM, Sanne Grinovero wrote:
>
>> I've added a new table as suggested by Galder, and sent a pull request
>> to constrain Query in the range I just defined [1]
>>
>> For this case we only have a single byte to share across all commands.
>> Is it reasonable to reserve 100 values for Infinispan core, and blocks
>> of 20 for needing modules?
>>
>> 1 - https://github.com/infinispan/infinispan/pull/526
>
> No need to reserve for Infinispan core cos that's indexed differently to the externally provided commands. Same thing happens for externally defined Externalizers.

That would be nice, but it's not the case currently: If I change the
org.infinispan.query.ModuleCommandIds.CLUSTERED_QUERY from 101 to 12
the test org.infinispan.query.blackbox.ClusteredQueryTest
is going to throw several exceptions with the following stacktrace:

Caused by: java.lang.ClassCastException:
org.infinispan.query.clustered.ClusteredQueryCommand cannot be cast to
org.infinispan.commands.tx.PrepareCommand
        at org.infinispan.commands.CommandsFactoryImpl.initializeReplicableCommand(CommandsFactoryImpl.java:277)
        at org.infinispan.remoting.InboundInvocationHandlerImpl.handleInternal(InboundInvocationHandlerImpl.java:180)
        at org.infinispan.remoting.InboundInvocationHandlerImpl.handleWithWaitForBlocks(InboundInvocationHandlerImpl.java:199)
        at org.infinispan.remoting.InboundInvocationHandlerImpl.handleWithRetry(InboundInvocationHandlerImpl.java:319)
        at org.infinispan.remoting.InboundInvocationHandlerImpl.handle(InboundInvocationHandlerImpl.java:171)
        at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.executeCommand(CommandAwareRpcDispatcher.java:165)
        at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.handle(CommandAwareRpcDispatcher.java:144)
        ... 22 more

Do I have to open a JIRA to change this or are we going to keep the
first 100 reserved for core?

Sanne

_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] Externalizer and Commands ID ranges

Galder Zamarreno


On Sep 13, 2011, at 12:24 PM, Sanne Grinovero wrote:

> On 13 September 2011 11:25, Galder Zamarreño <[hidden email]> wrote:
>>
>> On Sep 12, 2011, at 1:32 PM, Sanne Grinovero wrote:
>>
>>> I've added a new table as suggested by Galder, and sent a pull request
>>> to constrain Query in the range I just defined [1]
>>>
>>> For this case we only have a single byte to share across all commands.
>>> Is it reasonable to reserve 100 values for Infinispan core, and blocks
>>> of 20 for needing modules?
>>>
>>> 1 - https://github.com/infinispan/infinispan/pull/526
>>
>> No need to reserve for Infinispan core cos that's indexed differently to the externally provided commands. Same thing happens for externally defined Externalizers.
>
> That would be nice, but it's not the case currently: If I change the
> org.infinispan.query.ModuleCommandIds.CLUSTERED_QUERY from 101 to 12
> the test org.infinispan.query.blackbox.ClusteredQueryTest
> is going to throw several exceptions with the following stacktrace:
>
> Caused by: java.lang.ClassCastException:
> org.infinispan.query.clustered.ClusteredQueryCommand cannot be cast to
> org.infinispan.commands.tx.PrepareCommand
> at org.infinispan.commands.CommandsFactoryImpl.initializeReplicableCommand(CommandsFactoryImpl.java:277)
> at org.infinispan.remoting.InboundInvocationHandlerImpl.handleInternal(InboundInvocationHandlerImpl.java:180)
> at org.infinispan.remoting.InboundInvocationHandlerImpl.handleWithWaitForBlocks(InboundInvocationHandlerImpl.java:199)
> at org.infinispan.remoting.InboundInvocationHandlerImpl.handleWithRetry(InboundInvocationHandlerImpl.java:319)
> at org.infinispan.remoting.InboundInvocationHandlerImpl.handle(InboundInvocationHandlerImpl.java:171)
> at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.executeCommand(CommandAwareRpcDispatcher.java:165)
> at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.handle(CommandAwareRpcDispatcher.java:144)
> ... 22 more
>
> Do I have to open a JIRA to change this or are we going to keep the
> first 100 reserved for core?

Hmmm, I think a new JIRA is needed here, cos at first glance, it means that https://issues.jboss.org/browse/ISPN-1162 is not fully resolved.

We should not wait until execution to discover this. Given that we already check for dups for internal cmds, and ModuleProperties checks for externally provided ones, I decided to keep both worlds separate. So, the testcase you show above should work.

>
> Sanne
>
> _______________________________________________
> infinispan-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev