mirror of
https://github.com/minio/minio.git
synced 2025-01-13 07:53:21 -05:00
Merge pull request #320 from fkautz/pr_out_removing_block_size_from_donut_writer_no_longer_necessary
This commit is contained in:
commit
982a52e0d4
@ -14,7 +14,7 @@ type DonutBox interface {
|
||||
SetBucketMetadata(bucket string, metadata map[string]string) error
|
||||
|
||||
// object operations
|
||||
GetObjectWriter(bucket, object string, column, blockSize uint) (*NewObject, error)
|
||||
GetObjectWriter(bucket, object string, column uint) (*NewObject, error)
|
||||
GetObjectReader(bucket, object string, column uint) (io.Reader, error)
|
||||
GetObjectMetadata(bucket, object string, column uint) (map[string]string, error)
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ func (donutMem donutMem) SetBucketMetadata(bucketKey string, metadata map[string
|
||||
}
|
||||
|
||||
// object operations
|
||||
func (donutMem donutMem) GetObjectWriter(bucketKey, objectKey string, column uint, blockSize uint) (*donutbox.NewObject, error) {
|
||||
func (donutMem donutMem) GetObjectWriter(bucketKey, objectKey string, column uint) (*donutbox.NewObject, error) {
|
||||
key := getKey(bucketKey, objectKey, column)
|
||||
reader, writer := io.Pipe()
|
||||
returnObject := donutbox.CreateNewObject(writer)
|
||||
|
@ -19,14 +19,14 @@ func (s *MySuite) TestCreateAndReadObject(c *C) {
|
||||
data := "Hello World"
|
||||
donut := NewDonutMem()
|
||||
|
||||
writer, err := donut.GetObjectWriter("foo", "bar", 0, 2)
|
||||
writer, err := donut.GetObjectWriter("foo", "bar", 0)
|
||||
c.Assert(writer, IsNil)
|
||||
c.Assert(err, Not(IsNil))
|
||||
|
||||
err = donut.CreateBucket("foo")
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
writer, err = donut.GetObjectWriter("foo", "bar", 0, 2)
|
||||
writer, err = donut.GetObjectWriter("foo", "bar", 0)
|
||||
c.Assert(err, IsNil)
|
||||
count, err := writer.Write([]byte(data))
|
||||
c.Assert(count, Equals, len(data))
|
||||
@ -41,7 +41,7 @@ func (s *MySuite) TestCreateAndReadObject(c *C) {
|
||||
c.Assert(result, DeepEquals, []byte(data))
|
||||
|
||||
// try writing, should see error
|
||||
writer, err = donut.GetObjectWriter("foo", "bar", 0, 2)
|
||||
writer, err = donut.GetObjectWriter("foo", "bar", 0)
|
||||
c.Assert(writer, IsNil)
|
||||
c.Assert(err, Not(IsNil))
|
||||
|
||||
@ -83,7 +83,7 @@ func (s *MySuite) TestObjectList(c *C) {
|
||||
for i := 0; i < 10; i++ {
|
||||
object := "foo" + strconv.Itoa(i)
|
||||
objects = append(objects, object)
|
||||
writer, err := donut.GetObjectWriter("foo", object, 0, 2)
|
||||
writer, err := donut.GetObjectWriter("foo", object, 0)
|
||||
c.Assert(err, IsNil)
|
||||
writer.Write([]byte(object))
|
||||
writer.Close()
|
||||
@ -126,7 +126,7 @@ func (s *MySuite) TestObjectMetadata(c *C) {
|
||||
c.Assert(result, IsNil)
|
||||
c.Assert(err, Not(IsNil))
|
||||
|
||||
writer, err := donut.GetObjectWriter("foo", "bar", 1, 2)
|
||||
writer, err := donut.GetObjectWriter("foo", "bar", 1)
|
||||
c.Assert(err, IsNil)
|
||||
_, err = writer.Write([]byte("Hello World"))
|
||||
c.Assert(err, IsNil)
|
||||
@ -148,5 +148,4 @@ func (s *MySuite) TestObjectMetadata(c *C) {
|
||||
result, err = donut.GetObjectMetadata("foo", "bar", 0)
|
||||
c.Assert(err, Not(IsNil))
|
||||
c.Assert(result, IsNil)
|
||||
|
||||
}
|
||||
|
@ -296,7 +296,7 @@ func (diskStorage StorageDriver) CreateObject(bucketKey, objectKey, contentType,
|
||||
splitStream := split.Stream(reader, uint64(blockSize))
|
||||
writers := make([]*donutbox.NewObject, 16)
|
||||
for i := 0; i < 16; i++ {
|
||||
newWriter, err := diskStorage.donutBox.GetObjectWriter(bucketKey, objectKey, uint(i), uint(blockSize))
|
||||
newWriter, err := diskStorage.donutBox.GetObjectWriter(bucketKey, objectKey, uint(i))
|
||||
if err != nil {
|
||||
closeAllWritersWithError(writers, err)
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user