org.hibernate.search.backend.impl.jgroups
Class MasterNodeSelector

java.lang.Object
  extended by org.hibernate.search.backend.impl.jgroups.MasterNodeSelector
All Implemented Interfaces:
NodeSelectorStrategy

public class MasterNodeSelector
extends Object
implements NodeSelectorStrategy

This NodeSelectorStrategy is a static configuration for the local node to always process index operations locally, and accept index operations from remote nodes configured as slaves.

JGroups does not provide a persistent queue, if that level of reliability is needed, use the JMS backend.

This implementation matches the jgroupsMaster configuration property.

Author:
Sanne Grinovero (C) 2012 Red Hat Inc.

Constructor Summary
MasterNodeSelector()
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MasterNodeSelector

public MasterNodeSelector()
Method Detail

isIndexOwnerLocal

public boolean isIndexOwnerLocal()
Description copied from interface: NodeSelectorStrategy
Specifies if the current (local) node should apply changes to the index.

Specified by:
isIndexOwnerLocal in interface NodeSelectorStrategy
Returns:

setLocalAddress

public void setLocalAddress(org.jgroups.Address address)
Description copied from interface: NodeSelectorStrategy
The implementation might need to know it's own address, so this is provided at channel initial connection.

Specified by:
setLocalAddress in interface NodeSelectorStrategy
Parameters:
address - the local address

viewAccepted

public void viewAccepted(org.jgroups.View view)
Description copied from interface: NodeSelectorStrategy
Invoked by JGroups on view change. MembershipListener.viewAccepted(View)

Specified by:
viewAccepted in interface NodeSelectorStrategy
Parameters:
view - contains information on the current members of the cluster group

createMessage

public org.jgroups.Message createMessage(byte[] data)
Description copied from interface: NodeSelectorStrategy
Different message options can be applied using different constructors, hence we delegate Message construction to the strategy.

Specified by:
createMessage in interface NodeSelectorStrategy
Parameters:
data - the information to be sent to the master.
Returns:
the message to be sent.


Copyright © 2006-2012 Red Hat Middleware, LLC. All Rights Reserved