Class: Hodor::Oozie::Materialization

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

Instance Attribute Summary collapse

Attributes inherited from Job

#columns, #conf, #id, #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) ⇒ Materialization

Returns a new instance of Materialization.



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/hodor/api/oozie/materialization.rb', line 23

def initialize(json)
  super()
  @json = json
  @error_message = json["errorMessage"]
  @last_modified = @last_modified_time = parse_time(json["lastModifiedTime"])
  @created_at = parse_time(json["createdTime"])
  @status = json["status"]
  @push_missing_dependencies = json["pushMissingDependencies"]
  @external_status = json["externalStatus"]
  @type = json["type"]
  @nominal_time = parse_time(json["nominalTime"])
  @external_id = json["externalId"]
  @id = json["id"]
  @created_conf = json["createdConf"]
  @missing_dependencies = json["missingDependencies"]
  @run_conf = json["runConf"]
  @action_number = json["actionNumber"]
  @error_code = json["errorCode"]
  @tracker_uri = json["trackerUri"]
  @to_string = json["toString"]
  @parent_id = @coord_job_id = json["coordJobId"]
  @console_url = json["consoleUrl"]
end

Instance Attribute Details

#action_numberObject (readonly)

Returns the value of attribute action_number.



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

def action_number
  @action_number
end

#console_urlObject (readonly)

Returns the value of attribute console_url.



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

def console_url
  @console_url
end

#coord_job_idObject (readonly)

Returns the value of attribute coord_job_id.



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

def coord_job_id
  @coord_job_id
end

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#created_confObject (readonly)

Returns the value of attribute created_conf.



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

def created_conf
  @created_conf
end

#error_codeObject (readonly)

Returns the value of attribute error_code.



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

def error_code
  @error_code
end

#error_messageObject (readonly)

Returns the value of attribute error_message.



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

def error_message
  @error_message
end

#external_idObject (readonly)

Returns the value of attribute external_id.



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

def external_id
  @external_id
end

#external_statusObject (readonly)

Returns the value of attribute external_status.



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

def external_status
  @external_status
end

#jsonObject (readonly)

Returns the value of attribute json.



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

def json
  @json
end

#last_modified_timeObject (readonly)

Returns the value of attribute last_modified_time.



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

def last_modified_time
  @last_modified_time
end

#missing_dependenciesObject (readonly)

Returns the value of attribute missing_dependencies.



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

def missing_dependencies
  @missing_dependencies
end

#nominal_timeObject (readonly)

Returns the value of attribute nominal_time.



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

def nominal_time
  @nominal_time
end

#parent_idObject (readonly)

Returns the value of attribute parent_id.



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

def parent_id
  @parent_id
end

#push_missing_dependenciesObject (readonly)

Returns the value of attribute push_missing_dependencies.



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

def push_missing_dependencies
  @push_missing_dependencies
end

#run_confObject (readonly)

Returns the value of attribute run_conf.



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

def run_conf
  @run_conf
end

#statusObject (readonly)

Returns the value of attribute status.



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

def status
  @status
end

#to_stringObject (readonly)

Returns the value of attribute to_string.



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

def to_string
  @to_string
end

#tracker_uriObject (readonly)

Returns the value of attribute tracker_uri.



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

def tracker_uri
  @tracker_uri
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

Class Method Details

.default_columnsObject



18
19
20
# File 'lib/hodor/api/oozie/materialization.rb', line 18

def default_columns
  [:index, :id, :status, :external_id, :type, :created_at, :nominal_time, :last_modified]
end

.default_propertiesObject



11
12
13
14
15
16
# File 'lib/hodor/api/oozie/materialization.rb', line 11

def default_properties
  [ :error_message, :last_modified_time, :created_at, :status, :push_missing_dependencies,
    :external_status, :type, :nominal_time, :external_id, :created_conf, :missing_dependencies,
    :run_conf, :action_number, :error_code, :tracker_uri, :to_string, :parent_id, :coord_job_id,
    :console_url]
end

Instance Method Details

#display_idObject



51
52
53
# File 'lib/hodor/api/oozie/materialization.rb', line 51

def display_id
  @id[@id.rindex('C@')..-1]
end

#expandObject



47
48
49
# File 'lib/hodor/api/oozie/materialization.rb', line 47

def expand
  [ oozie.job_by_id(@external_id) ]
end