@Override public void addScannedResult(Result scannedResult) throws QueryExecutionException {
synchronized (this.lockObject) {
    scannedResultList.add(scannedResult);
    if ((scannedResultList.size() > maxNumberOfScannedResultList)) {
      List<Result> localResult=scannedResultList;
      scannedResultList=new ArrayList<Result>(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE);
      execService.submit(new MergerThread(localResult));
    }
  }
}

@ Override public void addScannedResult ( Result scannedResult ) throws QueryExecutionException { synchronized ( this . lockObject ) { scannedResultList . add ( scannedResult ) ; if ( ( scannedResultList . size ( ) > maxNumberOfScannedResultList ) ) { List < Result > localResult = scannedResultList ; scannedResultList = new ArrayList < Result > ( CarbonCommonConstants . DEFAULT_COLLECTION_SIZE ) ; execService . submit ( new MergerThread ( localResult ) ) ; } } }
below method will be used to add the scanned result if number of scanned result in the list of more than the maxnumberofscannedresultlist than results present in the list will be merged to merged scanned result
