Module: Wukong::Local

Includes:
Plugin
Defined in:
lib/wukong/local.rb,
lib/wukong/local/runner.rb,
lib/wukong/local/tcp_driver.rb,
lib/wukong/local/stdio_driver.rb

Overview

Provides methods for supporting the running of Wukong processors and dataflows entirely locally, without any frameworks like Hadoop or Storm.

This module is actually a plugin for Wukong.

Defined Under Namespace

Classes: LocalRunner, StdioDriver, TCPDriver

Class Method Summary collapse

Methods included from Plugin

included

Class Method Details

.boot(settings, root) ⇒ Object

Boots Wukong::Local using the given +settings+ at the given +root.

Parameters:

  • settings (Configliere::Param)

    the settings to use to boot

  • root (String)

    the root directory to boot in



34
35
# File 'lib/wukong/local.rb', line 34

def self.boot(settings, root)
end

.configure(settings, program) ⇒ Object

Configures the given +settings+ object with all settings specific to Wukong::Local for the given program +name+.

Parameters:

  • settings (Configliere::Param)

    the settings to configure

  • program (String)

    the name of the currently executing program



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/wukong/local.rb', line 16

def self.configure settings, program
  case program
  when 'wu-local'
    settings.define :run,      description: "Name of the processor or dataflow to use. Defaults to basename of the given path.", flag: 'r'
    settings.define :tcp_port, description: "Consume TCP requests on the given port instead of lines over STDIN", type: Integer, flag: 't'
    
    settings.define :from, description: "Parse input from given data format (json, tsv, &c.) before processing"
    settings.define :to,   description: "Convert input to given data format (json, tsv, &c.) before emitting"

    settings.define :consumes, description: "Parse input as instances of given model class before processing", type: Class
  end
end