Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Y
YCSB
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Adnan Ahmad
YCSB
Commits
65bedc06
Commit
65bedc06
authored
9 years ago
by
Connor McCoy
Browse files
Options
Downloads
Plain Diff
Merge pull request #468 from kruthar/jdbc-scan-fix
[jdbc] added LIMIT to JDBC scan operation
parents
d01e35ce
54fa0ea9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
jdbc/src/main/java/com/yahoo/ycsb/db/JdbcDBClient.java
+5
-2
5 additions, 2 deletions
jdbc/src/main/java/com/yahoo/ycsb/db/JdbcDBClient.java
with
5 additions
and
2 deletions
jdbc/src/main/java/com/yahoo/ycsb/db/JdbcDBClient.java
+
5
−
2
View file @
65bedc06
...
...
@@ -304,8 +304,10 @@ public class JdbcDBClient extends DB implements JdbcDBClientConstants {
select
.
append
(
scanType
.
tableName
);
select
.
append
(
" WHERE "
);
select
.
append
(
PRIMARY_KEY
);
select
.
append
(
" >= "
);
select
.
append
(
"?;"
);
select
.
append
(
" >= ?"
);
select
.
append
(
" ORDER BY "
);
select
.
append
(
PRIMARY_KEY
);
select
.
append
(
" LIMIT ?;"
);
PreparedStatement
scanStatement
=
getShardConnectionByKey
(
key
).
prepareStatement
(
select
.
toString
());
if
(
this
.
jdbcFetchSize
!=
null
)
scanStatement
.
setFetchSize
(
this
.
jdbcFetchSize
);
PreparedStatement
stmt
=
cachedStatements
.
putIfAbsent
(
scanType
,
scanStatement
);
...
...
@@ -364,6 +366,7 @@ public class JdbcDBClient extends DB implements JdbcDBClientConstants {
scanStatement
=
createAndCacheScanStatement
(
type
,
startKey
);
}
scanStatement
.
setString
(
1
,
startKey
);
scanStatement
.
setInt
(
2
,
recordcount
);
ResultSet
resultSet
=
scanStatement
.
executeQuery
();
for
(
int
i
=
0
;
i
<
recordcount
&&
resultSet
.
next
();
i
++)
{
if
(
result
!=
null
&&
fields
!=
null
)
{
...
...
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