milvus/internal/allocator/id_allocator.go
zhenshan.cao 27b9a51938 Add logic of allocate id
Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
2020-10-30 16:27:58 +08:00

36 lines
562 B
Go

package allocator
import (
"github.com/zilliztech/milvus-distributed/internal/util/typeutil"
)
type IdAllocator struct {
}
func (allocator *IdAllocator) Initialize() error {
return nil
}
func (allocator *IdAllocator) Start() error{
return nil
}
func (allocator *IdAllocator) Close() error{
return nil
}
func (allocator *IdAllocator) AllocOne() typeutil.Id {
return 1
}
func (allocator *IdAllocator) Alloc(count uint32) ([]typeutil.Id, error){
return make([]typeutil.Id, count), nil
}
func NewIdAllocator() *IdAllocator{
return &IdAllocator{}
}