MCPcopy Create free account
hub / github.com/ElementsProject/elements / DoDelete

Method DoDelete

src/leveldb/benchmarks/db_bench.cc:828–847  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

826 }
827
828 void DoDelete(ThreadState* thread, bool seq) {
829 RandomGenerator gen;
830 WriteBatch batch;
831 Status s;
832 for (int i = 0; i < num_; i += entries_per_batch_) {
833 batch.Clear();
834 for (int j = 0; j < entries_per_batch_; j++) {
835 const int k = seq ? i + j : (thread->rand.Next() % FLAGS_num);
836 char key[100];
837 snprintf(key, sizeof(key), "%016d", k);
838 batch.Delete(key);
839 thread->stats.FinishedSingleOp();
840 }
841 s = db_->Write(write_options_, &batch);
842 if (!s.ok()) {
843 fprintf(stderr, "del error: %s\n", s.ToString().c_str());
844 exit(1);
845 }
846 }
847 }
848
849 void DeleteSeq(ThreadState* thread) { DoDelete(thread, true); }
850

Callers

nothing calls this directly

Calls 6

ClearMethod · 0.45
NextMethod · 0.45
DeleteMethod · 0.45
FinishedSingleOpMethod · 0.45
WriteMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected