MCPcopy Create free account
hub / github.com/brimdata/super / Commit

Method Commit

db/journal/queue.go:97–106  ·  view source on GitHub ↗

XXX This needs concurrency work. See issue #2546.

(ctx context.Context, b []byte)

Source from the content-addressed store, hash-verified

95
96// XXX This needs concurrency work. See issue #2546.
97func (q *Queue) Commit(ctx context.Context, b []byte) (ID, error) {
98 head, err := q.ReadHead(ctx)
99 if err != nil {
100 return Nil, err
101 }
102 if err := q.CommitAt(ctx, head, b); err != nil {
103 return Nil, err
104 }
105 return head + 1, err
106}
107
108// CommitAt commits a new serialized BSUP sequence to the journal presuming
109// the previous state conformed to the journal position "at". The entry is

Callers 1

TestJournalConcurrentFunction · 0.80

Calls 2

ReadHeadMethod · 0.95
CommitAtMethod · 0.95

Tested by 1

TestJournalConcurrentFunction · 0.64