Zhen Ye d3e32bb599
enhance: make pchannel level flusher (#39275)
issue: #38399

- Add a pchannel level checkpoint for flush processing
- Refactor the recovery of flushers of wal
- make a shared wal scanner first, then make multi datasyncservice on it

Signed-off-by: chyezh <chyezh@outlook.com>
2025-02-10 16:32:45 +08:00

35 lines
955 B
Go

package adaptor
import (
"github.com/milvus-io/milvus/internal/streamingnode/server/wal"
"github.com/milvus-io/milvus/internal/streamingnode/server/wal/interceptors"
"github.com/milvus-io/milvus/pkg/streaming/walimpls"
)
var _ wal.OpenerBuilder = (*builderAdaptorImpl)(nil)
func AdaptImplsToBuilder(builder walimpls.OpenerBuilderImpls, interceptorBuilders ...interceptors.InterceptorBuilder) wal.OpenerBuilder {
return builderAdaptorImpl{
builder: builder,
interceptorBuilders: interceptorBuilders,
}
}
type builderAdaptorImpl struct {
builder walimpls.OpenerBuilderImpls
interceptorBuilders []interceptors.InterceptorBuilder
}
func (b builderAdaptorImpl) Name() string {
return b.builder.Name()
}
func (b builderAdaptorImpl) Build() (wal.Opener, error) {
o, err := b.builder.Build()
if err != nil {
return nil, err
}
// Add all interceptor here.
return adaptImplsToOpener(o, b.interceptorBuilders), nil
}