mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-02 17:05:33 +08:00
issue: #33285 - implement streaming service client. - implement producing and consuming service client by streaming coord client and streaming node client. Signed-off-by: chyezh <chyezh@outlook.com>
36 lines
1014 B
Go
36 lines
1014 B
Go
package wal
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/milvus-io/milvus/pkg/streaming/util/message"
|
|
"github.com/milvus-io/milvus/pkg/streaming/util/types"
|
|
)
|
|
|
|
// WAL is the WAL framework interface.
|
|
// !!! Don't implement it directly, implement walimpls.WAL instead.
|
|
type WAL interface {
|
|
WALName() string
|
|
|
|
// Channel returns the channel assignment info of the wal.
|
|
Channel() types.PChannelInfo
|
|
|
|
// Append writes a record to the log.
|
|
Append(ctx context.Context, msg message.MutableMessage) (message.MessageID, error)
|
|
|
|
// Append a record to the log asynchronously.
|
|
AppendAsync(ctx context.Context, msg message.MutableMessage, cb func(message.MessageID, error))
|
|
|
|
// Read returns a scanner for reading records from the wal.
|
|
Read(ctx context.Context, deliverPolicy ReadOption) (Scanner, error)
|
|
|
|
// Available return a channel that will be closed when the wal is available.
|
|
Available() <-chan struct{}
|
|
|
|
// IsAvailable returns if the wal is available.
|
|
IsAvailable() bool
|
|
|
|
// Close closes the wal instance.
|
|
Close()
|
|
}
|