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

Function getEntryForCommit

worker/draft_test.go:30–39  ·  view source on GitHub ↗
(index, startTs, commitTs uint64)

Source from the content-addressed store, hash-verified

28}
29
30func getEntryForCommit(index, startTs, commitTs uint64) raftpb.Entry {
31 delta := &pb.OracleDelta{}
32 delta.Txns = append(delta.Txns, &pb.TxnStatus{StartTs: startTs, CommitTs: commitTs})
33 proposal := &pb.Proposal{Delta: delta}
34 sz := proto.Size(proposal)
35 data := make([]byte, 8+sz)
36 x.Check2(x.MarshalToSizedBuffer(data[8:], proposal))
37 data = data[:8+sz]
38 return raftpb.Entry{Index: index, Term: 1, Type: raftpb.EntryNormal, Data: data}
39}
40
41func TestCalculateSnapshot(t *testing.T) {
42 dir := t.TempDir()

Callers 1

TestCalculateSnapshotFunction · 0.85

Calls 3

Check2Function · 0.92
MarshalToSizedBufferFunction · 0.92
SizeMethod · 0.45

Tested by

no test coverage detected