uk.ac.starlink.ttools.cone
Class ParallelResultRowSequence

java.lang.Object
  extended by uk.ac.starlink.ttools.cone.ParallelResultRowSequence
All Implemented Interfaces:
uk.ac.starlink.table.RowSequence, ConeQueryRowSequence, ConeResultRowSequence

public class ParallelResultRowSequence
extends Object
implements ConeResultRowSequence

ConeResultRowSequence implementation which uses a fixed number of worker threads to dispatch cone queries in parallel. The result table has the same ordering as if they had been done in sequence.

Since:
18 Jan 2008
Author:
Mark Taylor

Constructor Summary
ParallelResultRowSequence(ConeQueryRowSequence querySeq, ConeSearcher coneSearcher, boolean bestOnly, String distanceCol, int parallelism)
          Constructor.
 
Method Summary
 void close()
           
 Object getCell(int icol)
           
 uk.ac.starlink.table.StarTable getConeResult()
          Returns the result of the cone search for the current row of this sequence.
 double getDec()
          Get central declination for the current row's cone search request in degrees.
 double getRa()
          Get central right ascension for the current row's cone search request in degrees.
 double getRadius()
          Get search radius for the current row's cone search request in degrees.
 Object[] getRow()
           
 boolean next()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParallelResultRowSequence

public ParallelResultRowSequence(ConeQueryRowSequence querySeq,
                                 ConeSearcher coneSearcher,
                                 boolean bestOnly,
                                 String distanceCol,
                                 int parallelism)
Constructor.

Parameters:
querySeq - sequence providing cone search query parameters
coneSearcher - cone search implementation
bestOnly - whether all results or just best are required
distanceCol - name of column to hold distance information in output table, or null
parallelism - number of concurrent querying threads
Method Detail

next

public boolean next()
             throws IOException
Specified by:
next in interface uk.ac.starlink.table.RowSequence
Throws:
IOException

getCell

public Object getCell(int icol)
               throws IOException
Specified by:
getCell in interface uk.ac.starlink.table.RowSequence
Throws:
IOException

getRow

public Object[] getRow()
                throws IOException
Specified by:
getRow in interface uk.ac.starlink.table.RowSequence
Throws:
IOException

getRa

public double getRa()
             throws IOException
Description copied from interface: ConeQueryRowSequence
Get central right ascension for the current row's cone search request in degrees.

Specified by:
getRa in interface ConeQueryRowSequence
Returns:
right ascension
Throws:
IOException

getDec

public double getDec()
              throws IOException
Description copied from interface: ConeQueryRowSequence
Get central declination for the current row's cone search request in degrees.

Specified by:
getDec in interface ConeQueryRowSequence
Returns:
declination
Throws:
IOException

getRadius

public double getRadius()
                 throws IOException
Description copied from interface: ConeQueryRowSequence
Get search radius for the current row's cone search request in degrees.

Specified by:
getRadius in interface ConeQueryRowSequence
Returns:
search radius
Throws:
IOException

getConeResult

public uk.ac.starlink.table.StarTable getConeResult()
                                             throws IOException
Description copied from interface: ConeResultRowSequence
Returns the result of the cone search for the current row of this sequence. The work will typically be done using ConeMatcher.getConeResult(uk.ac.starlink.ttools.cone.ConeSearcher, boolean, java.lang.String, double, double, double).

If no records in the cone are found, the return value may either be null or (preferably) an empty table with the correct columns.

Specified by:
getConeResult in interface ConeResultRowSequence
Returns:
table giving rows strictly within the match criteria for the current row of this cone query sequence, or null
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface uk.ac.starlink.table.RowSequence
Throws:
IOException


Copyright © 2009 Central Laboratory of the Research Councils. All Rights Reserved.