Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 24 for allocateNext (0.32 sec)

  1. pkg/registry/core/service/ipallocator/bitmap.go

    	r.metrics.setAvailable(label.String(), r.Free())
    
    	return nil
    }
    
    // AllocateNext reserves one of the IPs from the pool. ErrFull may
    // be returned if there are no addresses left.
    func (r *Range) AllocateNext() (net.IP, error) {
    	return r.allocateNext(dryRunFalse)
    }
    
    func (r *Range) allocateNext(dryRun bool) (net.IP, error) {
    	label := r.CIDR()
    	if dryRun {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jan 25 20:32:40 UTC 2023
    - 10.8K bytes
    - Viewed (0)
  2. pkg/registry/core/service/allocator/storage/storage.go

    		}
    		return false, err
    	}
    	return true, nil
    }
    
    // AllocateNext attempts to allocate the next item.
    func (e *Etcd) AllocateNext() (int, bool, error) {
    	e.lock.Lock()
    	defer e.lock.Unlock()
    	var offset int
    	var ok bool
    	var err error
    
    	err = e.tryUpdate(func() error {
    		// update the offset here
    		offset, ok, err = e.alloc.AllocateNext()
    		if err != nil {
    			return err
    		}
    		if !ok {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Aug 24 09:23:05 UTC 2023
    - 6.5K bytes
    - Viewed (0)
  3. pkg/registry/core/service/portallocator/allocator.go

    	r.metrics.setAllocated(r.Used())
    	r.metrics.setAvailable(r.Free())
    
    	return nil
    }
    
    // AllocateNext reserves one of the ports from the pool. ErrFull may
    // be returned if there are no ports left.
    func (r *PortAllocator) AllocateNext() (int, error) {
    	offset, ok, err := r.alloc.AllocateNext()
    	if err != nil {
    		r.metrics.incrementAllocationErrors("dynamic")
    		return 0, err
    	}
    	if !ok {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 08 07:15:02 UTC 2024
    - 7.4K bytes
    - Viewed (0)
  4. pkg/registry/core/service/portallocator/operation.go

    	err := op.pa.Allocate(port)
    	if err == nil {
    		op.allocated = append(op.allocated, port)
    	}
    	return err
    }
    
    // Allocates a port, and record it for future rollback
    func (op *PortAllocationOperation) AllocateNext() (int, error) {
    	if op.dryRun {
    		// Find the max element of the allocated ports array.
    		// If no ports are already being allocated by this operation,
    		// then choose a sensible guess for a dummy port number
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jul 26 17:14:05 UTC 2022
    - 4.2K bytes
    - Viewed (0)
  5. pkg/registry/core/service/allocator/bitmap.go

    		return false, nil
    	}
    	r.allocated = r.allocated.SetBit(r.allocated, offset, 1)
    	r.count++
    	return true, nil
    }
    
    // AllocateNext reserves one of the items from the pool.
    // (0, false, nil) may be returned if there are no items left.
    func (r *AllocationBitmap) AllocateNext() (int, bool, error) {
    	r.lock.Lock()
    	defer r.lock.Unlock()
    
    	next, ok := r.strategy.AllocateBit(r.allocated, r.max, r.count)
    	if !ok {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jan 25 20:32:40 UTC 2023
    - 7.6K bytes
    - Viewed (0)
  6. pkg/registry/core/service/allocator/interfaces.go

    limitations under the License.
    */
    
    package allocator
    
    // Interface manages the allocation of items out of a range. Interface
    // should be threadsafe.
    type Interface interface {
    	Allocate(int) (bool, error)
    	AllocateNext() (int, bool, error)
    	Release(int) error
    	ForEach(func(int))
    	Has(int) bool
    	Free() int
    
    	// Destroy shuts down all internal structures.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 22 10:35:43 UTC 2023
    - 1.4K bytes
    - Viewed (0)
  7. pkg/registry/core/service/ipallocator/interfaces.go

    	"net"
    
    	api "k8s.io/kubernetes/pkg/apis/core"
    )
    
    // Interface manages the allocation of IP addresses out of a range. Interface
    // should be threadsafe.
    type Interface interface {
    	Allocate(net.IP) error
    	AllocateNext() (net.IP, error)
    	Release(net.IP) error
    	ForEach(func(net.IP))
    	CIDR() net.IPNet
    	IPFamily() api.IPFamily
    	Has(ip net.IP) bool
    	Destroy()
    	EnableMetrics()
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Oct 31 21:05:04 UTC 2023
    - 1.6K bytes
    - Viewed (0)
  8. pkg/controller/nodeipam/ipam/cidrset/cidr_set.go

    		}
    	}
    	return &net.IPNet{
    		IP:   ip,
    		Mask: s.nodeMask,
    	}
    }
    
    // AllocateNext allocates the next free CIDR range. This will set the range
    // as occupied and return the allocated range.
    func (s *CidrSet) AllocateNext() (*net.IPNet, error) {
    	s.Lock()
    	defer s.Unlock()
    
    	if s.allocatedCIDRs == s.maxCIDRs {
    		return nil, ErrCIDRRangeNoCIDRsRemaining
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 11 08:53:03 UTC 2023
    - 9.4K bytes
    - Viewed (0)
  9. pkg/registry/core/service/ipallocator/ipallocator.go

    	}
    	return a.createIPAddress(ip.String(), svc, "static")
    }
    
    // AllocateNext return an IP address that wasn't allocated yet.
    // Only for testing, it will fail to create the IPAddress object because
    // the Service reference is required.
    func (a *Allocator) AllocateNext() (net.IP, error) {
    	return a.AllocateNextService(nil)
    }
    
    // AllocateNext return an IP address that wasn't allocated yet.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Oct 31 21:05:04 UTC 2023
    - 17K bytes
    - Viewed (0)
  10. pkg/registry/core/service/ipallocator/cidrallocator.go

    		ip, err := allocator.AllocateNextService(service)
    		if err == nil {
    			return ip, nil
    		}
    	}
    	return nil, ErrFull
    }
    
    func (c *MetaAllocator) AllocateNext() (net.IP, error) {
    	c.muTree.Lock()
    	defer c.muTree.Unlock()
    
    	// TODO(aojea) add strategy to return a random allocator but
    	// taking into consideration the number of addresses of each allocator.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat May 04 18:33:12 UTC 2024
    - 13.2K bytes
    - Viewed (0)
Back to top