com.senseidb.search.node
Class SenseiSysBroker

java.lang.Object
  extended by com.senseidb.search.node.AbstractSenseiBroker<REQUEST,RESULT>
      extended by com.senseidb.search.node.AbstractConsistentHashBroker<SenseiRequest,SenseiSystemInfo>
          extended by com.senseidb.search.node.SenseiSysBroker
All Implemented Interfaces:
com.linkedin.norbert.javacompat.cluster.ClusterListener

public class SenseiSysBroker
extends AbstractConsistentHashBroker<SenseiRequest,SenseiSystemInfo>


Field Summary
protected  Set<com.linkedin.norbert.javacompat.cluster.Node> _nodes
           
 
Fields inherited from class com.senseidb.search.node.AbstractConsistentHashBroker
_loadBalancer, _serializer, _timeout
 
Fields inherited from class com.senseidb.search.node.AbstractSenseiBroker
_networkClient, _partitions
 
Constructor Summary
SenseiSysBroker(com.linkedin.norbert.javacompat.network.PartitionedNetworkClient<Integer> networkClient, com.linkedin.norbert.javacompat.cluster.ClusterClient clusterClient, SenseiLoadBalancerFactory loadBalancerFactory, Comparator<String> versionComparator)
           
 
Method Summary
protected  SenseiSystemInfo doBrowse(com.linkedin.norbert.javacompat.network.PartitionedNetworkClient<Integer> networkClient, SenseiRequest req, it.unimi.dsi.fastutil.ints.IntSet partitions)
           
 SenseiSystemInfo getEmptyResultInstance()
           
 String getRouteParam(SenseiRequest req)
           
 long getTimeoutMillis()
           
 void handleClusterConnected(Set<com.linkedin.norbert.javacompat.cluster.Node> nodes)
           
 void handleClusterDisconnected()
           
 void handleClusterNodesChanged(Set<com.linkedin.norbert.javacompat.cluster.Node> nodes)
           
 void handleClusterShutdown()
           
 SenseiSystemInfo mergeResults(SenseiRequest request, List<SenseiSystemInfo> resultList)
          Merge results on the client/broker side.
 void setTimeoutMillis(long timeoutMillis)
           
 
Methods inherited from class com.senseidb.search.node.AbstractConsistentHashBroker
browse, customizeRequest, getPartitions, restoreRequest, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_nodes

protected Set<com.linkedin.norbert.javacompat.cluster.Node> _nodes
Constructor Detail

SenseiSysBroker

public SenseiSysBroker(com.linkedin.norbert.javacompat.network.PartitionedNetworkClient<Integer> networkClient,
                       com.linkedin.norbert.javacompat.cluster.ClusterClient clusterClient,
                       SenseiLoadBalancerFactory loadBalancerFactory,
                       Comparator<String> versionComparator)
                throws com.linkedin.norbert.NorbertException
Throws:
com.linkedin.norbert.NorbertException
Method Detail

mergeResults

public SenseiSystemInfo mergeResults(SenseiRequest request,
                                     List<SenseiSystemInfo> 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,SenseiSystemInfo>
Parameters:
request - the original request object
resultList - the list of results from all the requested partitions.
Returns:
one single result instance that is merged from the result list.

doBrowse

protected SenseiSystemInfo doBrowse(com.linkedin.norbert.javacompat.network.PartitionedNetworkClient<Integer> networkClient,
                                    SenseiRequest req,
                                    it.unimi.dsi.fastutil.ints.IntSet partitions)
Overrides:
doBrowse in class AbstractConsistentHashBroker<SenseiRequest,SenseiSystemInfo>

getRouteParam

public String getRouteParam(SenseiRequest req)
Specified by:
getRouteParam in class AbstractConsistentHashBroker<SenseiRequest,SenseiSystemInfo>

getEmptyResultInstance

public SenseiSystemInfo getEmptyResultInstance()
Specified by:
getEmptyResultInstance in class AbstractConsistentHashBroker<SenseiRequest,SenseiSystemInfo>
Returns:
an empty result instance. Used when the request cannot be properly processed or when the true result is empty.

setTimeoutMillis

public void setTimeoutMillis(long timeoutMillis)
Specified by:
setTimeoutMillis in class AbstractConsistentHashBroker<SenseiRequest,SenseiSystemInfo>

getTimeoutMillis

public long getTimeoutMillis()
Specified by:
getTimeoutMillis in class AbstractConsistentHashBroker<SenseiRequest,SenseiSystemInfo>

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.