Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Y
YCSB
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
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
cb8d34bf
Commit
cb8d34bf
authored
9 years ago
by
Jaemyoun
Browse files
Options
Downloads
Patches
Plain Diff
fix JSONObject bug
parent
43fd0ea0
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
rados/src/main/java/com/yahoo/ycsb/db/RadosClient.java
+9
-1
9 additions, 1 deletion
rados/src/main/java/com/yahoo/ycsb/db/RadosClient.java
with
9 additions
and
1 deletion
rados/src/main/java/com/yahoo/ycsb/db/RadosClient.java
+
9
−
1
View file @
cb8d34bf
...
...
@@ -16,11 +16,13 @@ import com.yahoo.ycsb.StringByteIterator;
import
java.io.File
;
import
java.util.HashMap
;
import
java.util.Map.Entry
;
import
java.util.Properties
;
import
java.util.Set
;
import
java.util.Vector
;
import
org.json.JSONObject
;
// import org.json.JSONString;
/**
* YCSB binding for <a href="http://redis.io/">Redis</a>.
...
...
@@ -98,6 +100,7 @@ public class RadosClient extends DB {
for
(
String
name
:
fieldsToReturn
)
{
result
.
put
(
name
,
new
StringByteIterator
(
json
.
getString
(
name
)));
// result.put(name, new StringByteIterator(json.getJSONString(name).getString()));
}
return
result
.
isEmpty
()
?
Status
.
ERROR
:
Status
.
OK
;
...
...
@@ -105,7 +108,12 @@ public class RadosClient extends DB {
@Override
public
Status
insert
(
String
table
,
String
key
,
HashMap
<
String
,
ByteIterator
>
values
)
{
JSONObject
json
=
new
JSONObject
(
values
);
// JSONObject json = new JSONObject(values);
JSONObject
json
=
new
JSONObject
();
for
(
final
Entry
<
String
,
ByteIterator
>
e
:
values
.
entrySet
())
{
json
.
put
(
e
.
getKey
(),
e
.
getValue
().
toString
());
}
try
{
ioctx
.
write
(
key
,
json
.
toString
());
...
...
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