Search in sources :

Example 1 with Value

use of oracle.kv.Value in project YCSB by brianfrankcooper.

the class NoSqlDbClient method update.

@Override
public Status update(String table, String key, HashMap<String, ByteIterator> values) {
    for (Map.Entry<String, ByteIterator> entry : values.entrySet()) {
        Key kvKey = createKey(table, key, entry.getKey());
        Value kvValue = Value.createValue(entry.getValue().toArray());
        try {
            store.put(kvKey, kvValue);
        } catch (FaultException e) {
            System.err.println(e);
            return Status.ERROR;
        }
    }
    return Status.OK;
}
Also used : FaultException(oracle.kv.FaultException) ByteArrayByteIterator(com.yahoo.ycsb.ByteArrayByteIterator) ByteIterator(com.yahoo.ycsb.ByteIterator) Value(oracle.kv.Value) HashMap(java.util.HashMap) Map(java.util.Map) SortedMap(java.util.SortedMap) Key(oracle.kv.Key)

Aggregations

ByteArrayByteIterator (com.yahoo.ycsb.ByteArrayByteIterator)1 ByteIterator (com.yahoo.ycsb.ByteIterator)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 SortedMap (java.util.SortedMap)1 FaultException (oracle.kv.FaultException)1 Key (oracle.kv.Key)1 Value (oracle.kv.Value)1