Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for SimpleUpdate (0.2 sec)

  1. src/hash/crc32/crc32_generic.go

    // polynomial. The table is suitable for use with the simple algorithm
    // (simpleUpdate).
    func simpleMakeTable(poly uint32) *Table {
    	t := new(Table)
    	simplePopulateTable(poly, t)
    	return t
    }
    
    // simplePopulateTable constructs a Table for the specified polynomial, suitable
    // for use with simpleUpdate.
    func simplePopulateTable(poly uint32, t *Table) {
    	for i := 0; i < 256; i++ {
    		crc := uint32(i)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat May 18 22:36:41 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  2. pkg/registry/core/service/allocator/storage/storage.go

    func (e *Etcd) tryUpdate(fn func() error) error {
    	err := e.storage.GuaranteedUpdate(context.TODO(), e.baseKey, &api.RangeAllocation{}, true, nil,
    		storage.SimpleUpdate(func(input runtime.Object) (output runtime.Object, err error) {
    			existing := input.(*api.RangeAllocation)
    			if len(existing.ResourceVersion) == 0 {
    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. staging/src/k8s.io/apiserver/pkg/storage/util.go

    	"k8s.io/apimachinery/pkg/labels"
    	"k8s.io/apimachinery/pkg/runtime"
    )
    
    type SimpleUpdateFunc func(runtime.Object) (runtime.Object, error)
    
    // SimpleUpdateFunc converts SimpleUpdateFunc into UpdateFunc
    func SimpleUpdate(fn SimpleUpdateFunc) UpdateFunc {
    	return func(input runtime.Object, _ ResponseMeta) (runtime.Object, *uint64, error) {
    		out, err := fn(input)
    		return out, nil, err
    	}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 18 08:05:06 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  4. src/hash/crc32/crc32_test.go

    func TestSimple(t *testing.T) {
    	tab := simpleMakeTable(IEEE)
    	testGoldenIEEE(t, func(b []byte) uint32 {
    		return simpleUpdate(0, tab, b)
    	})
    
    	tab = simpleMakeTable(Castagnoli)
    	testGoldenCastagnoli(t, func(b []byte) uint32 {
    		return simpleUpdate(0, tab, b)
    	})
    }
    
    func TestGoldenMarshal(t *testing.T) {
    	t.Run("IEEE", func(t *testing.T) {
    		for _, g := range golden {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 03 14:56:25 UTC 2024
    - 12.1K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apiserver/pkg/storage/testing/store_tests.go

    	// passed originalPod, and make sure that SimpleUpdate is called a second time after a live lookup
    	// with the value of updatedPod.
    	sawConflict := false
    	updatedPod2 := &example.Pod{}
    	err = store.GuaranteedUpdate(ctx, key, updatedPod2, false, nil,
    		storage.SimpleUpdate(func(obj runtime.Object) (runtime.Object, error) {
    			pod := obj.(*example.Pod)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 11 12:45:33 UTC 2024
    - 91.4K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/storage/testing/watcher_tests.go

    			// that its corresponding event will not be propagated.
    			badKey := fmt.Sprintf("/pods/%s-bad/foo", tt.namespace)
    			badOut := &example.Pod{}
    			err = store.GuaranteedUpdate(ctx, badKey, badOut, true, nil, storage.SimpleUpdate(
    				func(runtime.Object) (runtime.Object, error) {
    					obj := basePod.DeepCopy()
    					obj.Namespace = fmt.Sprintf("%s-bad", tt.namespace)
    					return obj, nil
    				}), nil)
    			if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 63.8K bytes
    - Viewed (0)
  7. src/hash/crc32/crc32.go

    		return updateCastagnoli(crc, p)
    	case tab == IEEETable:
    		if checkInitIEEE {
    			ieeeOnce.Do(ieeeInit)
    		}
    		return updateIEEE(crc, p)
    	default:
    		return simpleUpdate(crc, tab, p)
    	}
    }
    
    // Update returns the result of adding the bytes in p to the crc.
    func Update(crc uint32, tab *Table, p []byte) uint32 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun May 12 05:36:29 UTC 2024
    - 7.5K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiserver/pkg/registry/generic/registry/store.go

    	lastGraceful := int64(0)
    	var pendingFinalizers bool
    	out = e.NewFunc()
    	err = e.Storage.GuaranteedUpdate(
    		ctx,
    		key,
    		out,
    		false, /* ignoreNotFound */
    		&preconditions,
    		storage.SimpleUpdate(func(existing runtime.Object) (runtime.Object, error) {
    			if err := deleteValidation(ctx, existing); err != nil {
    				return nil, err
    			}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jan 19 23:22:44 UTC 2024
    - 60.8K bytes
    - Viewed (0)
Back to top