tsdb/wal: Move comment of w.writer.Append(...) to the WriteTo interface (#10198)
Signed-off-by: wanglipeng <wanglipeng@huayun.com> Co-authored-by: wanglipeng <wanglipeng@huayun.com>
This commit is contained in:
parent
500cfd0b6f
commit
9fde6edbf5
|
@ -45,9 +45,14 @@ const (
|
||||||
// from the WAL on to somewhere else. Functions will be called concurrently
|
// from the WAL on to somewhere else. Functions will be called concurrently
|
||||||
// and it is left to the implementer to make sure they are safe.
|
// and it is left to the implementer to make sure they are safe.
|
||||||
type WriteTo interface {
|
type WriteTo interface {
|
||||||
|
// Append and AppendExemplar should block until the samples are fully accepted,
|
||||||
|
// whether enqueued in memory or successfully written to it's final destination.
|
||||||
|
// Once returned, the WAL Watcher will not attempt to pass that data again.
|
||||||
Append([]record.RefSample) bool
|
Append([]record.RefSample) bool
|
||||||
AppendExemplars([]record.RefExemplar) bool
|
AppendExemplars([]record.RefExemplar) bool
|
||||||
|
|
||||||
StoreSeries([]record.RefSeries, int)
|
StoreSeries([]record.RefSeries, int)
|
||||||
|
|
||||||
// Next two methods are intended for garbage-collection: first we call
|
// Next two methods are intended for garbage-collection: first we call
|
||||||
// UpdateSeriesSegment on all current series
|
// UpdateSeriesSegment on all current series
|
||||||
UpdateSeriesSegment([]record.RefSeries, int)
|
UpdateSeriesSegment([]record.RefSeries, int)
|
||||||
|
@ -511,7 +516,6 @@ func (w *Watcher) readSegment(r *LiveReader, segmentNum int, tail bool) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(send) > 0 {
|
if len(send) > 0 {
|
||||||
// Blocks until the sample is sent to all remote write endpoints or closed (because enqueue blocks).
|
|
||||||
w.writer.Append(send)
|
w.writer.Append(send)
|
||||||
send = send[:0]
|
send = send[:0]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue