Zhen Ye 6982f007e2
enhance: add walimpls access mode options (#40591)
issue: #40532

Signed-off-by: chyezh <chyezh@outlook.com>
2025-03-14 10:58:11 +08:00

34 lines
759 B
Go

package helper
import (
"go.uber.org/zap"
"github.com/milvus-io/milvus/pkg/v2/log"
"github.com/milvus-io/milvus/pkg/v2/streaming/util/types"
"github.com/milvus-io/milvus/pkg/v2/streaming/walimpls"
)
// NewWALHelper creates a new WALHelper.
func NewWALHelper(opt *walimpls.OpenOption) *WALHelper {
return &WALHelper{
logger: log.With(zap.String("channel", opt.Channel.String())),
channel: opt.Channel,
}
}
// WALHelper is a helper for WAL implementation.
type WALHelper struct {
logger *log.MLogger
channel types.PChannelInfo
}
// Channel returns the channel of the WAL.
func (w *WALHelper) Channel() types.PChannelInfo {
return w.channel
}
// Log returns the logger of the WAL.
func (w *WALHelper) Log() *log.MLogger {
return w.logger
}