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

Ask Your Question
0

Discovering if Workers are Available

With regards to the Master-Worker pattern, is there a generic solution to discover if (and how many) workers are available to process Tasks? With the GigaSpace API, I can both discover if the space is running and record a variety of admin statistics, but I would also like to detemine if workers have been started before submitting tasks to the space.

Thanks in advance.

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

asked 2007-05-12 12:48:01 -0500

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

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

When having the workers running within the spaces (IWorkers implementation that is the preferred architecture which provide the best performance , latency and scalability) ? there is no need to determine if worker is available. If the space exists the worker exists.
See:
http://www.gigaspaces.com/wiki/display/GS/SpaceWorker-SpaceSchema

When workers running out-side the space in a separate VM , you may use the lease mechanism to determine the existence of the workers.
See example:
\GigaSpacesEE5.2\examples\Advanced\Compute_Grid\masterworker-simple
See how the command object lease renewed at the worker. This allows the master to count the amount of command objects within the space to send into the space more tasks per job. You can use the same mechanism to determine is a worker exists.
You may want to use the LeaseRenewalManager to maintain the worker lease in implicit manner:
See:
http://www.gigaspaces.com/wiki/display/GS/ManagingResourcesLease
http://www.gigaspaces.com/wiki/display/GS/SlowConsumer#SlowConsumer-Example

When workers deployed as Service Beans into the Service Grid ? you may use Service Events. See:
http://www.gigaspaces.com/wiki/display/GS/GridServiceEvents

Shay

answered 2007-05-12 13:27:02 -0500

shay hassidim gravatar image
edit flag offensive delete link more

Comments

Thanks for the quick response, Shay.

We probably do not want to run the workers in embedded mode since the tasks are intensive/expensive. That is, it makes more sense for us to share a common space with multiple workers where each worker is running on a separate machine.

As far as I can tell from the following post, we will not be restricted from doing this with the Community Edition, right?

http://www.gigaspaces.com/JForum/post...

That being said, I'll have a look at the links regarding the lease mechanism you sent.

kirandkeshav gravatar imagekirandkeshav ( 2007-05-12 13:52:01 -0500 )edit

There is no problem running workers on different machines when using the community edition. You can have workers running on separate machines accessing the space in remote mode on different machine when using the community edition.

You will not have high-availability for the space nor dynamic scalability for the space/workers or any central deployment and management tools as the enterprise edition provides. You will need to build all these yourself.

Shay

shay hassidim gravatar imageshay hassidim ( 2007-05-12 18:11:02 -0500 )edit

Great, thanks.

"Discovering workers" by the client works well with the master-worker example you provided in the Enterprise Edition.

Kind Regards,

Kiran

kirandkeshav gravatar imagekirandkeshav ( 2007-05-12 19:47:03 -0500 )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

Stats

Asked: 2007-05-12 12:48:01 -0500

Seen: 179 times

Last updated: May 12 '07