org.hibernate.search.backend.jgroups.impl

## Interface NodeSelectorStrategy

- All Known Implementing Classes:
    AutoNodeSelector, MasterNodeSelector, SlaveNodeSelector

      public interface NodeSelectorStrategy

  A NodeSelectorStrategy represents the strategy by which a node out of the JGroups cluster is selected to apply changes to the Lucene index. All index update operations are forwarded to the current master node, the purpose of implementors is to define where messages have to be sent to, or if they have to be applied by the current (local) node. A different NodeSelectorStrategy can be chosen for each index.
  Author:
    Sanne Grinovero (C) 2012 Red Hat Inc.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `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(Address address)` The implementation might need to know it's own address, so this is provided at channel initial connection.
    `void` | `viewAccepted(View view)` Invoked by JGroups on view change.

- - ### Method Detail

    - #### isIndexOwnerLocal

          boolean isIndexOwnerLocal()

      Specifies if the current (local) node should apply changes to the index.
      Returns:
        true if the local node is the owner

    - #### setLocalAddress

          void setLocalAddress(Address address)

      The implementation might need to know it's own address, so this is provided at channel initial connection.
      Parameters:
        `address` - the local address

    - #### viewAccepted

          void viewAccepted(View view)

      Invoked by JGroups on view change. `MembershipListener.viewAccepted(View)`
      Parameters:
        `view` - contains information on the current members of the cluster group

    - #### createMessage

          Message createMessage(byte[] data)

      Different message options can be applied using different constructors, hence we delegate Message construction to the strategy.
      Parameters:
        `data` - the information to be sent to the master.
      Returns:
        the message to be sent.

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved