Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vollt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sonia Zorba
vollt
Commits
612ab4fe
Commit
612ab4fe
authored
11 years ago
by
gmantele
Browse files
Options
Downloads
Patches
Plain Diff
TAP: Fix bug: bad management of the maxRec parameter
parent
21312ff1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/tap/parameters/MaxRecController.java
+10
-10
10 additions, 10 deletions
src/tap/parameters/MaxRecController.java
with
10 additions
and
10 deletions
src/tap/parameters/MaxRecController.java
+
10
−
10
View file @
612ab4fe
...
...
@@ -16,7 +16,7 @@ package tap.parameters;
* You should have received a copy of the GNU Lesser General Public License
* along with TAPLibrary. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2012-201
3
- UDS/Centre de Données astronomiques de Strasbourg (CDS),
* Copyright 2012-201
4
- UDS/Centre de Données astronomiques de Strasbourg (CDS),
* Astronomisches Rechen Institute (ARI)
*/
...
...
@@ -30,12 +30,12 @@ import uws.job.parameters.InputParamController;
/**
* The logic of the output limit is set in this class. Here it is:
*
* - If no value is specified by the TAP client,
the default one is specifi
ed.
* - If no default value is provided,
the maximum
on
e
is
u
se
d instead
.
* - If no value is specified by the TAP client,
none is return
ed.
* - If no default value is provided,
no default limitati
on is se
t (={@link TAPJob#UNLIMITED_MAX_REC})
.
* - If no maximum value is provided, there is no output limit (={@link TAPJob#UNLIMITED_MAX_REC}).
*
* @author Grégory Mantelet (CDS;ARI) - gmantele@ari.uni-heidelberg.de
* @version 1.1 (
12
/201
3
)
* @version 1.1 (
03
/201
4
)
*/
public
class
MaxRecController
implements
InputParamController
{
...
...
@@ -56,8 +56,8 @@ public class MaxRecController implements InputParamController {
if
(
service
.
getOutputLimit
()[
0
]
>
0
&&
service
.
getOutputLimitType
()[
0
]
==
LimitUnit
.
rows
)
return
service
.
getOutputLimit
()[
0
];
}
// Otherwise, return
the maximum
limit:
return
getMaxOutputLimit
()
;
// Otherwise, return
no
limit
ation
:
return
TAPJob
.
UNLIMITED_MAX_REC
;
}
public
final
int
getMaxOutputLimit
(){
...
...
@@ -72,9 +72,9 @@ public class MaxRecController implements InputParamController {
@Override
public
Object
check
(
Object
value
)
throws
UWSException
{
// If no limit is provided by the TAP client,
the default
one is returned
instead
:
// If no limit is provided by the TAP client,
n
one is returned:
if
(
value
==
null
)
return
getDefault
()
;
return
null
;
// Parse the provided limit:
int
maxOutputLimit
=
getMaxOutputLimit
();
...
...
@@ -96,8 +96,8 @@ public class MaxRecController implements InputParamController {
maxRec
=
TAPJob
.
UNLIMITED_MAX_REC
;
// If the limit is greater than the maximum one, an exception is thrown:
if
(
max
OutputLimit
>
TAPJob
.
UNLIMITED_MAX_REC
&&
maxRec
>
maxOutputLimit
)
throw
new
UWSException
(
UWSException
.
BAD_REQUEST
,
"The TAP limits the maxRec parameter (=output limit) to maximum "
+
maxOutputLimit
+
" rows !"
)
;
if
(
max
Rec
==
TAPJob
.
UNLIMITED_MAX_REC
||
maxRec
>
maxOutputLimit
)
maxRec
=
maxOutputLimit
;
return
maxRec
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment