From f71b323e32f48bf4f59894c9786d39ebd8863777 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Thu, 11 Dec 2014 22:56:10 -0800 Subject: [PATCH] Provide new cli options for 'put' command - --protection-level - --block-size --- cmd/erasure-demo/erasure.go | 4 ++-- cmd/erasure-demo/main.go | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/cmd/erasure-demo/erasure.go b/cmd/erasure-demo/erasure.go index 0c7d1776c..b9c775f5b 100644 --- a/cmd/erasure-demo/erasure.go +++ b/cmd/erasure-demo/erasure.go @@ -18,7 +18,7 @@ func erasureGetList(config inputConfig) (io.Reader, error) { func erasureGet(config inputConfig, objectPath string) (io.Reader, error) { var objectStorage storage.ObjectStorage rootDir := path.Join(config.rootDir, config.storageDriver) - objectStorage, err := es.NewStorage(rootDir, 10, 6, 1024*1024) + objectStorage, err := es.NewStorage(rootDir, config.k, config.m, config.blockSize) if err != nil { return nil, err } @@ -36,7 +36,7 @@ func erasurePut(config inputConfig, objectPath string, reader io.Reader) error { return err } var objectStorage storage.ObjectStorage - if objectStorage, err = es.NewStorage(rootDir, 10, 6, 1024*1024); err != nil { + if objectStorage, err = es.NewStorage(rootDir, config.k, config.m, config.blockSize); err != nil { return err } if err = objectStorage.Put(objectPath, reader); err != nil { diff --git a/cmd/erasure-demo/main.go b/cmd/erasure-demo/main.go index 905d02715..0e617d49a 100644 --- a/cmd/erasure-demo/main.go +++ b/cmd/erasure-demo/main.go @@ -69,8 +69,8 @@ func main() { }, cli.StringFlag{ Name: "driver", - Value: "fs", - Usage: "fs", + Value: "erasure", + Usage: "erasure", }, }, }, @@ -84,10 +84,20 @@ func main() { Value: getMinioDir(), Usage: "", }, + cli.StringFlag{ + Name: "protection-level", + Value: "10,6", + Usage: "data,parity", + }, + cli.StringFlag{ + Name: "block-size", + Value: "1M", + Usage: "Size of blocks. Examples: 1K, 1M, full", + }, cli.StringFlag{ Name: "driver", - Value: "fs", - Usage: "fs", + Value: "erasure", + Usage: "erasure", }, }, },