XL: Implement ListObjects channel and pool management.

This commit is contained in:
Harshavardhana
2016-05-29 21:05:00 -07:00
committed by Harshavardhana
parent 70a1231f02
commit 1cf1532ca3
6 changed files with 190 additions and 109 deletions

View File

@@ -20,7 +20,6 @@ import (
"errors"
"fmt"
"sort"
"sync"
"github.com/minio/minio/pkg/disk"
)
@@ -45,8 +44,7 @@ type xlObjects struct {
writeQuorum int // writeQuorum minimum required disks to write data.
// List pool management.
listObjectMap map[listParams][]*treeWalker
listObjectMapMutex *sync.Mutex
listPool *treeWalkerPool
}
// errXLMaxDisks - returned for reached maximum of disks.
@@ -159,12 +157,11 @@ func newXLObjects(disks []string) (ObjectLayer, error) {
// Initialize xl objects.
xl := xlObjects{
physicalDisks: disks,
storageDisks: newPosixDisks,
dataBlocks: dataBlocks,
parityBlocks: parityBlocks,
listObjectMap: make(map[listParams][]*treeWalker),
listObjectMapMutex: &sync.Mutex{},
physicalDisks: disks,
storageDisks: newPosixDisks,
dataBlocks: dataBlocks,
parityBlocks: parityBlocks,
listPool: newTreeWalkerPool(globalLookupTimeout),
}
// Figure out read and write quorum based on number of storage disks.