Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for ceilFrac (0.19 sec)

  1. cmd/bitrot-streaming.go

    	bw.canClose.Add(1)
    	go func() {
    		defer bw.canClose.Done()
    
    		totalFileSize := int64(-1) // For compressed objects length will be unknown (represented by length=-1)
    		if length != -1 {
    			bitrotSumsTotalSize := ceilFrac(length, shardSize) * int64(h.Size()) // Size used for storing bitrot checksums.
    			totalFileSize = bitrotSumsTotalSize + length
    		}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Jan 31 02:11:45 GMT 2024
    - 5.8K bytes
    - Viewed (0)
  2. cmd/utils_test.go

    		etag := ToS3ETag(testCase.etag)
    		if etag != testCase.expectedETag {
    			t.Fatalf("test %v: expected: %v, got: %v", i+1, testCase.expectedETag, etag)
    		}
    	}
    }
    
    // Test ceilFrac
    func TestCeilFrac(t *testing.T) {
    	cases := []struct {
    		numerator, denominator, ceiling int64
    	}{
    		{0, 1, 0},
    		{-1, 2, 0},
    		{1, 2, 1},
    		{1, 1, 1},
    		{3, 2, 2},
    		{54, 11, 5},
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Feb 23 21:28:14 GMT 2024
    - 10.2K bytes
    - Viewed (0)
  3. cmd/erasure-coding.go

    	return e.encoder().Reconstruct(data)
    }
    
    // ShardSize - returns actual shared size from erasure blockSize.
    func (e *Erasure) ShardSize() int64 {
    	return ceilFrac(e.blockSize, int64(e.dataBlocks))
    }
    
    // ShardFileSize - returns final erasure size from original size.
    func (e *Erasure) ShardFileSize(totalLength int64) int64 {
    	if totalLength == 0 {
    		return 0
    	}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Jan 31 02:11:45 GMT 2024
    - 8.6K bytes
    - Viewed (0)
  4. cmd/erasure-metadata.go

    	}
    	numShards := totalLength / e.BlockSize
    	lastBlockSize := totalLength % e.BlockSize
    	lastShardSize := ceilFrac(lastBlockSize, int64(e.DataBlocks))
    	return numShards*e.ShardSize() + lastShardSize
    }
    
    // ShardSize - returns actual shared size from erasure blockSize.
    func (e ErasureInfo) ShardSize() int64 {
    	return ceilFrac(e.BlockSize, int64(e.DataBlocks))
    }
    
    // IsValid - tells if erasure info fields are valid.
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sun Apr 28 17:53:50 GMT 2024
    - 19.2K bytes
    - Viewed (1)
  5. cmd/bitrot.go

    }
    
    // Returns the size of the file with bitrot protection
    func bitrotShardFileSize(size int64, shardSize int64, algo BitrotAlgorithm) int64 {
    	if algo != HighwayHash256S {
    		return size
    	}
    	return ceilFrac(size, shardSize)*int64(algo.New().Size()) + size
    }
    
    // bitrotVerify a single stream of data.
    func bitrotVerify(r io.Reader, wantSize, partSize int64, algo BitrotAlgorithm, want []byte, shardSize int64) error {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Jan 30 20:43:25 GMT 2024
    - 7.6K bytes
    - Viewed (0)
  6. cmd/utils.go

    		TCPOptions:       globalTCPOptions,
    		EnableHTTP2:      false,
    	}.NewRemoteTargetHTTPTransport(insecure)
    }
    
    // ceilFrac takes a numerator and denominator representing a fraction
    // and returns its ceiling. If denominator is 0, it returns 0 instead
    // of crashing.
    func ceilFrac(numerator, denominator int64) (ceil int64) {
    	if denominator == 0 {
    		// do nothing on invalid input
    		return
    	}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Apr 24 04:08:47 GMT 2024
    - 31.3K bytes
    - Viewed (0)
Back to top