mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-03 17:31:58 +08:00
issue: #33285 - use reader but not consumer for pulsar - advanced test framework - move some streaming related package into pkg --------- Signed-off-by: chyezh <chyezh@outlook.com>
34 lines
738 B
Go
34 lines
738 B
Go
package helper
|
|
|
|
import (
|
|
"go.uber.org/zap"
|
|
|
|
"github.com/milvus-io/milvus/pkg/log"
|
|
"github.com/milvus-io/milvus/pkg/streaming/util/types"
|
|
"github.com/milvus-io/milvus/pkg/streaming/walimpls"
|
|
)
|
|
|
|
// NewWALHelper creates a new WALHelper.
|
|
func NewWALHelper(opt *walimpls.OpenOption) *WALHelper {
|
|
return &WALHelper{
|
|
logger: log.With(zap.Any("channel", opt.Channel)),
|
|
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
|
|
}
|