From 4ea1a109a5b68611f3092292e372297d5cc53937 Mon Sep 17 00:00:00 2001 From: qnsy729 <735178559@qq.com> Date: Fri, 27 Mar 2026 18:36:07 +0800 Subject: [PATCH] Add comments to newBitMapAllocator in pkg/ddc/base/portallocator/bitmap_allocator.go. Signed-off-by: qnsy729 <735178559@qq.com> --- pkg/ddc/base/portallocator/bitmap_allocator.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/ddc/base/portallocator/bitmap_allocator.go b/pkg/ddc/base/portallocator/bitmap_allocator.go index 76759b89003..df290bee94e 100644 --- a/pkg/ddc/base/portallocator/bitmap_allocator.go +++ b/pkg/ddc/base/portallocator/bitmap_allocator.go @@ -35,6 +35,9 @@ func (b *BitMapAllocator) needResetReservedPorts() bool { return true } +// newBitMapAllocator creates a bitmap-based port allocator for the given port range. +// It initializes the underlying allocator and returns a BitMapAllocator instance. +// It returns an error if the allocator cannot be created. func newBitMapAllocator(pr *net.PortRange, log logr.Logger) (BatchAllocatorInterface, error) { // TODO passing offset value. alloc, err := portallocator.New(*pr, func(max int, rangeSpec string, offset int) (allocator.Interface, error) {