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

java.lang.Object
  extended by org.hibernate.search.backend.impl.jgroups.JGroupsBackendQueueProcessor
      extended by org.hibernate.search.backend.impl.jgroups.MasterJGroupsBackendQueueProcessor
All Implemented Interfaces:
BackendQueueProcessor

public class MasterJGroupsBackendQueueProcessor
extends JGroupsBackendQueueProcessor

Backend factory used in JGroups clustering mode in master node. Wraps LuceneBackendQueueProcessor with providing extra functionality to receive Lucene works from slave nodes.

Author:
Lukasz Moren
See Also:
LuceneBackendQueueProcessor, SlaveJGroupsBackendQueueProcessor

Field Summary
 
Fields inherited from class org.hibernate.search.backend.impl.jgroups.JGroupsBackendQueueProcessor
address, channel, clusterName, CONFIGURATION_FILE, CONFIGURATION_STRING, CONFIGURATION_XML, indexManager, indexName, JG_CLUSTER_NAME, JGROUPS_PREFIX
 
Constructor Summary
MasterJGroupsBackendQueueProcessor()
           
 
Method Summary
 void applyStreamWork(LuceneWork singleOperation, IndexingMonitor monitor)
          Applies a single operation on the index, and different operations can be applied in parallel, even in parallel to a workList instance being processed by BackendQueueProcessor.applyWork(List, IndexingMonitor)
 void applyWork(List<LuceneWork> workList, IndexingMonitor monitor)
          Applies a list of operations to the index.
 void close()
          Used to shutdown and eventually release resources.
 Lock getExclusiveWriteLock()
           
 org.jgroups.Receiver getMasterListener()
           
 void initialize(Properties props, WorkerBuildContext context, DirectoryBasedIndexManager indexManager)
          Used at startup, called once as first method.
 
Methods inherited from class org.hibernate.search.backend.impl.jgroups.JGroupsBackendQueueProcessor
getAddress, getChannel, getClusterName, setClusterName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MasterJGroupsBackendQueueProcessor

public MasterJGroupsBackendQueueProcessor()
Method Detail

initialize

public void initialize(Properties props,
                       WorkerBuildContext context,
                       DirectoryBasedIndexManager indexManager)
Description copied from interface: BackendQueueProcessor
Used at startup, called once as first method.

Specified by:
initialize in interface BackendQueueProcessor
Overrides:
initialize in class JGroupsBackendQueueProcessor
Parameters:
props - all configuration properties
context - context giving access to required meta data
indexManager - the index it is related to.

getMasterListener

public org.jgroups.Receiver getMasterListener()

close

public void close()
Description copied from interface: BackendQueueProcessor
Used to shutdown and eventually release resources. No other method should be used after this one.

Specified by:
close in interface BackendQueueProcessor
Overrides:
close in class JGroupsBackendQueueProcessor

applyWork

public void applyWork(List<LuceneWork> workList,
                      IndexingMonitor monitor)
Description copied from interface: BackendQueueProcessor
Applies a list of operations to the index. A single list might be processed by applying elements in parallel threads, but no work should be started on a new workList until the previous one was fully processed. Work could be applied asynchronously according to capabilities and configuration of implementor. A null parameter is not acceptable, implementations should throw an IllegalArgumentException.

Parameters:
workList - list of Lucene work instance which need to be applied to the index

applyStreamWork

public void applyStreamWork(LuceneWork singleOperation,
                            IndexingMonitor monitor)
Description copied from interface: BackendQueueProcessor
Applies a single operation on the index, and different operations can be applied in parallel, even in parallel to a workList instance being processed by BackendQueueProcessor.applyWork(List, IndexingMonitor)

Parameters:
singleOperation - single Lucene work instance to be applied to the index

getExclusiveWriteLock

public Lock getExclusiveWriteLock()
Returns:
a Lock instance which will block index modifications when acquired


Copyright © 2006-2012 Hibernate. All Rights Reserved.