persist(ImmutableMap.of(row, replacing), System.currentTimeMillis());
return result;
}
public void persist(Map<byte[], ? extends Map<byte[], byte[]>> changes, long version) throws IOException {
DB db = getDB();
// todo support writing null when no transaction
WriteBatch batch = db.createWriteBatch();
for (Map.Entry<byte[], ? extends Map<byte[], byte[]>> row : changes.entrySet()) {
for (Map.Entry<byte[], byte[]> column : row.getValue().entrySet()) {
byte[] key = createPutKey(row.getKey(), column.getKey(), version);
batch.put(key, column.getValue() == null ? DELETE_MARKER : column.getValue());
}
}
db.write(batch, service.getWriteOptions());
}