Merge pull request #114 from harshavardhana/pr_out_provide_new_cli_options_for_put_command

Provide new cli options for 'put' command
master
Harshavardhana 10 years ago
commit 267aa87ad7
  1. 4
      cmd/erasure-demo/erasure.go
  2. 18
      cmd/erasure-demo/main.go

@ -18,7 +18,7 @@ func erasureGetList(config inputConfig) (io.Reader, error) {
func erasureGet(config inputConfig, objectPath string) (io.Reader, error) { func erasureGet(config inputConfig, objectPath string) (io.Reader, error) {
var objectStorage storage.ObjectStorage var objectStorage storage.ObjectStorage
rootDir := path.Join(config.rootDir, config.storageDriver) 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 { if err != nil {
return nil, err return nil, err
} }
@ -36,7 +36,7 @@ func erasurePut(config inputConfig, objectPath string, reader io.Reader) error {
return err return err
} }
var objectStorage storage.ObjectStorage 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 return err
} }
if err = objectStorage.Put(objectPath, reader); err != nil { if err = objectStorage.Put(objectPath, reader); err != nil {

@ -69,8 +69,8 @@ func main() {
}, },
cli.StringFlag{ cli.StringFlag{
Name: "driver", Name: "driver",
Value: "fs", Value: "erasure",
Usage: "fs", Usage: "erasure",
}, },
}, },
}, },
@ -84,10 +84,20 @@ func main() {
Value: getMinioDir(), Value: getMinioDir(),
Usage: "", 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{ cli.StringFlag{
Name: "driver", Name: "driver",
Value: "fs", Value: "erasure",
Usage: "fs", Usage: "erasure",
}, },
}, },
}, },

Loading…
Cancel
Save