listBuckets: Bump up the limit of max buckets to 1000.

master
Harshavardhana 9 years ago
parent f5d6be158e
commit 1341fb79c3
  1. 17
      pkg/fs/fs-bucket-listobjects.go
  2. 2
      pkg/fs/fs.go

@ -27,14 +27,24 @@ import (
"github.com/minio/minio-xl/pkg/probe" "github.com/minio/minio-xl/pkg/probe"
) )
// listObjectsParams - list objects input parameters.
type listObjectsParams struct { type listObjectsParams struct {
// Bucket name to list the objects for.
Bucket string Bucket string
// list all objects with this parameter as common prefix.
Prefix string Prefix string
// list all objects starting with object after marker in
// lexicographical order.
Marker string Marker string
// list all objects until the first occurrence of the delimtier
// after the prefix.
Delimiter string Delimiter string
// maximum number of objects returned per listObjects()
// operation.
MaxKeys int MaxKeys int
} }
// listServiceReq
type listServiceReq struct { type listServiceReq struct {
reqParams listObjectsParams reqParams listObjectsParams
respCh chan ListObjectsResult respCh chan ListObjectsResult
@ -44,8 +54,7 @@ type listWorkerReq struct {
respCh chan ListObjectsResult respCh chan ListObjectsResult
} }
// listObjects - list objects lists objects upto maxKeys for a given // listObjects - list objects lists objects upto maxKeys for a given prefix.
// prefix.
func (fs Filesystem) listObjects(bucket, prefix, marker, delimiter string, maxKeys int) (chan<- listWorkerReq, *probe.Error) { func (fs Filesystem) listObjects(bucket, prefix, marker, delimiter string, maxKeys int) (chan<- listWorkerReq, *probe.Error) {
quitWalker := make(chan bool) quitWalker := make(chan bool)
reqCh := make(chan listWorkerReq) reqCh := make(chan listWorkerReq)
@ -67,7 +76,7 @@ func (fs Filesystem) listObjects(bucket, prefix, marker, delimiter string, maxKe
walkPath = prefixPath walkPath = prefixPath
} }
} }
filepath.Walk(walkPath, func(path string, info os.FileInfo, err error) error { Walk(walkPath, func(path string, info os.FileInfo, err error) error {
// We don't need to list the walk path. // We don't need to list the walk path.
if path == walkPath { if path == walkPath {
return nil return nil
@ -99,7 +108,7 @@ func (fs Filesystem) listObjects(bucket, prefix, marker, delimiter string, maxKe
// If delimiter is set, we stop if current path is a // If delimiter is set, we stop if current path is a
// directory. // directory.
if delimiter != "" && info.IsDir() { if delimiter != "" && info.IsDir() {
return filepath.SkipDir return ErrSkipDir
} }
} }
return nil return nil

@ -101,7 +101,7 @@ func New(rootPath string) (Filesystem, *probe.Error) {
/// Defaults /// Defaults
// maximum buckets to be listed from list buckets. // maximum buckets to be listed from list buckets.
fs.maxBuckets = 100 fs.maxBuckets = 1000
// minium free disk required for i/o operations to succeed. // minium free disk required for i/o operations to succeed.
fs.minFreeDisk = 10 fs.minFreeDisk = 10

Loading…
Cancel
Save