Sha256: 70b8d261c753affe81db47fd28ca0ba25de9ceb20e519228ac1c8694a98385d7

Contents?: true

Size: 1.06 KB

Versions: 1

Compression:

Stored size: 1.06 KB

Contents

#!/usr/bin/env ruby

conf        = ARGV.shift
validations = [ !conf.nil?,
                conf.match(/:/), 
                conf.match(/\|/),
                conf.match(/;/),
                conf.split(/:/).size > 1, 
                !conf.match(/-help/),
                ARGV.size == 0 ]

help_string = <<HELP
Usage: floom oneshot '<flume config string>'

Tips:

* Make sure you use single quotes around the config string (')

* Make sure your config begins with a logical node name followed by a colon (:)

* If anything inside the config needs to be quoted, use double quotes (")

* Make sure to end the config with a semicolon (;)

* Flume config strings have the following format:
    'name: source | decorator decorator ... sink;'

Examples
  * 'terminal: console | console;'
  * 'writer: console | text("/tmp/flume_output.txt", raw);'
  * 'fake_data: asciisynth(1000, 100) | stubbornAppend rpcSink("localhost", 33333);'

HELP

if validations.all?
  name = conf.split(':').first
  cmd  = "flume node_nowatch -1 -s -n #{name} -c '#{conf}'"
  system cmd
else
  puts help_string
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
floom-0.0.1 bin/oneshot