public class ParallelResultRowSequence extends Object implements ConeResultRowSequence
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAXPAR
Default maximum value for the number of threads that should be
permitted for a query.
|
static String |
MAXPAR_PROP
Name of system property "service.maxparallel" which may be used to adjust the
maximum parallelism.
|
Constructor and Description |
---|
ParallelResultRowSequence(ConeQueryRowSequence querySeq,
ConeSearcher coneSearcher,
ConeErrorPolicy errAct,
Coverage coverage,
boolean bestOnly,
boolean distFilter,
String distanceCol,
int parallelism)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Indicates that this sequence will not be required any more.
|
Object |
getCell(int icol)
Returns the contents of a cell in the current row.
|
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.
|
long |
getIndex()
Get the index in the underlying table to which the current row relates.
|
static int |
getMaxParallelism()
Returns the maximum parallelism value which should permitted in this JVM.
|
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()
Returns the contents of the current table row, as an array
with the same number of elements as there are columns in this
table.
|
boolean |
next()
Attempts to advance the current row to the next one.
|
public static final int DEFAULT_MAXPAR
MAXPAR_PROP
,
getMaxParallelism()
,
Constant Field Valuespublic static final String MAXPAR_PROP
DEFAULT_MAXPAR
,
getMaxParallelism()
,
Constant Field Valuespublic ParallelResultRowSequence(ConeQueryRowSequence querySeq, ConeSearcher coneSearcher, ConeErrorPolicy errAct, Coverage coverage, boolean bestOnly, boolean distFilter, String distanceCol, int parallelism)
querySeq
- sequence providing cone search query parametersconeSearcher
- cone search implementationerrAct
- defines action on cone search invocation errorcoverage
- coverage for results, or nullbestOnly
- whether all results or just best are requireddistFilter
- true to perform post-query filtering on results
based on the distance between the query position
and the result row positiondistanceCol
- name of column to hold distance information
in output table, or nullparallelism
- number of concurrent querying threadspublic boolean next() throws IOException
RowSequence
true
is returned the attempt has been successful,
and if false
is returned there are no more rows in this
sequence.
Since the initial position of a RowSequence is before the first row,
this method must be called before current row data
can be accessed using the
RowSequence.getCell(int)
or RowSequence.getRow()
methods.next
in interface RowSequence
next
in interface Sequence
true
iff this sequence has been advanced to the
next rowIOException
- if there is some errorpublic Object getCell(int icol) throws IOException
RowSequence
getColumnInfo(icol).getContentClass()
.
An unchecked exception will be thrown if there is no current
row (next
has not yet been called).getCell
in interface RowData
getCell
in interface RowSequence
icol
- column indexicol
in the current rowIOException
- if there is an error reading the datapublic Object[] getRow() throws IOException
RowSequence
next
has not yet been called).getRow
in interface RowData
getRow
in interface RowSequence
irow
IOException
- if there is an error reading the datapublic double getRa() throws IOException
ConeQueryRowSequence
getRa
in interface ConeQueryRowSequence
IOException
public double getDec() throws IOException
ConeQueryRowSequence
getDec
in interface ConeQueryRowSequence
IOException
public double getRadius() throws IOException
ConeQueryRowSequence
getRadius
in interface ConeQueryRowSequence
IOException
public long getIndex() throws IOException
ConeQueryRowSequence
next
.getIndex
in interface ConeQueryRowSequence
IOException
public StarTable getConeResult() throws IOException
ConeResultRowSequence
ConeMatcher.getConeResult(uk.ac.starlink.ttools.cone.ConeSearcher, uk.ac.starlink.ttools.cone.ConeErrorPolicy, boolean, 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.
getConeResult
in interface ConeResultRowSequence
IOException
public void close() throws IOException
RowSequence
close
is undefined.close
in interface Closeable
close
in interface AutoCloseable
close
in interface RowSequence
IOException
public static int getMaxParallelism()
MAXPAR_PROP
system
property.
Note that this method is not used by this class, i.e. the maximum
is not imposed here, it should be imposed by calling code.Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.