MCPcopy
hub / github.com/dgraph-io/dgraph / commitTransaction

Function commitTransaction

worker/worker_test.go:44–57  ·  view source on GitHub ↗
(t *testing.T, edge *pb.DirectedEdge, l *posting.List)

Source from the content-addressed store, hash-verified

42}
43
44func commitTransaction(t *testing.T, edge *pb.DirectedEdge, l *posting.List) {
45 startTs := timestamp()
46 txn := posting.Oracle().RegisterStartTs(startTs)
47 l = txn.Store(l)
48 l.SetTs(startTs)
49 require.NoError(t, l.AddMutationWithIndex(context.Background(), edge, txn))
50
51 commit := commitTs(startTs)
52
53 txn.Update()
54 writer := posting.NewTxnWriter(pstore)
55 require.NoError(t, txn.CommitToDisk(writer, commit))
56 require.NoError(t, writer.Flush())
57}
58
59func timestamp() uint64 {
60 return atomic.AddUint64(&ts, 1)

Callers 2

addEdgeFunction · 0.85
delEdgeFunction · 0.85

Calls 11

FlushMethod · 0.95
OracleFunction · 0.92
NewTxnWriterFunction · 0.92
commitTsFunction · 0.85
RegisterStartTsMethod · 0.80
SetTsMethod · 0.80
AddMutationWithIndexMethod · 0.80
CommitToDiskMethod · 0.80
timestampFunction · 0.70
StoreMethod · 0.45
UpdateMethod · 0.45

Tested by

no test coverage detected