mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-28 22:45:26 +08:00
issue: #43897 - add ddl messages proto and add some message utilities. - support shard/exclusive resource-key-lock. - add all ddl callbacks future into broadcast registry. --------- Signed-off-by: chyezh <chyezh@outlook.com>
36 lines
999 B
Go
36 lines
999 B
Go
package ce
|
|
|
|
import (
|
|
"github.com/milvus-io/milvus/pkg/v2/proto/messagespb"
|
|
"github.com/milvus-io/milvus/pkg/v2/streaming/util/message"
|
|
)
|
|
|
|
func NewBuilder() *CacheExpirationsBuilder {
|
|
return &CacheExpirationsBuilder{
|
|
cacheExpirations: &message.CacheExpirations{
|
|
CacheExpirations: make([]*message.CacheExpiration, 0, 1),
|
|
},
|
|
}
|
|
}
|
|
|
|
type CacheExpirationsBuilder struct {
|
|
cacheExpirations *message.CacheExpirations
|
|
}
|
|
|
|
func (b *CacheExpirationsBuilder) WithLegacyProxyCollectionMetaCache(opts ...OptLegacyProxyCollectionMetaCache) *CacheExpirationsBuilder {
|
|
lpcmc := &message.LegacyProxyCollectionMetaCache{}
|
|
for _, opt := range opts {
|
|
opt(lpcmc)
|
|
}
|
|
b.cacheExpirations.CacheExpirations = append(b.cacheExpirations.CacheExpirations, &message.CacheExpiration{
|
|
Cache: &messagespb.CacheExpiration_LegacyProxyCollectionMetaCache{
|
|
LegacyProxyCollectionMetaCache: lpcmc,
|
|
},
|
|
})
|
|
return b
|
|
}
|
|
|
|
func (b *CacheExpirationsBuilder) Build() *message.CacheExpirations {
|
|
return b.cacheExpirations
|
|
}
|