Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 318 for Allocate (0.21 sec)

  1. pkg/registry/core/service/portallocator/storage/storage_test.go

    		t.Fatalf("unexpected error: %v", err)
    	}
    
    	// Allocate a port inside the valid port range
    	if err := storage.Allocate(30100); err != nil {
    		t.Fatal(err)
    	}
    
    	// Try to allocate the same port in the local bitmap
    	// The local bitmap stores the offset of the port
    	// offset = port - base (30100 - 30000 = 100)
    	ok, err := backing.Allocate(100)
    	if err != nil {
    		t.Fatal(err)
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 08 07:15:02 UTC 2024
    - 8.1K bytes
    - Viewed (0)
  2. pkg/registry/core/service/ipallocator/storage/storage_test.go

    		if !storage.Has(netutils.ParseIPSloppy(ip)) {
    			t.Errorf("IP %s expected to be allocated", ip)
    		}
    	}
    
    	// allocate all addresses on the static block
    	for i := 0; i < dynamicOffset; i++ {
    		ip := fmt.Sprintf("192.168.1.%d", i+1)
    		if err := storage.Allocate(netutils.ParseIPSloppy(ip)); err != nil {
    			t.Errorf("Unexpected error trying to allocate IP %s: %v", ip, err)
    		}
    	}
    	if _, err := storage.AllocateNext(); err == nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Aug 24 09:23:05 UTC 2023
    - 5.9K bytes
    - Viewed (0)
  3. pkg/scheduler/framework/plugins/dynamicresources/structured/namedresources/namedresourcesmodel.go

    }
    
    func (c *Controller) NodeIsSuitable(ctx context.Context, model Model) (bool, error) {
    	indices, err := c.allocate(ctx, model)
    	return len(indices) == len(c.requests), err
    }
    
    func (c *Controller) Allocate(ctx context.Context, model Model) ([]*resourceapi.NamedResourcesAllocationResult, error) {
    	indices, err := c.allocate(ctx, model)
    	if err != nil {
    		return nil, err
    	}
    	if len(indices) != len(c.requests) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 07 21:26:16 UTC 2024
    - 4.5K bytes
    - Viewed (0)
  4. src/runtime/traceregion.go

    		}
    
    		// Add the existing block to the full list.
    		block.next = a.full
    		a.full = block
    	}
    
    	// Allocate a new block.
    	block = (*traceRegionAllocBlock)(sysAlloc(unsafe.Sizeof(traceRegionAllocBlock{}), &memstats.other_sys))
    	if block == nil {
    		throw("traceRegion: out of memory")
    	}
    
    	// Allocate space for our current request, so we always make
    	// progress.
    	block.off.Store(n)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 17:47:01 UTC 2024
    - 3.2K bytes
    - Viewed (0)
  5. pkg/registry/core/service/portallocator/allocator.go

    		// include valid port range in error
    		validPorts := r.portRange.String()
    		return &ErrNotInRange{validPorts}
    	}
    
    	allocated, err := r.alloc.Allocate(offset)
    	if err != nil {
    		// update metrics
    		r.metrics.incrementAllocationErrors("static")
    		return err
    	}
    	if !allocated {
    		// update metrics
    		r.metrics.incrementAllocationErrors("static")
    		return ErrAllocated
    	}
    
    	// update metrics
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 08 07:15:02 UTC 2024
    - 7.4K bytes
    - Viewed (0)
  6. pkg/registry/core/service/allocator/storage/storage.go

    		baseKey:   baseKey,
    		resource:  config.GroupResource,
    		destroyFn: func() { once.Do(d) },
    	}, nil
    }
    
    // Allocate attempts to allocate the item.
    func (e *Etcd) Allocate(offset int) (bool, error) {
    	e.lock.Lock()
    	defer e.lock.Unlock()
    
    	err := e.tryUpdate(func() error {
    		ok, err := e.alloc.Allocate(offset)
    		if err != nil {
    			return err
    		}
    		if !ok {
    			return errorUnableToAllocate
    		}
    		return nil
    	})
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Aug 24 09:23:05 UTC 2023
    - 6.5K bytes
    - Viewed (0)
  7. src/internal/saferio/io.go

    // data but the input may be corrupt, or may be provided by an
    // untrustworthy attacker.
    package saferio
    
    import (
    	"io"
    	"unsafe"
    )
    
    // chunk is an arbitrary limit on how much memory we are willing
    // to allocate without concern.
    const chunk = 10 << 20 // 10M
    
    // ReadData reads n bytes from the input stream, but avoids allocating
    // all n bytes if n is large. This avoids crashing the program by
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 31 00:34:05 UTC 2023
    - 3.4K bytes
    - Viewed (0)
  8. pkg/scheduler/framework/plugins/dynamicresources/structured/namedresources/namedresourcesmodel_test.go

    			}
    
    			allocation, createErr := controller.Allocate(tCtx, tc.model)
    			if createErr != nil {
    				if !tc.expectAllocateErr {
    					tCtx.Fatalf("unexpected allocate error: %v", createErr)
    				}
    				return
    			}
    			if tc.expectAllocateErr {
    				tCtx.Fatalf("did not get expected allocate error")
    			}
    
    			expectAllocation := []*resourceapi.NamedResourcesAllocationResult{}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 27 09:27:01 UTC 2024
    - 7.9K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/io/CharSequenceReaderTest.java

        CharBuffer buf2 = CharBuffer.allocate(expected.length());
        assertEquals(expected.length() == 0 ? -1 : expected.length(), reader.read(buf2));
        Java8Compatibility.flip(buf2);
        assertEquals(expected, buf2.toString());
        assertFullyRead(reader);
    
        // read in chunks to fixed CharBuffer
        reader = new CharSequenceReader(charSequence);
        buf2 = CharBuffer.allocate(5);
        builder = new StringBuilder();
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 6.5K bytes
    - Viewed (0)
  10. pkg/kubelet/cm/devicemanager/types.go

    	// Allocate configures and assigns devices to a container in a pod. From
    	// the requested device resources, Allocate will communicate with the
    	// owning device plugin to allow setup procedures to take place, and for
    	// the device plugin to provide runtime settings to use the device
    	// (environment variables, mount points and device files).
    	Allocate(pod *v1.Pod, container *v1.Container) error
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Sep 27 13:02:15 UTC 2023
    - 5K bytes
    - Viewed (0)
Back to top