public class SlaveNodeSelector extends Object implements NodeSelectorStrategy
This NodeSelectorStrategy is a static configuration for the local
node to avoid processing any indexing operations locally.
It is assumed that some other node in the cluster will process it; which
node exactly is unknown, so messages are broadcasted to the group.
There is no guarantee of processing: if no master picks up the task, the index update operation is skipped. This can be mitigated by making sure at least one master is always online; if a persistent queue is needed it's better to use the JMS backend.
This implementation matches the jgroupsSlave configuration property.
| Constructor and Description |
|---|
SlaveNodeSelector() |
| Modifier and Type | Method and Description |
|---|---|
org.jgroups.Message |
createMessage(byte[] data)
Different message options can be applied using different constructors,
hence we delegate Message construction to the strategy.
|
boolean |
isIndexOwnerLocal()
Specifies if the current (local) node should apply
changes to the index.
|
void |
setLocalAddress(org.jgroups.Address address)
The implementation might need to know it's own address, so this
is provided at channel initial connection.
|
void |
viewAccepted(org.jgroups.View view)
Invoked by JGroups on view change.
|
public boolean isIndexOwnerLocal()
NodeSelectorStrategyisIndexOwnerLocal in interface NodeSelectorStrategypublic void setLocalAddress(org.jgroups.Address address)
NodeSelectorStrategysetLocalAddress in interface NodeSelectorStrategyaddress - the local addresspublic void viewAccepted(org.jgroups.View view)
NodeSelectorStrategyMembershipListener.viewAccepted(View)viewAccepted in interface NodeSelectorStrategyview - contains information on the current members of the cluster grouppublic org.jgroups.Message createMessage(byte[] data)
NodeSelectorStrategycreateMessage in interface NodeSelectorStrategydata - the information to be sent to the master.Copyright © 2006–2013 Hibernate. All rights reserved.