Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for newMetacacheWriter (0.11 sec)

  1. cmd/metacache-stream.go

    	closer      func() error
    	blockSize   int
    	streamWg    sync.WaitGroup
    	reuseBlocks bool
    }
    
    // newMetacacheWriter will create a serializer that will write objects in given order to the output.
    // Provide a block size that affects latency. If 0 a default of 128KiB will be used.
    // Block size can be up to 4MiB.
    func newMetacacheWriter(out io.Writer, blockSize int) *metacacheWriter {
    	if blockSize < 8<<10 {
    		blockSize = 128 << 10
    	}
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Apr 04 12:04:40 UTC 2024
    - 19.5K bytes
    - Viewed (0)
  2. cmd/metacache-walk.go

    		// Stat a volume entry.
    		if err = Access(volumeDir); err != nil {
    			return convertAccessError(err, errVolumeAccessDenied)
    		}
    	}
    
    	// Use a small block size to start sending quickly
    	w := newMetacacheWriter(wr, 16<<10)
    	w.reuseBlocks = true // We are not sharing results, so reuse buffers.
    	defer w.Close()
    	out, err := w.stream()
    	if err != nil {
    		return err
    	}
    	defer xioutil.SafeClose(out)
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sat Jun 01 05:17:37 UTC 2024
    - 12.4K bytes
    - Viewed (0)
  3. cmd/metacache-stream_test.go

    			t.Errorf("entry %d, want %q, got %q", i, want, gotObj.name)
    		}
    	}
    }
    
    func Test_newMetacacheStream(t *testing.T) {
    	r := loadMetacacheSample(t)
    	var buf bytes.Buffer
    	w := newMetacacheWriter(&buf, 1<<20)
    	defer w.Close()
    	err := r.readFn(func(object metaCacheEntry) bool {
    		err := w.write(object)
    		if err != nil {
    			t.Fatal(err)
    		}
    		return true
    	})
    	r.Close()
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Sep 19 18:05:16 UTC 2022
    - 15K bytes
    - Viewed (0)
Back to top