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
8ae0bd30
Commit
8ae0bd30
authored
9 years ago
by
Jeff Yemin
Committed by
Robert J. Moore
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
A bit more cleanup of scan and read in MongoDbClient
parent
00f0a91b
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
mongodb/src/main/java/com/yahoo/ycsb/db/MongoDbClient.java
+10
-6
10 additions, 6 deletions
mongodb/src/main/java/com/yahoo/ycsb/db/MongoDbClient.java
with
10 additions
and
6 deletions
mongodb/src/main/java/com/yahoo/ycsb/db/MongoDbClient.java
+
10
−
6
View file @
8ae0bd30
...
...
@@ -284,7 +284,6 @@ public class MongoDbClient extends DB {
FindIterable
<
Document
>
findIterable
=
collection
.
find
(
query
);
Document
queryResult
=
null
;
if
(
fields
!=
null
)
{
Document
projection
=
new
Document
();
for
(
String
field
:
fields
)
{
...
...
@@ -293,7 +292,7 @@ public class MongoDbClient extends DB {
findIterable
.
projection
(
projection
);
}
queryResult
=
findIterable
.
first
();
Document
queryResult
=
findIterable
.
first
();
if
(
queryResult
!=
null
)
{
fillMap
(
result
,
queryResult
);
...
...
@@ -335,16 +334,21 @@ public class MongoDbClient extends DB {
Document
scanRange
=
new
Document
(
"$gte"
,
startkey
);
Document
query
=
new
Document
(
"_id"
,
scanRange
);
Document
sort
=
new
Document
(
"_id"
,
INCLUDE
);
Document
projection
=
null
;
FindIterable
<
Document
>
findIterable
=
collection
.
find
(
query
)
.
sort
(
sort
)
.
limit
(
recordcount
);
if
(
fields
!=
null
)
{
projection
=
new
Document
();
Document
projection
=
new
Document
();
for
(
String
fieldName
:
fields
)
{
projection
.
put
(
fieldName
,
INCLUDE
);
}
findIterable
.
projection
(
projection
);
}
cursor
=
collection
.
find
(
query
)
.
projection
(
projection
).
sort
(
sort
).
limit
(
recordcount
).
iterator
();
cursor
=
findIterable
.
iterator
();
if
(!
cursor
.
hasNext
())
{
System
.
err
.
println
(
"Nothing found in scan for key "
+
startkey
);
return
1
;
...
...
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