func (h *blockHarness) eoi(pref string, iter iterator.Iterator) { if iter.Next() { h.t.Fatalf("block: %sNext: expect eoi", pref) } else if err := iter.Error(); err != nil { h.t.Fatalf("block: %sNext: expect eoi but got error, err=%v", pref, err) } }
// Builds table from src iterator. func (t *tOps) createFrom(src iterator.Iterator) (f *tFile, n int, err error) { w, err := t.create() if err != nil { return f, n, err } defer func() { if err != nil { w.drop() } }() for src.Next() { err = w.append(src.Key(), src.Value()) if err != nil { return } } err = src.Error() if err != nil { return } n = w.tw.EntriesLen() f, err = w.finish() return }
func (h *blockHarness) next(pref string, iter iterator.Iterator) { if !iter.Next() { h.t.Fatalf("block: %sNext: eoi, err=%v", pref, iter.Error()) } }