Class TapUploadMatcher
- java.lang.Object
-
- uk.ac.starlink.ttools.cone.TapUploadMatcher
-
- All Implemented Interfaces:
UploadMatcher
public class TapUploadMatcher extends java.lang.Object implements UploadMatcher
UploadMatcher implementation for a TAP service.Note that although the lon/lat coordinates are phrased in the API as RA/Dec, to match the language of the
ConeQueryRowSequence
interface, in fact any lon/lat coordinate pairs can be used, of course providing that the same coordinates are understood in the (uploaded) query sequence and the remote TAP table.- Since:
- 4 Oct 2014
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Constructor Description TapUploadMatcher(uk.ac.starlink.vo.EndpointSet endpointSet, java.lang.String tableName, java.lang.String raExpr, java.lang.String decExpr, java.lang.String radiusDegExpr, boolean isSync, java.lang.String[] tapCols, ServiceFindMode serviceMode, java.util.Map<java.lang.String,java.lang.String> extraParams, uk.ac.starlink.util.ContentCoding coding)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAdql(long maxrec)
Returns an ADQL expression to retrieve the raw result table from the TAP service.ColumnPlan
getColumnPlan(uk.ac.starlink.table.ColumnInfo[] resultCols, uk.ac.starlink.table.ColumnInfo[] uploadCols)
Returns an object that understands what columns are where in an output table generated from the raw result produced by this matcher.static ServiceFindMode[]
getSupportedServiceModes()
Returns service modes supported by this class.boolean
streamRawResult(ConeQueryRowSequence coneSeq, uk.ac.starlink.table.TableSink rawResultSink, RowMapper<?> rowMapper, long maxrec)
Scans a sequence of positional queries, uploads it to a remote service, and writes the returned values to a given sink.
-
-
-
Constructor Detail
-
TapUploadMatcher
public TapUploadMatcher(uk.ac.starlink.vo.EndpointSet endpointSet, java.lang.String tableName, java.lang.String raExpr, java.lang.String decExpr, java.lang.String radiusDegExpr, boolean isSync, java.lang.String[] tapCols, ServiceFindMode serviceMode, java.util.Map<java.lang.String,java.lang.String> extraParams, uk.ac.starlink.util.ContentCoding coding)
Constructor.- Parameters:
endpointSet
- TAP service endpoint locationstableName
- name of table in TAP service to match againstraExpr
- column name (or ADQL expression) for RA in decimal degrees in TAP tabledecExpr
- column name (or ADQL expression) for Declination in decimal degrees in TAP tableradiusDegExpr
- ADQL expression (maybe constant) for search radius in decimal degreesisSync
- true for synchronous, false for asynchronoustapCols
- column names from the remote table to be included in the output table; if null, all are includedserviceMode
- type of matchextraParams
- map of additional parameters for TAP querycoding
- configures HTTP compression for result
-
-
Method Detail
-
streamRawResult
public boolean streamRawResult(ConeQueryRowSequence coneSeq, uk.ac.starlink.table.TableSink rawResultSink, RowMapper<?> rowMapper, long maxrec) throws java.io.IOException
Description copied from interface:UploadMatcher
Scans a sequence of positional queries, uploads it to a remote service, and writes the returned values to a given sink.Both the read and the write should ideally be streamed (read as uploaded and written as received) so that progress can be logged properly.
The result is written to the given
rawResultSink
(which will probably be aRowStore
). To make sense of the table thus written, it is necessary to use theRowMapper
supplied to this method and theColumnPlan
available from this object. The RowMapper associates result rows with queries from the input row sequence, and the ColumnPlan knows where the special and other columns are in the result table.- Specified by:
streamRawResult
in interfaceUploadMatcher
- Parameters:
coneSeq
- sequence of cone-like positional queriesrawResultSink
- destination for result rows obtained from the target matcher servicerowMapper
- used to label rows; queries are labelled with the value returned from thegetIndex
method ofconeSeq
maxrec
- user-supplied limit on the maximum number of output rows, though the service may truncate the result; if <0, no limit is requested- Returns:
- true iff the result was truncated due to overflow
- Throws:
java.io.IOException
-
getColumnPlan
public ColumnPlan getColumnPlan(uk.ac.starlink.table.ColumnInfo[] resultCols, uk.ac.starlink.table.ColumnInfo[] uploadCols)
Description copied from interface:UploadMatcher
Returns an object that understands what columns are where in an output table generated from the raw result produced by this matcher.- Specified by:
getColumnPlan
in interfaceUploadMatcher
- Parameters:
resultCols
- columns in the raw result table written by this object'sstreamRawResult
methoduploadCols
- columns from the table that will be joined to the raw result to get the output table- Returns:
- column plan
-
getAdql
public java.lang.String getAdql(long maxrec)
Returns an ADQL expression to retrieve the raw result table from the TAP service.- Parameters:
maxrec
- maximum number of records permitted- Returns:
- ADQL text
-
getSupportedServiceModes
public static ServiceFindMode[] getSupportedServiceModes()
Returns service modes supported by this class. Currently, all are supported apart fromServiceFindMode.BEST_REMOTE
. That one is basically impossible to do using ADQL as far as I can tell, since there is in general no way to tell what remote table row a given row of a query result is referring to. You could do it in special cases if the table in question has a primary key.- Returns:
- supported find modes
-
-