Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question
0

polling container using base class as template?

Hi, I have 3 classes all having the same superclass. I need to define a polling container to poll objects from all 3 classes keeping FIFO order between all objects from those classes. I tried to define 3 polling containers with 3 different templates but the FIFO is preserved only for each particular class. I tried to define a single container using the base class as template but this way nothing is polled. Is there anything to do to preserve FIFO order between children of base class in a polling container? Thanks

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=3011]{quote}

asked 2009-04-14 08:51:58 -0600

lukeh gravatar image

updated 2013-08-08 09:52:00 -0600

jaissefsfex gravatar image
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

FIFO take is preserved at the class level.
There is no FIFO support across multiple different classes even when these are sub classes of the same base class.
You should merge these into a single class or use a separate class to be used as the "queue". The business logic that writes the existing data object should write an extra "queue" object that will have the ID and class name of the relevant data space object. This how the polling container will be able to access the relevant data object after the "queue" object was consumed from the space.

Shay

answered 2009-04-14 10:11:03 -0600

shay hassidim gravatar image
edit flag offensive delete link more

Comments

Thanks Shay, Before seeing your answer I made a wrapper object around my base class (and also had to made the base class serializable). I used the wrapper as template for the polling container and it seems to work the way I want it. I hope that I was not mislead by running the test a few times and the FIFO was just a coincidence, but I don't see a reason to suspect that. I understand your solution with the "queue object". My next questions would be if you see a problem with my solution and which of those solutions, the wrapper or the queue object (or another one?), do you think is more efficient, adds less overhead (time to process). Thanks, Lucian

PS: is there any plan to support in future versions FIFO between related classes like I described it without having to use any solution like those?

Edited by: Lucian Hada on Apr 15, 2009 2:58 AM

lukeh gravatar imagelukeh ( 2009-04-15 02:56:56 -0600 )edit

The wrapper and queue object approach are very similar. With the wrapper you simply embed the data object into the queue object. It is up to you based on your application space class data model which approach to use.
Shay

shay hassidim gravatar imageshay hassidim ( 2009-04-15 03:03:03 -0600 )edit

Thanks, I was just thinking that using the queue object I have to make an extra read from the space. But then I was thinking that GigaSpace may do an extra reading internally to deal with the embedded class.

lukeh gravatar imagelukeh ( 2009-04-15 03:20:14 -0600 )edit

I would go with my solution but I have a problem with the GS Management GUI. I would like somehow to browse the wrapped objects. I just have the wrappers displayed and I receive an exception about deserialization when I want to query on the wrapper. Am I missing something? Is there no way to browse POJOs embaded in other POJOs in the GS Management GUI? Thanks

lukeh gravatar imagelukeh ( 2009-04-15 07:32:35 -0600 )edit

In general the UI should load the missing classes automatically. If this does not work for you simply add the embedded classes to the GS UI classpath by editing the gs-ui script. Shay

shay hassidim gravatar imageshay hassidim ( 2009-04-15 08:36:48 -0600 )edit
0

I still have a question related to this

answered 2009-04-15 07:33:22 -0600

lukeh gravatar image
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2009-04-14 08:51:58 -0600

Seen: 60 times

Last updated: Apr 15 '09