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

java.lang.Object
  extended by com.senseidb.search.node.AbstractSenseiScatterGatherHandler<REQUEST,RESULT>
All Implemented Interfaces:
com.linkedin.norbert.javacompat.network.ScatterGatherHandler<REQUEST,RESULT,RESULT,Integer>
Direct Known Subclasses:
SenseiScatterGatherHandler, SenseiSysScatterGatherHandler

public abstract class AbstractSenseiScatterGatherHandler<REQUEST extends AbstractSenseiRequest,RESULT extends AbstractSenseiResult>
extends Object
implements com.linkedin.norbert.javacompat.network.ScatterGatherHandler<REQUEST,RESULT,RESULT,Integer>


Constructor Summary
AbstractSenseiScatterGatherHandler(REQUEST request)
           
 
Method Summary
abstract  REQUEST customizeRequest(REQUEST request, com.linkedin.norbert.javacompat.cluster.Node node, Set<Integer> partitions)
           
 RESULT gatherResponses(com.linkedin.norbert.network.ResponseIterator<RESULT> iter)
           
 long getTimeoutMillis()
           
abstract  RESULT mergeResults(REQUEST request, List<RESULT> resultList)
          Merge results on the client/broker side.
 void setTimeoutMillis(long timeoutMillis)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractSenseiScatterGatherHandler

public AbstractSenseiScatterGatherHandler(REQUEST request)
Method Detail

setTimeoutMillis

public void setTimeoutMillis(long timeoutMillis)

getTimeoutMillis

public long getTimeoutMillis()

mergeResults

public abstract RESULT mergeResults(REQUEST request,
                                    List<RESULT> resultList)
Merge results on the client/broker side. It likely works differently from the one in the search node.

Parameters:
resultList - the list of results from all the requested partitions.
Returns:
one single result instance that is merged from the result list.

customizeRequest

public abstract REQUEST customizeRequest(REQUEST request,
                                         com.linkedin.norbert.javacompat.cluster.Node node,
                                         Set<Integer> partitions)

gatherResponses

public RESULT gatherResponses(com.linkedin.norbert.network.ResponseIterator<RESULT> iter)
                                                    throws Exception
Specified by:
gatherResponses in interface com.linkedin.norbert.javacompat.network.ScatterGatherHandler<REQUEST extends AbstractSenseiRequest,RESULT extends AbstractSenseiResult,RESULT extends AbstractSenseiResult,Integer>
Throws:
Exception


Copyright © 2010-2012. All Rights Reserved.