MCPcopy Create free account
hub / github.com/apple/foundationdb / bulkLoadClient

Method bulkLoadClient

fdbserver/workloads/BulkLoad.actor.cpp:81–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79 }
80
81 ACTOR Future<Void> bulkLoadClient(Database cx, BulkLoadWorkload* self, int clientId, int actorId) {
82 state uint64_t totalBytes = 0;
83 state int idx = 0;
84 loop {
85 state double tstart = now();
86 state Transaction tr(cx);
87 loop {
88 state uint64_t txnBytes = 0;
89 try {
90 for (int i = 0; i < self->writesPerTransaction; i++) {
91 std::string key = format("%s/bulkload/%04x/%04x/%08x",
92 self->keyPrefix.toString().c_str(),
93 self->clientId,
94 actorId,
95 idx + i);
96 tr.set(key, self->value);
97 txnBytes += key.size() + self->value.size();
98 }
99 tr.makeSelfConflicting();
100 wait(success(tr.getReadVersion()));
101 wait(tr.commit());
102 totalBytes += txnBytes;
103 break;
104 } catch (Error& e) {
105 wait(tr.onError(e));
106 ++self->retries;
107 }
108 }
109 self->latencies.addSample(now() - tstart);
110 ++self->transactions;
111 idx += self->writesPerTransaction;

Callers

nothing calls this directly

Calls 10

nowFunction · 0.85
setMethod · 0.65
getReadVersionMethod · 0.65
commitMethod · 0.65
onErrorMethod · 0.65
formatFunction · 0.50
c_strMethod · 0.45
toStringMethod · 0.45
sizeMethod · 0.45
makeSelfConflictingMethod · 0.45

Tested by

no test coverage detected