(
&mut self,
task: &ExecutionTask,
tid: u64,
collection: &str,
entries: &[(Vec<u8>, Vec<u8>)],
ttl_ms: u64,
)
| 44 | } |
| 45 | |
| 46 | pub(in crate::data::executor) fn execute_kv_batch_put( |
| 47 | &mut self, |
| 48 | task: &ExecutionTask, |
| 49 | tid: u64, |
| 50 | collection: &str, |
| 51 | entries: &[(Vec<u8>, Vec<u8>)], |
| 52 | ttl_ms: u64, |
| 53 | ) -> Response { |
| 54 | debug!(core = self.core_id, %collection, count = entries.len(), "kv batch put"); |
| 55 | let now_ms: u64 = self |
| 56 | .epoch_system_ms |
| 57 | .map(|ms| ms as u64) |
| 58 | .unwrap_or_else(current_ms); |
| 59 | let new_count = self |
| 60 | .kv_engine |
| 61 | .batch_put(tid, collection, entries, ttl_ms, now_ms); |
| 62 | match response_codec::encode_count("inserted", new_count) { |
| 63 | Ok(payload) => self.response_with_payload(task, payload), |
| 64 | Err(e) => self.response_error( |
| 65 | task, |
| 66 | ErrorCode::Internal { |
| 67 | detail: e.to_string(), |
| 68 | }, |
| 69 | ), |
| 70 | } |
| 71 | } |
| 72 | } |
no test coverage detected