498b235461
Build and test / Build and test AMD64 Ubuntu 22.04 (push) Failing after 0s
Publish Builder / amazonlinux2023 (push) Failing after 1s
Build and test / UT for Go (push) Has been skipped
Publish KRTE Images / KRTE (push) Failing after 1s
Build and test / Integration Test (push) Has been skipped
Build and test / Upload Code Coverage (push) Has been skipped
Publish Builder / rockylinux9 (push) Failing after 1s
Publish Builder / ubuntu22.04 (push) Failing after 0s
Publish Builder / ubuntu24.04 (push) Failing after 0s
Publish Gpu Builder / publish-gpu-builder (push) Failing after 1s
Publish Test Images / PyTest (push) Failing after 0s
Build and test / UT for Cpp (push) Has been cancelled
31 lines
1.0 KiB
Go
31 lines
1.0 KiB
Go
package timetick
|
|
|
|
import (
|
|
"github.com/milvus-io/milvus/internal/streamingnode/server/resource"
|
|
"github.com/milvus-io/milvus/internal/streamingnode/server/wal/interceptors"
|
|
)
|
|
|
|
var _ interceptors.InterceptorBuilder = (*interceptorBuilder)(nil)
|
|
|
|
// NewInterceptorBuilder creates a new interceptor builder.
|
|
// 1. Add timetick to all message before append to wal.
|
|
// 2. Collect timetick info, and generate sync-timetick message to wal.
|
|
func NewInterceptorBuilder() interceptors.InterceptorBuilder {
|
|
return &interceptorBuilder{}
|
|
}
|
|
|
|
// interceptorBuilder is a builder to build timeTickAppendInterceptor.
|
|
type interceptorBuilder struct{}
|
|
|
|
// Build implements Builder.
|
|
func (b *interceptorBuilder) Build(param *interceptors.InterceptorBuildParam) interceptors.Interceptor {
|
|
operator := newTimeTickSyncOperator(param)
|
|
// initialize operation can be async to avoid block the build operation.
|
|
resource.Resource().TimeTickInspector().RegisterSyncOperator(operator)
|
|
|
|
return &timeTickAppendInterceptor{
|
|
operator: operator,
|
|
txnManager: param.TxnManager,
|
|
}
|
|
}
|