Skip to content
Snippets Groups Projects
Commit cb8d34bf authored by Jaemyoun's avatar Jaemyoun
Browse files

fix JSONObject bug

parent 43fd0ea0
No related branches found
No related tags found
No related merge requests found
......@@ -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());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment