updateMKVBatch

  1. int updateMKVBatch(const UpdateMKVBatchReq &req, MKVBatchWriteRsp &rsp)

功能: 批量更新数据

参数:

  1. struct UpdateMKVBatchReq
  2. {
  3. 1 require string moduleName; //模块名
  4. 2 require vector<UpdateKeyValue> data; //更新数据集合
  5. };
  6. struct UpdateKeyValue
  7. {
  8. 1 require string mainKey; //主键
  9. 2 require map<string, UpdateFieldInfo> mpValue; //更新数据
  10. 3 require byte ver = 0; //数据版本号
  11. 4 require bool dirty = true; //是否设置为脏数据
  12. 5 require bool insert = false; //如果要修改的唯一记录不存在且insert为true时则插入一条数据
  13. 6 require int expireTimeSecond = 0; //过期时间
  14. };
  15. struct MKVBatchWriteRsp
  16. {
  17. 1 require map<int, int> rspData; //键:批量请求中data的index,值:更新失败的原因;只返回更新失败的数据,如果rspData为空,则表示全部更新成功
  18. };

返回值

返回值 含义
ET_MODULE_NAME_INVALID 模块名错误
ET_INPUT_PARAM_ERROR 更新数据集合中存在mainKey为空的元素或者主键数量超过限制
ET_KEY_INVALID mainKey无效
ET_SYS_ERR 系统异常
ET_SUCC 批量更新操作完成