mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-01 00:15:30 +08:00
issue: #33285 - add adaptor to implement walimpls into wal interface. - implement timetick sorted and filtering scanner. - add test for wal. --------- Signed-off-by: chyezh <chyezh@outlook.com>
32 lines
868 B
Go
32 lines
868 B
Go
package wal
|
|
|
|
import (
|
|
"github.com/milvus-io/milvus/pkg/streaming/util/message"
|
|
"github.com/milvus-io/milvus/pkg/streaming/util/options"
|
|
)
|
|
|
|
type MessageFilter = func(message.ImmutableMessage) bool
|
|
|
|
// ReadOption is the option for reading records from the wal.
|
|
type ReadOption struct {
|
|
DeliverPolicy options.DeliverPolicy
|
|
MessageFilter MessageFilter
|
|
}
|
|
|
|
// Scanner is the interface for reading records from the wal.
|
|
type Scanner interface {
|
|
// Chan returns the channel of message.
|
|
Chan() <-chan message.ImmutableMessage
|
|
|
|
// Error returns the error of scanner failed.
|
|
// Will block until scanner is closed or Chan is dry out.
|
|
Error() error
|
|
|
|
// Done returns a channel which will be closed when scanner is finished or closed.
|
|
Done() <-chan struct{}
|
|
|
|
// Close the scanner, release the underlying resources.
|
|
// Return the error same with `Error`
|
|
Close() error
|
|
}
|