Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 27 for NewSource (0.23 sec)

  1. okhttp/src/test/java/okhttp3/internal/cache2/RelayTest.kt

      }
    
      @Test
      fun multipleSources() {
        val upstream = Buffer()
        upstream.writeUtf8("abcdefghijklm")
        val relay = edit(file, upstream, metadata, 1024)
        val source1 = relay.newSource()!!.buffer()
        val source2 = relay.newSource()!!.buffer()
        assertThat(source1.readUtf8()).isEqualTo("abcdefghijklm")
        assertThat(source2.readUtf8()).isEqualTo("abcdefghijklm")
        source1.close()
        source2.close()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 8.1K bytes
    - Viewed (0)
  2. cmd/erasure-common.go

    	"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 func() {
    			defer wg.Done()
    			if disks[i] == nil {
    				return
    			}
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sun Apr 28 17:53:50 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  3. cmd/license-update.go

    )
    
    // initlicenseUpdateJob start the periodic license update job in the background.
    func initLicenseUpdateJob(ctx context.Context, objAPI ObjectLayer) {
    	go func() {
    		r := rand.New(rand.NewSource(time.Now().UnixNano()))
    		// Leader node (that successfully acquires the lock inside licenceUpdaterLoop)
    		// will keep performing the license update. If the leader goes down for some
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 3.3K bytes
    - Viewed (0)
  4. 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 {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Apr 26 06:32:14 GMT 2024
    - 16K bytes
    - Viewed (1)
  5. cmd/callhome.go

    // initCallhome will start the callhome task in the background.
    func initCallhome(ctx context.Context, objAPI ObjectLayer) {
    	if !globalCallhomeConfig.Enabled() {
    		return
    	}
    
    	go func() {
    		r := rand.New(rand.NewSource(time.Now().UnixNano()))
    		// Leader node (that successfully acquires the lock inside runCallhome)
    		// will keep performing the callhome. If the leader goes down for some reason,
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 5.1K bytes
    - Viewed (1)
  6. cmd/object-api-utils.go

    	return hosts
    }
    
    // returns an online host (and corresponding port) from a slice of DNS records
    func getHostFromSrv(records []dns.SrvRecord) (host string) {
    	hosts := getHostsSlice(records)
    	rng := rand.New(rand.NewSource(time.Now().UTC().UnixNano()))
    	var d net.Dialer
    	var retry int
    	for retry < len(hosts) {
    		ctx, cancel := context.WithTimeout(GlobalContext, 300*time.Millisecond)
    
    		host = hosts[rng.Intn(len(hosts))]
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Mon Mar 11 11:55:34 GMT 2024
    - 35.6K bytes
    - Viewed (1)
  7. okhttp/src/test/java/okhttp3/internal/cache/DiskLruCacheTest.kt

        setUp(parameters.first, parameters.second)
        val creator = cache.edit("k1")!!
        creator.setString(0, "ABC")
        creator.setString(1, "DE")
        assertThat(creator.newSource(0)).isNull()
        assertThat(creator.newSource(1)).isNull()
        creator.commit()
        val snapshot = cache["k1"]!!
        snapshot.assertValue(0, "ABC")
        snapshot.assertValue(1, "DE")
      }
    
      @ParameterizedTest
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 15 14:55:09 GMT 2024
    - 75.8K bytes
    - Viewed (0)
  8. cmd/xl-storage-format-v2_test.go

    		t.Run(test.name, func(t *testing.T) {
    			// Run multiple times, shuffling the input order.
    			for i := int64(0); i < 50; i++ {
    				t.Run(fmt.Sprint(i), func(t *testing.T) {
    					rng := rand.New(rand.NewSource(i))
    					rng.Shuffle(len(test.input), func(i, j int) {
    						test.input[i], test.input[j] = test.input[j], test.input[i]
    					})
    					got := mergeXLV2Versions(test.quorum, true, 0, test.input...)
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Mar 08 17:50:48 GMT 2024
    - 36.4K bytes
    - Viewed (0)
  9. cmd/batch-rotate.go

    	globalBatchJobsMetrics.save(job.ID, ri)
    	lastObject := ri.Object
    
    	delay := job.KeyRotate.Flags.Retry.Delay
    	if delay == 0 {
    		delay = batchKeyRotateJobDefaultRetryDelay
    	}
    
    	rnd := rand.New(rand.NewSource(time.Now().UnixNano()))
    
    	selectObj := func(info FileInfo) (ok bool) {
    		if r.Flags.Filter.OlderThan > 0 && time.Since(info.ModTime) < r.Flags.Filter.OlderThan {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 14.2K bytes
    - Viewed (0)
  10. cmd/tier.go

    		Tiers:       make(map[string]madmin.TierConfig),
    	}
    }
    
    func (config *TierConfigMgr) refreshTierConfig(ctx context.Context, objAPI ObjectLayer) {
    	const tierCfgRefresh = 15 * time.Minute
    	r := rand.New(rand.NewSource(time.Now().UnixNano()))
    	randInterval := func() time.Duration {
    		return time.Duration(r.Float64() * 5 * float64(time.Second))
    	}
    
    	// To avoid all MinIO nodes reading the tier config object at the same
    	// time.
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Wed Apr 17 05:09:58 GMT 2024
    - 15.5K bytes
    - Viewed (0)
Back to top