Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 78 for rand (0.16 sec)

  1. cmd/erasure-common.go

    package cmd
    
    import (
    	"context"
    	"fmt"
    	"io"
    	"math/rand"
    	"sync"
    	"time"
    
    	"github.com/minio/pkg/v2/sync/errgroup"
    )
    
    func (er erasureObjects) getOnlineDisks() (newDisks []StorageAPI) {
    	disks := er.getDisks()
    	var wg sync.WaitGroup
    	var mu sync.Mutex
    	r := rand.New(rand.NewSource(time.Now().UnixNano()))
    	for _, i := range r.Perm(len(disks)) {
    		i := i
    		wg.Add(1)
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sun Apr 28 17:53:50 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  2. cmd/erasure.go

    	var wg sync.WaitGroup
    	disks := er.getDisks()
    	infos := make([]DiskInfo, len(disks))
    	r := rand.New(rand.NewSource(time.Now().UnixNano()))
    	for _, i := range r.Perm(len(disks)) {
    		i := i
    		wg.Add(1)
    		go func() {
    			defer wg.Done()
    
    			disk := disks[i]
    			if disk == nil {
    				infos[i].Error = errDiskNotFound.Error()
    				return
    			}
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Apr 26 06:32:14 GMT 2024
    - 16K bytes
    - Viewed (1)
  3. cmd/global-heal.go

    //
    // You should have received a copy of the GNU Affero General Public License
    // along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
    package cmd
    
    import (
    	"context"
    	"errors"
    	"fmt"
    	"math/rand"
    	"runtime"
    	"sort"
    	"time"
    
    	"github.com/dustin/go-humanize"
    	"github.com/minio/madmin-go/v3"
    	"github.com/minio/minio/internal/bucket/lifecycle"
    	objectlock "github.com/minio/minio/internal/bucket/object/lock"
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Apr 26 06:32:14 GMT 2024
    - 15K bytes
    - Viewed (1)
  4. src/bytes/buffer_test.go

    	var buf Buffer
    	s := ""
    	for i := 0; i < 50; i++ {
    		wlen := rand.Intn(len(testString))
    		if i%2 == 0 {
    			s = fillString(t, "TestMixedReadsAndWrites (1)", &buf, s, 1, testString[0:wlen])
    		} else {
    			s = fillBytes(t, "TestMixedReadsAndWrites (1)", &buf, s, 1, testBytes[0:wlen])
    		}
    
    		rlen := rand.Intn(len(testString))
    		fub := make([]byte, rlen)
    		n, _ := buf.Read(fub)
    		s = s[n:]
    	}
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Apr 26 13:31:36 GMT 2024
    - 18.6K bytes
    - Viewed (0)
  5. cmd/erasure-server-pool-rebalance.go

    	// Save rebalance.bin periodically.
    	go func() {
    		// Update rebalance.bin periodically once every 5-10s, chosen randomly
    		// to avoid multiple pool leaders herding to update around the same
    		// time.
    		r := rand.New(rand.NewSource(time.Now().UnixNano()))
    		randSleepFor := func() time.Duration {
    			return 5*time.Second + time.Duration(float64(5*time.Second)*r.Float64())
    		}
    
    		timer := time.NewTimer(randSleepFor())
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Apr 26 19:29:28 GMT 2024
    - 27.2K bytes
    - Viewed (0)
  6. cmd/xl-storage-disk-id-check.go

    		if skipIfSuccessBefore <= 0 {
    			skipIfSuccessBefore = globalDriveConfig.GetMaxTimeout()
    		}
    	}
    
    	t := time.NewTicker(checkEvery)
    	defer t.Stop()
    	fn := mustGetUUID()
    
    	rng := rand.New(rand.NewSource(time.Now().UnixNano()))
    
    	monitor := func() bool {
    		if contextCanceled(ctx) {
    			return false
    		}
    
    		if p.health.status.Load() != diskHealthOK {
    			return true
    		}
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sun Apr 28 17:53:50 GMT 2024
    - 33K bytes
    - Viewed (0)
  7. cmd/iam.go

    	sys.initStore(objAPI, etcdClient)
    	sys.Unlock()
    
    	retryCtx, cancel := context.WithCancel(ctx)
    
    	// Indicate to our routine to exit cleanly upon return.
    	defer cancel()
    
    	r := rand.New(rand.NewSource(time.Now().UnixNano()))
    
    	// Migrate storage format if needed.
    	for {
    		// Migrate IAM configuration, if necessary.
    		if err := saveIAMFormat(retryCtx, sys.store); err != nil {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 25 21:28:16 GMT 2024
    - 71.1K bytes
    - Viewed (1)
  8. cmd/metacache-set.go

    	o.FilterPrefix = strings.TrimPrefix(o.Prefix, o.BaseDir)
    	// Remove leading and trailing slashes.
    	o.FilterPrefix = strings.Trim(o.FilterPrefix, slashSeparator)
    
    	if strings.Contains(o.FilterPrefix, slashSeparator) {
    		// Sanity check, should not happen.
    		o.FilterPrefix = ""
    	}
    }
    
    // filter will apply the options and return the number of objects requested by the limit.
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Apr 26 19:52:52 GMT 2024
    - 30.4K bytes
    - Viewed (0)
  9. cmd/erasure-server-pool.go

    		initAutoHeal(GlobalContext, z)
    	})
    
    	bootstrapTrace("initHealMRF", func() {
    		go globalMRFState.healRoutine(z)
    	})
    
    	// initialize the object layer.
    	defer setObjectLayer(z)
    
    	r := rand.New(rand.NewSource(time.Now().UnixNano()))
    	attempt := 1
    	for {
    		var err error
    		bootstrapTrace(fmt.Sprintf("poolMeta.Init: loading pool metadata, attempt: %d", attempt), func() {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Apr 26 06:32:14 GMT 2024
    - 80.1K bytes
    - Viewed (0)
  10. cmd/xl-storage.go

    			done = globalScannerMetrics.time(scannerMetricApplyVersion)
    			var sz int64
    			objDeleted, sz = item.applyActions(ctx, objAPI, oi, &sizeS)
    			done()
    
    			// DeleteAllVersionsAction: The object and all its
    			// versions are expired and
    			// doesn't contribute toward data usage.
    			if objDeleted {
    				break
    			}
    			actualSz, err := oi.GetActualSize()
    			if err != nil {
    				continue
    			}
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sun Apr 28 17:53:50 GMT 2024
    - 84.7K bytes
    - Viewed (0)
Back to top