Class: Hodor::Oozie::Workflow

Inherits:
Job
  • Object
show all
Defined in:
lib/hodor/api/oozie/workflow.rb

Instance Attribute Summary collapse

Attributes inherited from Job

#columns, #index, #rest_call, #skip_to

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Job

#child_columns, #children, #children_title, #conf_map, #definition, #display_as_array, #display_as_time, #display_children, #display_properties, #indexed_job_id, #log, #oozie, #parse_time, #sanitize, #session, #set_index, #title

Constructor Details

#initialize(json) ⇒ Workflow

Returns a new instance of Workflow.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/hodor/api/oozie/workflow.rb', line 17

def initialize(json)
  super()
  @json = json

  @app_path = json["appPath"]
  @acl = json["acl"]
  @status = json["status"]
  @created_at = parse_time json["createdTime"]
  @conf = json["conf"]
  @last_mod_time = parse_time json["lastModTime"]
  @run = json["run"]
  @end_time = parse_time json["endTime"]
  @external_id = json["externalId"]
  @name = @app_name = json["appName"]
  @id = json["id"]
  @start_time = parse_time json["startTime"]
  @materialization_id = json["parentId"]
  ati = @materializeation_id.nil? ? nil : @materialization_id.index('@')
  if ati && ati > 0
    @parent_id = @materialization_id[0..ati-1]
  else
    @parent_id = @materialization_id
    @materialization = nil
  end

  @to_string = json["toString"]
  @group = json["group"]
  @console_url = json["consoleUrl"]
  @user = json["user"]
end

Instance Attribute Details

#aclObject (readonly)

Returns the value of attribute acl.



7
8
9
# File 'lib/hodor/api/oozie/workflow.rb', line 7

def acl
  @acl
end

#app_nameObject (readonly)

Returns the value of attribute app_name.



7
8
9
# File 'lib/hodor/api/oozie/workflow.rb', line 7

def app_name
  @app_name
end

#app_pathObject (readonly)

Returns the value of attribute app_path.



7
8
9
# File 'lib/hodor/api/oozie/workflow.rb', line 7

def app_path
  @app_path
end

#confObject (readonly)

Returns the value of attribute conf.



7
8
9
# File 'lib/hodor/api/oozie/workflow.rb', line 7

def conf
  @conf
end

#console_urlObject (readonly)

Returns the value of attribute console_url.



7
8
9
# File 'lib/hodor/api/oozie/workflow.rb', line 7

def console_url
  @console_url
end

#created_atObject (readonly)

Returns the value of attribute created_at.



7
8
9
# File 'lib/hodor/api/oozie/workflow.rb', line 7

def created_at
  @created_at
end

#end_timeObject (readonly)

Returns the value of attribute end_time.



7
8
9
# File 'lib/hodor/api/oozie/workflow.rb', line 7

def end_time
  @end_time
end

#external_idObject (readonly)

Returns the value of attribute external_id.



7
8
9
# File 'lib/hodor/api/oozie/workflow.rb', line 7

def external_id
  @external_id
end

#groupObject (readonly)

Returns the value of attribute group.



7
8
9
# File 'lib/hodor/api/oozie/workflow.rb', line 7

def group
  @group
end

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/hodor/api/oozie/workflow.rb', line 7

def id
  @id
end

#jsonObject (readonly)

Returns the value of attribute json.



7
8
9
# File 'lib/hodor/api/oozie/workflow.rb', line 7

def json
  @json
end

#last_mod_timeObject (readonly)

Returns the value of attribute last_mod_time.



7
8
9
# File 'lib/hodor/api/oozie/workflow.rb', line 7

def last_mod_time
  @last_mod_time
end

#materializationObject (readonly)

Returns the value of attribute materialization.



7
8
9
# File 'lib/hodor/api/oozie/workflow.rb', line 7

def materialization
  @materialization
end

#materialization_idObject (readonly)

Returns the value of attribute materialization_id.



7
8
9
# File 'lib/hodor/api/oozie/workflow.rb', line 7

def materialization_id
  @materialization_id
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/hodor/api/oozie/workflow.rb', line 7

def name
  @name
end

#parent_idObject (readonly)

Returns the value of attribute parent_id.



7
8
9
# File 'lib/hodor/api/oozie/workflow.rb', line 7

def parent_id
  @parent_id
end

#runObject (readonly)

Returns the value of attribute run.



7
8
9
# File 'lib/hodor/api/oozie/workflow.rb', line 7

def run
  @run
end

#start_timeObject (readonly)

Returns the value of attribute start_time.



7
8
9
# File 'lib/hodor/api/oozie/workflow.rb', line 7

def start_time
  @start_time
end

#statusObject (readonly)

Returns the value of attribute status.



7
8
9
# File 'lib/hodor/api/oozie/workflow.rb', line 7

def status
  @status
end

#to_stringObject (readonly)

Returns the value of attribute to_string.



7
8
9
# File 'lib/hodor/api/oozie/workflow.rb', line 7

def to_string
  @to_string
end

#userObject (readonly)

Returns the value of attribute user.



7
8
9
# File 'lib/hodor/api/oozie/workflow.rb', line 7

def user
  @user
end

Class Method Details

.default_columnsObject



12
13
14
# File 'lib/hodor/api/oozie/workflow.rb', line 12

def default_columns
  [:index, :id, :status, :created_at, :last_mod_time, :app_name]
end

Instance Method Details

#expandObject



48
49
50
51
52
53
54
# File 'lib/hodor/api/oozie/workflow.rb', line 48

def expand
  # expand immediate children
  @actions = json["actions"].map do |item|
    require_relative 'action'
    Hodor::Oozie::Action.new(item)
  end.compact
end