Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for Int63n (0.22 sec)

  1. cmd/erasure-decode_test.go

    	r := rand.New(rand.NewSource(UTCNow().UnixNano()))
    
    	buf := &bytes.Buffer{}
    
    	// Verify erasure.Decode() for random offsets and lengths.
    	for i := 0; i < iterations; i++ {
    		offset := r.Int63n(length)
    		readLen := r.Int63n(length - offset)
    
    		expected := data[offset : offset+readLen]
    
    		// Get the checksums of the current part.
    		bitrotReaders := make([]io.ReaderAt, len(disks))
    		for index, disk := range disks {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Jan 30 20:43:25 GMT 2024
    - 21.1K bytes
    - Viewed (1)
  2. cmd/bootstrap-peer-server.go

    		select {
    		case <-ctx.Done():
    			return ctx.Err()
    		default:
    			// Sleep and stagger to avoid blocked CPU and thundering
    			// herd upon start up sequence.
    			time.Sleep(25*time.Millisecond + time.Duration(rand.Int63n(int64(100*time.Millisecond))))
    			retries++
    			// after 20 retries start logging that servers are not reachable yet
    			if retries >= 20 {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 7.5K bytes
    - Viewed (0)
  3. cmd/bucket-metadata-sys.go

    	for index := range buckets {
    		index := index
    		g.Go(func() error {
    			// Sleep and stagger to avoid blocked CPU and thundering
    			// herd upon start up sequence.
    			time.Sleep(25*time.Millisecond + time.Duration(rand.Int63n(int64(100*time.Millisecond))))
    
    			_, _ = sys.objAPI.HealBucket(ctx, buckets[index].Name, madmin.HealOpts{Recreate: true})
    			meta, err := loadBucketMetadata(ctx, sys.objAPI, buckets[index].Name)
    			if err != nil {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 19.2K bytes
    - Viewed (0)
  4. cmd/data-usage-cache.go

    		}
    		retry, err = load(name+".bkp", 30*time.Second)
    		if err == nil && !retry {
    			// Only return when we have valid data from the backup
    			break
    		}
    		retries++
    		time.Sleep(time.Duration(rand.Int63n(int64(time.Second))))
    	}
    
    	if retries == 5 {
    		scannerLogOnceIf(ctx, fmt.Errorf("maximum retry reached to load the data usage cache `%s`", name), "retry-loading-data-usage-cache")
    	}
    
    	return nil
    }
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 41.3K bytes
    - Viewed (1)
  5. cmd/xl-storage-disk-id-check.go

    				p.health.waiting.Add(1)
    				go p.monitorDiskStatus(spent, fn)
    			}
    		}
    
    		// Offset checks a bit.
    		time.Sleep(time.Duration(rng.Int63n(int64(1 * time.Second))))
    
    		dctx, dcancel := context.WithCancel(ctx)
    		started := time.Now()
    		go func() {
    			timeout := time.NewTimer(globalDriveConfig.GetMaxTimeout())
    			select {
    			case <-dctx.Done():
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Apr 15 08:25:46 GMT 2024
    - 32.7K bytes
    - Viewed (0)
  6. internal/grid/connection.go

    		c.connMu.Unlock()
    		retry := func(err error) {
    			if debugPrint {
    				fmt.Printf("%v Connecting to %v: %v. Retrying.\n", c.Local, toDial, err)
    			}
    			sleep := defaultDialTimeout + time.Duration(rng.Int63n(int64(defaultDialTimeout)))
    			next := dialStarted.Add(sleep / 2)
    			sleep = time.Until(next).Round(time.Millisecond)
    			if sleep < 0 {
    				sleep = 0
    			}
    			gotState := c.State()
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 42.6K bytes
    - Viewed (0)
  7. cmd/bucket-replication.go

    		cancel()
    		if err == nil {
    			break
    		}
    		if minio.ToErrorResponse(err).Code == "PreconditionFailed" {
    			return err
    		}
    		attempts++
    		time.Sleep(time.Duration(rand.Int63n(int64(time.Second))))
    	}
    	if err != nil {
    		return err
    	}
    
    	defer func() {
    		if err != nil {
    			// block and abort remote upload upon failure.
    			attempts := 1
    			for attempts <= 3 {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sat Apr 20 09:05:54 GMT 2024
    - 112K bytes
    - Viewed (1)
  8. internal/dsync/locked_rand.go

    type lockedRandSource struct {
    	lk  sync.Mutex
    	src rand.Source
    }
    
    // Int63 returns a non-negative pseudo-random 63-bit integer as an int64.
    func (r *lockedRandSource) Int63() (n int64) {
    	r.lk.Lock()
    	n = r.src.Int63()
    	r.lk.Unlock()
    	return
    }
    
    // Seed uses the provided seed value to initialize the generator to a
    // deterministic state.
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Oct 18 15:39:59 GMT 2021
    - 1.3K bytes
    - Viewed (0)
  9. api/go1.22.txt

    pkg math/rand/v2, func Int() int #61716
    pkg math/rand/v2, func Int32() int32 #61716
    pkg math/rand/v2, func Int32N(int32) int32 #61716
    pkg math/rand/v2, func Int64() int64 #61716
    pkg math/rand/v2, func Int64N(int64) int64 #61716
    pkg math/rand/v2, func IntN(int) int #61716
    pkg math/rand/v2, func N[$0 intType]($0) $0 #61716
    pkg math/rand/v2, func New(Source) *Rand #61716
    pkg math/rand/v2, func NewChaCha8([32]uint8) *ChaCha8 #61716
    Plain Text
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Wed Jan 24 20:54:27 GMT 2024
    - 7.7K bytes
    - Viewed (0)
  10. doc/go1.22.html

    <li>The
    <code>Intn</code>,
    <code>Int31</code>,
    <code>Int31n</code>,
    <code>Int63</code>,
    and
    <code>Int64n</code>
    top-level functions and methods from <code>math/rand</code>
    are spelled more idiomatically in <code>math/rand/v2</code>:
    <code>IntN</code>,
    <code>Int32</code>,
    <code>Int32N</code>,
    <code>Int64</code>,
    and
    <code>Int64N</code>.
    There are also new top-level functions and methods
    <code>Uint32</code>,
    HTML
    - Registered: Tue Feb 06 11:13:10 GMT 2024
    - Last Modified: Wed Jan 31 20:51:56 GMT 2024
    - 45.6K bytes
    - Viewed (0)
Back to top