chyezh ba04981a43
enhance: implement wal managerment on streaming node (#34153)
issue: #33285

- add lifetime control for wal.
- implement distributed-safe wal manager on streaming node.

---------

Signed-off-by: chyezh <chyezh@outlook.com>
2024-07-05 14:29:42 +08:00

30 lines
900 B
Go

package walmanager
import (
"context"
"github.com/milvus-io/milvus/internal/streamingnode/server/wal"
"github.com/milvus-io/milvus/pkg/streaming/util/types"
)
var _ Manager = (*managerImpl)(nil)
// Manager is the interface for managing the wal instances.
type Manager interface {
// Open opens a wal instance for the channel on this Manager.
Open(ctx context.Context, channel types.PChannelInfo) error
// GetAvailableWAL returns a available wal instance for the channel.
// Return nil if the wal instance is not found.
GetAvailableWAL(channelName string, term int64) (wal.WAL, error)
// GetAllAvailableWALInfo returns all available channel info.
GetAllAvailableChannels() ([]types.PChannelInfo, error)
// Remove removes the wal instance for the channel.
Remove(ctx context.Context, channel types.PChannelInfo) error
// Close these manager and release all managed WAL.
Close()
}