com.senseidb.search.node
Class AbstractSenseiBroker<REQUEST extends AbstractSenseiRequest,RESULT extends AbstractSenseiResult>

java.lang.Object
  extended by com.senseidb.search.node.AbstractSenseiBroker<REQUEST,RESULT>
Type Parameters:
REQUEST -
RESULT -
All Implemented Interfaces:
com.linkedin.norbert.javacompat.cluster.ClusterListener
Direct Known Subclasses:
AbstractConsistentHashBroker

public abstract class AbstractSenseiBroker<REQUEST extends AbstractSenseiRequest,RESULT extends AbstractSenseiResult>
extends Object
implements com.linkedin.norbert.javacompat.cluster.ClusterListener

Author:
"Xiaoyang Gu"

Field Summary
protected  com.linkedin.norbert.javacompat.network.PartitionedNetworkClient<Integer> _networkClient
           
protected  it.unimi.dsi.fastutil.ints.IntSet _partitions
           
 
Constructor Summary
AbstractSenseiBroker(com.linkedin.norbert.javacompat.network.PartitionedNetworkClient<Integer> networkClient)
           
 
Method Summary
 RESULT browse(REQUEST req)
          The method that provides the search service.
protected abstract  RESULT doBrowse(com.linkedin.norbert.javacompat.network.PartitionedNetworkClient<Integer> networkClient, REQUEST req, it.unimi.dsi.fastutil.ints.IntSet partitions)
           
abstract  RESULT getEmptyResultInstance()
           
abstract  long getTimeoutMillis()
           
abstract  void setTimeoutMillis(long timeoutMillis)
           
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.linkedin.norbert.javacompat.cluster.ClusterListener
handleClusterConnected, handleClusterDisconnected, handleClusterNodesChanged, handleClusterShutdown
 

Field Detail

_networkClient

protected final com.linkedin.norbert.javacompat.network.PartitionedNetworkClient<Integer> _networkClient

_partitions

protected volatile it.unimi.dsi.fastutil.ints.IntSet _partitions
Constructor Detail

AbstractSenseiBroker

public AbstractSenseiBroker(com.linkedin.norbert.javacompat.network.PartitionedNetworkClient<Integer> networkClient)
                     throws com.linkedin.norbert.NorbertException
Parameters:
networkClient -
clusterClient -
routerFactory -
scatterGatherHandler -
Throws:
com.linkedin.norbert.NorbertException
Method Detail

getEmptyResultInstance

public abstract RESULT getEmptyResultInstance()
Returns:
an empty result instance. Used when the request cannot be properly processed or when the true result is empty.

browse

public RESULT browse(REQUEST req)
                                           throws SenseiException
The method that provides the search service.

Parameters:
req -
Returns:
Throws:
SenseiException

doBrowse

protected abstract RESULT doBrowse(com.linkedin.norbert.javacompat.network.PartitionedNetworkClient<Integer> networkClient,
                                   REQUEST req,
                                   it.unimi.dsi.fastutil.ints.IntSet partitions)
                                                         throws Exception
Throws:
Exception

shutdown

public void shutdown()

setTimeoutMillis

public abstract void setTimeoutMillis(long timeoutMillis)

getTimeoutMillis

public abstract long getTimeoutMillis()


Copyright © 2010-2012. All Rights Reserved.