mirror of
https://github.com/minio/minio.git
synced 2025-11-12 14:51:36 -05:00
XL: Implement strided erasure distribution. (#1772)
Strided erasure distribution uses a new randomized block distribution for each Put operation. This information is captured inside `xl.json` for subsequent Get operations.
This commit is contained in:
committed by
Harshavardhana
parent
6dc8323684
commit
d65101a8c8
@@ -82,13 +82,14 @@ func (e erasure) ReadFile(volume, path string, startOffset int64, totalSize int6
|
||||
enBlocks := make([][]byte, len(e.storageDisks))
|
||||
// Read all the readers.
|
||||
for index, reader := range readers {
|
||||
blockIndex := e.distribution[index] - 1
|
||||
// Initialize shard slice and fill the data from each parts.
|
||||
enBlocks[index] = make([]byte, curEncBlockSize)
|
||||
enBlocks[blockIndex] = make([]byte, curEncBlockSize)
|
||||
if reader == nil {
|
||||
continue
|
||||
}
|
||||
// Read the necessary blocks.
|
||||
_, rErr := io.ReadFull(reader, enBlocks[index])
|
||||
_, rErr := io.ReadFull(reader, enBlocks[blockIndex])
|
||||
if rErr != nil && rErr != io.ErrUnexpectedEOF {
|
||||
readers[index].Close()
|
||||
readers[index] = nil
|
||||
|
||||
Reference in New Issue
Block a user