Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for SimpleUpdate (0.17 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. staging/src/k8s.io/apiextensions-apiserver/pkg/registry/customresourcedefinition/etcd.go

    		out := r.Store.NewFunc()
    		err = r.Store.Storage.GuaranteedUpdate(
    			ctx, key, out, false, &preconditions,
    			storage.SimpleUpdate(func(existing runtime.Object) (runtime.Object, error) {
    				existingCRD, ok := existing.(*apiextensions.CustomResourceDefinition)
    				if !ok {
    					// wrong type
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Nov 18 09:21:19 UTC 2022
    - 8K bytes
    - Viewed (0)
  8. 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)
  9. pkg/registry/core/namespace/storage/storage.go

    		out := r.store.NewFunc()
    		err = r.store.Storage.GuaranteedUpdate(
    			ctx, key, out, false, &preconditions,
    			storage.SimpleUpdate(func(existing runtime.Object) (runtime.Object, error) {
    				existingNamespace, ok := existing.(*api.Namespace)
    				if !ok {
    					// wrong type
    					return nil, fmt.Errorf("expected *api.Namespace, got %v", existing)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Nov 18 09:21:19 UTC 2022
    - 13.4K bytes
    - Viewed (0)
  10. pkg/registry/core/pod/storage/storage.go

    		}
    		if podResourceVersion != "" {
    			preconditions.ResourceVersion = &podResourceVersion
    		}
    	}
    
    	err = r.store.Storage.GuaranteedUpdate(ctx, podKey, &api.Pod{}, false, preconditions, storage.SimpleUpdate(func(obj runtime.Object) (runtime.Object, error) {
    		pod, ok := obj.(*api.Pod)
    		if !ok {
    			return nil, fmt.Errorf("unexpected object: %#v", obj)
    		}
    		if pod.DeletionTimestamp != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Mar 20 14:29:25 UTC 2023
    - 13.7K bytes
    - Viewed (0)
Back to top