com.senseidb.search.node
Class SenseiBroker
java.lang.Object
com.senseidb.search.node.AbstractSenseiBroker<REQUEST,RESULT>
com.senseidb.search.node.AbstractConsistentHashBroker<SenseiRequest,SenseiResult>
com.senseidb.search.node.SenseiBroker
- All Implemented Interfaces:
- com.linkedin.norbert.javacompat.cluster.ClusterListener
public class SenseiBroker
- extends AbstractConsistentHashBroker<SenseiRequest,SenseiResult>
This SenseiBroker routes search(browse) request using the routers created by
the supplied router factory. It uses Norbert's scatter-gather handling
mechanism to handle distributed search, which does not support request based
context sensitive routing.
Constructor Summary |
SenseiBroker(com.linkedin.norbert.javacompat.network.PartitionedNetworkClient<Integer> networkClient,
com.linkedin.norbert.javacompat.cluster.ClusterClient clusterClient,
SenseiLoadBalancerFactory loadBalancerFactory)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SenseiBroker
public SenseiBroker(com.linkedin.norbert.javacompat.network.PartitionedNetworkClient<Integer> networkClient,
com.linkedin.norbert.javacompat.cluster.ClusterClient clusterClient,
SenseiLoadBalancerFactory loadBalancerFactory)
throws com.linkedin.norbert.NorbertException
- Throws:
com.linkedin.norbert.NorbertException
mergeResults
public SenseiResult mergeResults(SenseiRequest request,
List<SenseiResult> resultList)
- Description copied from class:
AbstractConsistentHashBroker
- Merge results on the client/broker side. It likely works differently from
the one in the search node.
- Specified by:
mergeResults
in class AbstractConsistentHashBroker<SenseiRequest,SenseiResult>
- Parameters:
request
- the original request objectresultList
- the list of results from all the requested partitions.
- Returns:
- one single result instance that is merged from the result list.
getRouteParam
public String getRouteParam(SenseiRequest req)
- Specified by:
getRouteParam
in class AbstractConsistentHashBroker<SenseiRequest,SenseiResult>
getEmptyResultInstance
public SenseiResult getEmptyResultInstance()
- Specified by:
getEmptyResultInstance
in class AbstractConsistentHashBroker<SenseiRequest,SenseiResult>
- Returns:
- an empty result instance. Used when the request cannot be properly
processed or when the true result is empty.
customizeRequest
public SenseiRequest customizeRequest(SenseiRequest request)
- Overrides:
customizeRequest
in class AbstractConsistentHashBroker<SenseiRequest,SenseiResult>
setTimeoutMillis
public void setTimeoutMillis(long timeoutMillis)
- Specified by:
setTimeoutMillis
in class AbstractConsistentHashBroker<SenseiRequest,SenseiResult>
getTimeoutMillis
public long getTimeoutMillis()
- Specified by:
getTimeoutMillis
in class AbstractConsistentHashBroker<SenseiRequest,SenseiResult>
handleClusterConnected
public void handleClusterConnected(Set<com.linkedin.norbert.javacompat.cluster.Node> nodes)
handleClusterDisconnected
public void handleClusterDisconnected()
handleClusterNodesChanged
public void handleClusterNodesChanged(Set<com.linkedin.norbert.javacompat.cluster.Node> nodes)
handleClusterShutdown
public void handleClusterShutdown()
Copyright © 2010-2012. All Rights Reserved.