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

Ask Your Question

Whole cluster operations

In the same application (pu.xml conf) it´s possible to "read multiple" in the whole cluster (clustered=true), and later to "read multiple" with a particular partition(clustered=false)?


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

asked 2008-07-31 18:39:26 -0600

nullcipher2 gravatar image

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

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

If u have (clustered=true) and your routing field have a value the readMultiple will be directed to a specific partition.

(clustered=true) with null as the routing field will delegate the query to all partitions.


answered 2008-08-01 01:16:25 -0600

shay hassidim gravatar image
edit flag offensive delete link more


Yes, I understand it, my case is as follows:

  1. I have a runtime pu that defines a polling container
  2. The runtime pu is partitioned into N partitions
  3. Each read multiple operation in the polling container must read only the objects that lives in the partition is processing the polling container
  4. The space is clustered=true

What routing field value must be assign to read from the polling container to the specific partition is processing it?

... @SpaceDataEvent public Data objProcessed(Data obj, GigaSpace space) { ... MyClazz myClazz = new MyClazz(); myClazz.process(); ... }

public class MyClazz { ... private GigaSpace spaceC;

public void process() { MyObj obj = new MyObj(); obj.setRoutingField(...);//???? Which partition is processing the polling container????? ... spaceC.readMultiple(obj...); .... }


nullcipher2 gravatar image nullcipher2  ( 2008-08-01 08:16:01 -0600 )edit

If u want the polling container to read only from its collocated space it should use clustered = false. This option is not relevant when using remote space.

In this case the routing field value is used only for matching. It means that even if its value is null - only the collocated space will be queried.


shay hassidim gravatar image shay hassidim  ( 2008-08-01 09:41:19 -0600 )edit

OK Shay, the problem is that sometime I need the polling container read only from it collocated space, and sometimes from the whole cluster. I can do that dinamically? i.e: gigaSpace = new GigaSpaceConfigurer(gigaSpace.getSpace()).clustered(clustered).gigaSpace();

nullcipher2 gravatar image nullcipher2  ( 2008-08-01 09:51:24 -0600 )edit

Yes. Have 2 proxies/containers. One for local calls and one for distributed remote calls.


shay hassidim gravatar image shay hassidim  ( 2008-08-01 10:16:49 -0600 )edit

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


Asked: 2008-07-31 18:39:26 -0600

Seen: 108 times

Last updated: Aug 01 '08