Class: Hodor::Oozie::Coordinator

Inherits:
Job
  • Object
show all
Defined in:
lib/hodor/api/oozie/coordinator.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) ⇒ Coordinator

Returns a new instance of Coordinator.



15
16
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
# File 'lib/hodor/api/oozie/coordinator.rb', line 15

def initialize(json)
  super()
  @json = json
  @name = json["coordJobName"]
  @path = json["coordJobPath"]
  @timezone = json["timeZone"]
  @frequency = json["frequency"]
  @conf = json["conf"]
  @end_time = parse_time(json["endTime"])
  @execution_policy = json["executionPolicy"]
  @start_time = parse_time(json["startTime"])
  @time_unit = json["timeUnit"]
  @concurrency = json["concurrency"]
  @id = json["coordJobId"]
  @last_action = parse_time(json["lastAction"])
  @acl = json["acl"]
  @mat_throttling = json["mat_throttling"]
  @timeout = json["timeOut"]
  @next_materialized_time = parse_time(json["nextMaterializedTime"])
  @parent_id = @bundle_id = json["bundleId"]
  @external_id = json["coordExternalId"]
  @group = json["group"]
  @user = json["user"]
  @console_url = json["consoleUrl"]
  @actions = json["actions"]
  @acl = json["acl"]
  @status = json["status"]
end

Instance Attribute Details

#aclObject (readonly)

Returns the value of attribute acl.



5
6
7
# File 'lib/hodor/api/oozie/coordinator.rb', line 5

def acl
  @acl
end

#actionsObject (readonly)

Returns the value of attribute actions.



5
6
7
# File 'lib/hodor/api/oozie/coordinator.rb', line 5

def actions
  @actions
end

#concurrencyObject (readonly)

Returns the value of attribute concurrency.



5
6
7
# File 'lib/hodor/api/oozie/coordinator.rb', line 5

def concurrency
  @concurrency
end

#confObject (readonly)

Returns the value of attribute conf.



5
6
7
# File 'lib/hodor/api/oozie/coordinator.rb', line 5

def conf
  @conf
end

#console_urlObject (readonly)

Returns the value of attribute console_url.



5
6
7
# File 'lib/hodor/api/oozie/coordinator.rb', line 5

def console_url
  @console_url
end

#end_timeObject (readonly)

Returns the value of attribute end_time.



5
6
7
# File 'lib/hodor/api/oozie/coordinator.rb', line 5

def end_time
  @end_time
end

#execution_policyObject (readonly)

Returns the value of attribute execution_policy.



5
6
7
# File 'lib/hodor/api/oozie/coordinator.rb', line 5

def execution_policy
  @execution_policy
end

#external_idObject (readonly)

Returns the value of attribute external_id.



5
6
7
# File 'lib/hodor/api/oozie/coordinator.rb', line 5

def external_id
  @external_id
end

#frequencyObject (readonly)

Returns the value of attribute frequency.



5
6
7
# File 'lib/hodor/api/oozie/coordinator.rb', line 5

def frequency
  @frequency
end

#groupObject (readonly)

Returns the value of attribute group.



5
6
7
# File 'lib/hodor/api/oozie/coordinator.rb', line 5

def group
  @group
end

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/hodor/api/oozie/coordinator.rb', line 5

def id
  @id
end

#jsonObject (readonly)

Returns the value of attribute json.



5
6
7
# File 'lib/hodor/api/oozie/coordinator.rb', line 5

def json
  @json
end

#last_actionObject (readonly)

Returns the value of attribute last_action.



5
6
7
# File 'lib/hodor/api/oozie/coordinator.rb', line 5

def last_action
  @last_action
end

#mat_throttlingObject (readonly)

Returns the value of attribute mat_throttling.



5
6
7
# File 'lib/hodor/api/oozie/coordinator.rb', line 5

def mat_throttling
  @mat_throttling
end

#materializationsObject (readonly)

Returns the value of attribute materializations.



5
6
7
# File 'lib/hodor/api/oozie/coordinator.rb', line 5

def materializations
  @materializations
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/hodor/api/oozie/coordinator.rb', line 5

def name
  @name
end

#next_materialized_timeObject (readonly)

Returns the value of attribute next_materialized_time.



5
6
7
# File 'lib/hodor/api/oozie/coordinator.rb', line 5

def next_materialized_time
  @next_materialized_time
end

#parent_idObject (readonly)

Returns the value of attribute parent_id.



5
6
7
# File 'lib/hodor/api/oozie/coordinator.rb', line 5

def parent_id
  @parent_id
end

#pathObject (readonly)

Returns the value of attribute path.



5
6
7
# File 'lib/hodor/api/oozie/coordinator.rb', line 5

def path
  @path
end

#start_timeObject (readonly)

Returns the value of attribute start_time.



5
6
7
# File 'lib/hodor/api/oozie/coordinator.rb', line 5

def start_time
  @start_time
end

#statusObject (readonly)

Returns the value of attribute status.



5
6
7
# File 'lib/hodor/api/oozie/coordinator.rb', line 5

def status
  @status
end

#time_unitObject (readonly)

Returns the value of attribute time_unit.



5
6
7
# File 'lib/hodor/api/oozie/coordinator.rb', line 5

def time_unit
  @time_unit
end

#timeoutObject (readonly)

Returns the value of attribute timeout.



5
6
7
# File 'lib/hodor/api/oozie/coordinator.rb', line 5

def timeout
  @timeout
end

#timezoneObject (readonly)

Returns the value of attribute timezone.



5
6
7
# File 'lib/hodor/api/oozie/coordinator.rb', line 5

def timezone
  @timezone
end

#userObject (readonly)

Returns the value of attribute user.



5
6
7
# File 'lib/hodor/api/oozie/coordinator.rb', line 5

def user
  @user
end

Class Method Details

.default_columnsObject



10
11
12
# File 'lib/hodor/api/oozie/coordinator.rb', line 10

def default_columns
  [:index, :id, :name, :status, :start_time, :time_unit, :external_id]
end

Instance Method Details

#expandObject



44
45
46
47
48
49
50
# File 'lib/hodor/api/oozie/coordinator.rb', line 44

def expand
  # Expand immediate children
  @materializations = json["actions"].map do |item|
    Materialization.new(item)
  end.compact.reverse
  @materializations
end