MCPcopy
hub / github.com/minio/minio-go / partsRequired

Function partsRequired

api-compose-object.go:594–603  ·  view source on GitHub ↗

partsRequired calculates the number of parts needed for a given size using the specified part size. If partSize is 0, defaults to maxPartSize (5 GiB).

(size int64, partSize int64)

Source from the content-addressed store, hash-verified

592// partsRequired calculates the number of parts needed for a given size
593// using the specified part size. If partSize is 0, defaults to maxPartSize (5 GiB).
594func partsRequired(size int64, partSize int64) int64 {
595 if partSize == 0 {
596 partSize = maxPartSize
597 }
598 r := size / partSize
599 if size%partSize > 0 {
600 r++
601 }
602 return r
603}
604
605// calculateEvenSplits - computes splits for a source and returns
606// start and end index slices. Splits happen evenly to be sure that no

Callers 3

TestPartsRequiredFunction · 0.85
ComposeObjectMethod · 0.85
calculateEvenSplitsFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestPartsRequiredFunction · 0.68