Class: RakeGraph::TaskNode

Inherits:
Node
  • Object
show all
Defined in:
lib/azkaban-rb/visualization.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#name, #type

Instance Method Summary collapse

Methods inherited from Node

#fontcolor, #to_s

Constructor Details

#initialize(task) ⇒ TaskNode

Returns a new instance of TaskNode.



98
99
100
101
# File 'lib/azkaban-rb/visualization.rb', line 98

def initialize(task)
  super(RakeGraph.task_name(task), task.job.class.to_s)
  @task = task
end

Instance Attribute Details

#taskObject (readonly)

Returns the value of attribute task.



96
97
98
# File 'lib/azkaban-rb/visualization.rb', line 96

def task
  @task
end

Instance Method Details

#fillcolorObject



112
113
114
115
116
117
118
119
120
121
122
# File 'lib/azkaban-rb/visualization.rb', line 112

def fillcolor
  case @type
    when 'Azkaban::PigJob'
      return '#e7a5a5'
    when 'Azkaban::JavaJob'
      return '#E7C6A5'
    when 'Azkaban::CommandJob'
      return '#e7e6a5'
  end
  return ""
end

#labelObject



103
104
105
106
# File 'lib/azkaban-rb/visualization.rb', line 103

def label
  label = "<#{@task}<br/>#{@task.job.uses_arg}>"
  return label.to_sym
end

#shapeObject



108
109
110
# File 'lib/azkaban-rb/visualization.rb', line 108

def shape
  return :ellipse
end