If NodeDisks are not empty do not impose cache maxSize restriction

master
Harshavardhana 10 years ago
parent efa91474e7
commit 8abb96c030
  1. 16
      pkg/donut/donut-v2.go

@ -304,13 +304,15 @@ func (donut API) CreateObject(bucket, key, expectedMD5Sum string, size int64, da
// createObject - PUT object to cache buffer // createObject - PUT object to cache buffer
func (donut API) createObject(bucket, key, contentType, expectedMD5Sum string, size int64, data io.Reader) (ObjectMetadata, error) { func (donut API) createObject(bucket, key, contentType, expectedMD5Sum string, size int64, data io.Reader) (ObjectMetadata, error) {
if size > int64(donut.config.MaxSize) { if len(donut.config.NodeDiskMap) == 0 {
generic := GenericObjectError{Bucket: bucket, Object: key} if size > int64(donut.config.MaxSize) {
return ObjectMetadata{}, iodine.New(EntityTooLarge{ generic := GenericObjectError{Bucket: bucket, Object: key}
GenericObjectError: generic, return ObjectMetadata{}, iodine.New(EntityTooLarge{
Size: strconv.FormatInt(size, 10), GenericObjectError: generic,
MaxSize: strconv.FormatUint(donut.config.MaxSize, 10), Size: strconv.FormatInt(size, 10),
}, nil) MaxSize: strconv.FormatUint(donut.config.MaxSize, 10),
}, nil)
}
} }
if !IsValidBucket(bucket) { if !IsValidBucket(bucket) {
return ObjectMetadata{}, iodine.New(BucketNameInvalid{Bucket: bucket}, nil) return ObjectMetadata{}, iodine.New(BucketNameInvalid{Bucket: bucket}, nil)

Loading…
Cancel
Save