diff --git a/rados/src/main/java/com/yahoo/ycsb/db/RadosClient.java b/rados/src/main/java/com/yahoo/ycsb/db/RadosClient.java index a53ec8365b81f06c24618c944a861e5ad4f8813e..c9c7bda11f6dc726e85af9e365130142b1cc7bb5 100644 --- a/rados/src/main/java/com/yahoo/ycsb/db/RadosClient.java +++ b/rados/src/main/java/com/yahoo/ycsb/db/RadosClient.java @@ -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());