public class TapUploadMatcher extends Object implements UploadMatcher
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.
Constructor and Description |
---|
TapUploadMatcher(TapService tapService,
String tableName,
String raExpr,
String decExpr,
String radiusDegExpr,
boolean isSync,
String[] tapCols,
ServiceFindMode serviceMode,
Map<String,String> extraParams,
ContentCoding coding)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getAdql(long maxrec)
Returns an ADQL expression to retrieve the raw result table from
the TAP service.
|
ColumnPlan |
getColumnPlan(ColumnInfo[] resultCols,
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,
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.
|
public TapUploadMatcher(TapService tapService, String tableName, String raExpr, String decExpr, String radiusDegExpr, boolean isSync, String[] tapCols, ServiceFindMode serviceMode, Map<String,String> extraParams, ContentCoding coding)
tapService
- TAP service descriptiontableName
- 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 resultpublic boolean streamRawResult(ConeQueryRowSequence coneSeq, TableSink rawResultSink, RowMapper<?> rowMapper, long maxrec) throws IOException
UploadMatcher
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 a RowStore
).
To make sense of the table thus written, it is necessary to
use the RowMapper
supplied to this method and the
ColumnPlan
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.
streamRawResult
in interface UploadMatcher
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 the getIndex
method of coneSeq
maxrec
- user-supplied limit on the maximum number of
output rows, though the service may truncate
the result; if <0, no limit is requestedIOException
public ColumnPlan getColumnPlan(ColumnInfo[] resultCols, ColumnInfo[] uploadCols)
UploadMatcher
getColumnPlan
in interface UploadMatcher
resultCols
- columns in the raw result table written by
this object's streamRawResult
methoduploadCols
- columns from the table that will be joined to
the raw result to get the output tablepublic String getAdql(long maxrec)
maxrec
- maximum number of records permittedpublic static ServiceFindMode[] getSupportedServiceModes()
ServiceFindMode.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.Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.