forked from cockroachdb/pebble
-
Notifications
You must be signed in to change notification settings - Fork 0
/
error_iter.go
97 lines (74 loc) · 2.71 KB
/
error_iter.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// Copyright 2018 The LevelDB-Go and Pebble Authors. All rights reserved. Use
// of this source code is governed by a BSD-style license that can be found in
// the LICENSE file.
package pebble
import (
"context"
"github.com/cockroachdb/pebble/internal/base"
"github.com/cockroachdb/pebble/internal/keyspan"
"github.com/cockroachdb/pebble/internal/treeprinter"
)
type errorIter struct {
err error
}
// errorIter implements the base.InternalIterator interface.
var _ internalIterator = (*errorIter)(nil)
func (c *errorIter) SeekGE(key []byte, flags base.SeekGEFlags) *base.InternalKV {
return nil
}
func (c *errorIter) SeekPrefixGE(prefix, key []byte, flags base.SeekGEFlags) *base.InternalKV {
return c.SeekPrefixGEStrict(prefix, key, flags)
}
func (c *errorIter) SeekPrefixGEStrict(
prefix, key []byte, flags base.SeekGEFlags,
) *base.InternalKV {
return nil
}
func (c *errorIter) SeekLT(key []byte, flags base.SeekLTFlags) *base.InternalKV {
return nil
}
func (c *errorIter) First() *base.InternalKV {
return nil
}
func (c *errorIter) Last() *base.InternalKV {
return nil
}
func (c *errorIter) Next() *base.InternalKV {
return nil
}
func (c *errorIter) Prev() *base.InternalKV {
return nil
}
func (c *errorIter) NextPrefix([]byte) *base.InternalKV {
return nil
}
func (c *errorIter) Error() error {
return c.err
}
func (c *errorIter) Close() error {
return c.err
}
func (c *errorIter) String() string {
return "error"
}
func (c *errorIter) SetBounds(lower, upper []byte) {}
func (c *errorIter) SetContext(_ context.Context) {}
func (c *errorIter) DebugTree(tp treeprinter.Node) {
tp.Childf("%T(%p)", c, c)
}
type errorKeyspanIter struct {
err error
}
// errorKeyspanIter implements the keyspan.FragmentIterator interface.
var _ keyspan.FragmentIterator = (*errorKeyspanIter)(nil)
func (i *errorKeyspanIter) SeekGE(key []byte) (*keyspan.Span, error) { return nil, i.err }
func (i *errorKeyspanIter) SeekLT(key []byte) (*keyspan.Span, error) { return nil, i.err }
func (i *errorKeyspanIter) First() (*keyspan.Span, error) { return nil, i.err }
func (i *errorKeyspanIter) Last() (*keyspan.Span, error) { return nil, i.err }
func (i *errorKeyspanIter) Next() (*keyspan.Span, error) { return nil, i.err }
func (i *errorKeyspanIter) Prev() (*keyspan.Span, error) { return nil, i.err }
func (i *errorKeyspanIter) SetContext(ctx context.Context) {}
func (i *errorKeyspanIter) Close() {}
func (*errorKeyspanIter) String() string { return "error" }
func (*errorKeyspanIter) WrapChildren(wrap keyspan.WrapFn) {}
func (i *errorKeyspanIter) DebugTree(tp treeprinter.Node) { tp.Childf("%T(%p)", i, i) }