Package uk.ac.starlink.ttools.cone
Class ParallelResultRowSequence
java.lang.Object
uk.ac.starlink.ttools.cone.ParallelResultRowSequence
- All Implemented Interfaces:
Closeable,AutoCloseable,uk.ac.starlink.table.RowData,uk.ac.starlink.table.RowSequence,ConeQueryRowSequence,ConeResultRowSequence,uk.ac.starlink.util.Sequence
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
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault maximum value for the number of threads that should be permitted for a query.static final StringName of system property "service.maxparallel" which may be used to adjust the maximum parallelism. -
Constructor Summary
ConstructorsConstructorDescriptionParallelResultRowSequence(ConeQueryRowSequence querySeq, ConeSearcher coneSearcher, ConeErrorPolicy errAct, Coverage coverage, boolean bestOnly, boolean distFilter, String distanceCol, int parallelism) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()getCell(int icol) uk.ac.starlink.table.StarTableReturns the result of the cone search for the current row of this sequence.doublegetDec()Get central declination for the current row's cone search request in degrees.longgetIndex()Get the index in the underlying table to which the current row relates.static intReturns the maximum parallelism value which should permitted in this JVM.doublegetRa()Get central right ascension for the current row's cone search request in degrees.doubleGet search radius for the current row's cone search request in degrees.Object[]getRow()booleannext()
-
Field Details
-
DEFAULT_MAXPAR
public static final int DEFAULT_MAXPARDefault maximum value for the number of threads that should be permitted for a query. -
MAXPAR_PROP
Name of system property "service.maxparallel" which may be used to adjust the maximum parallelism. Only increase this value with great care since you run the risk of overloading servers and making yourself unpopular with data centres. As a rule, you should only increase this value if you have obtained permission from the data centres whose services on which you will be using the increased parallelism.
-
-
Constructor Details
-
ParallelResultRowSequence
public ParallelResultRowSequence(ConeQueryRowSequence querySeq, ConeSearcher coneSearcher, ConeErrorPolicy errAct, Coverage coverage, boolean bestOnly, boolean distFilter, String distanceCol, int parallelism) Constructor.- Parameters:
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 threads
-
-
Method Details
-
next
- Specified by:
nextin interfaceuk.ac.starlink.table.RowSequence- Specified by:
nextin interfaceuk.ac.starlink.util.Sequence- Throws:
IOException
-
getCell
- Specified by:
getCellin interfaceuk.ac.starlink.table.RowData- Specified by:
getCellin interfaceuk.ac.starlink.table.RowSequence- Throws:
IOException
-
getRow
- Specified by:
getRowin interfaceuk.ac.starlink.table.RowData- Specified by:
getRowin interfaceuk.ac.starlink.table.RowSequence- Throws:
IOException
-
getRa
Description copied from interface:ConeQueryRowSequenceGet central right ascension for the current row's cone search request in degrees.- Specified by:
getRain interfaceConeQueryRowSequence- Returns:
- right ascension
- Throws:
IOException
-
getDec
Description copied from interface:ConeQueryRowSequenceGet central declination for the current row's cone search request in degrees.- Specified by:
getDecin interfaceConeQueryRowSequence- Returns:
- declination
- Throws:
IOException
-
getRadius
Description copied from interface:ConeQueryRowSequenceGet search radius for the current row's cone search request in degrees.- Specified by:
getRadiusin interfaceConeQueryRowSequence- Returns:
- search radius
- Throws:
IOException
-
getIndex
Description copied from interface:ConeQueryRowSequenceGet the index in the underlying table to which the current row relates. The identity of this underlying table is not specified by this interface, but must be understood by the creator and user of instances. In particular, the return value does not necessarily increment by one for each call tonext.- Specified by:
getIndexin interfaceConeQueryRowSequence- Returns:
- row index
- Throws:
IOException
-
getConeResult
Description copied from interface:ConeResultRowSequenceReturns the result of the cone search for the current row of this sequence. The work will typically be done usingConeMatcher.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.
- Specified by:
getConeResultin interfaceConeResultRowSequence- Returns:
- table giving rows strictly within the match criteria for the current row of this cone query sequence, or null
- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceuk.ac.starlink.table.RowSequence- Throws:
IOException
-
getMaxParallelism
public static int getMaxParallelism()Returns the maximum parallelism value which should permitted in this JVM. The purpose of this is to set a limit to the number of concurrent queries that an irresponsible/careless user can hit a server with. The value can be adjusted using theMAXPAR_PROPsystem 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.- Returns:
- parallelism limit
-