elasticity 4.0.2 → 4.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/HISTORY.md +4 -0
- data/lib/elasticity/job_flow.rb +1 -1
- data/lib/elasticity/job_flow_status.rb +5 -0
- data/lib/elasticity/version.rb +1 -1
- data/spec/lib/elasticity/job_flow_spec.rb +5 -14
- data/spec/lib/elasticity/job_flow_status_spec.rb +26 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZjhlNWY2ZjAwNzYxNWNkNDMzM2M1YzE3ODJmNDQ3MDA2OTQzNDA2ZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjQxMzc2ZmZlNTNhMmUwMzMwODE1MTJjOTljZjk5Mjk4ZTBkYTliYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YmE4YmYyMDE2YTEyZjM0MzZmMDBlYzQyNDI0MmFhNWJlNjhlY2Y1ZjM4NTlh
|
10
|
+
ZGM3YmQ0ODdlNDRlY2JmYjU3YTVlN2QzZDIzZDI0MTAyM2RmMmM2ODNmNWQx
|
11
|
+
YzY2NWVlNTczY2M4YThlMDZmZmY3NDFkNzAxODFhODBhYzYyNDc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZGVhYThjOTk1NmJkNThmODJjYmRiOTk1MWFkYmUyMjgzZjllOTc1NGNjZDU3
|
14
|
+
ZGRiN2FlMjVlNTM2MWU0ZWJiYmJlNTlkMzMzMzJhOWFlNzk5YWUwYWFlY2Jl
|
15
|
+
YTY5MDlmNThjZDc5Yjg1NmI5ZGNmNTE1ZTEwOTgyN2ViZDdiN2Y=
|
data/HISTORY.md
CHANGED
data/lib/elasticity/job_flow.rb
CHANGED
@@ -25,6 +25,11 @@ module Elasticity
|
|
25
25
|
@installed_steps = []
|
26
26
|
end
|
27
27
|
|
28
|
+
# http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/ProcessingCycle.html
|
29
|
+
def active?
|
30
|
+
%w{RUNNING STARTING BOOTSTRAPPING WAITING SHUTTING_DOWN}.include? state
|
31
|
+
end
|
32
|
+
|
28
33
|
# Create a jobflow from an AWS <member> (Nokogiri::XML::Element):
|
29
34
|
# /DescribeJobFlowsResponse/DescribeJobFlowsResult/JobFlows/member
|
30
35
|
def self.from_member_element(xml_element)
|
data/lib/elasticity/version.rb
CHANGED
@@ -606,8 +606,8 @@ describe Elasticity::JobFlow do
|
|
606
606
|
|
607
607
|
describe '#retry_check' do
|
608
608
|
|
609
|
-
context 'when the jobflow is
|
610
|
-
let(:jobflow_status) { double(:
|
609
|
+
context 'when the jobflow is active' do
|
610
|
+
let(:jobflow_status) { double(:active? => true) }
|
611
611
|
before do
|
612
612
|
subject.stub(:status).and_return(jobflow_status)
|
613
613
|
end
|
@@ -616,25 +616,16 @@ describe Elasticity::JobFlow do
|
|
616
616
|
end
|
617
617
|
end
|
618
618
|
|
619
|
-
context 'when the jobflow is
|
620
|
-
let(:jobflow_status) { double(:
|
619
|
+
context 'when the jobflow is not active' do
|
620
|
+
let(:jobflow_status) { double(:active? => false) }
|
621
621
|
before do
|
622
622
|
subject.stub(:status).and_return(jobflow_status)
|
623
623
|
end
|
624
624
|
it 'returns true and the result of #status' do
|
625
|
-
subject.send(:retry_check).should == [true, jobflow_status]
|
626
|
-
end
|
627
|
-
end
|
628
|
-
|
629
|
-
context 'when the jobflow is != RUNNING or STARTING' do
|
630
|
-
let(:jobflow_status) { double(:state => '_') }
|
631
|
-
before do
|
632
|
-
subject.stub(:status).and_return(jobflow_status)
|
633
|
-
end
|
634
|
-
it 'returns false and the result of #status' do
|
635
625
|
subject.send(:retry_check).should == [false, jobflow_status]
|
636
626
|
end
|
637
627
|
end
|
628
|
+
|
638
629
|
end
|
639
630
|
|
640
631
|
describe '.from_jobflow_id' do
|
@@ -236,4 +236,30 @@ describe Elasticity::JobFlowStatus do
|
|
236
236
|
end
|
237
237
|
end
|
238
238
|
|
239
|
+
describe '#active?' do
|
240
|
+
|
241
|
+
context 'when the jobflow status is terminal' do
|
242
|
+
%w{COMPLETED TERMINATED FAILED _}.each do |status|
|
243
|
+
context "when the jobflow is #{status}" do
|
244
|
+
it 'is not active' do
|
245
|
+
single_jobflow_status.state = status
|
246
|
+
single_jobflow_status.active?.should be_false
|
247
|
+
end
|
248
|
+
end
|
249
|
+
end
|
250
|
+
end
|
251
|
+
|
252
|
+
context 'when the jobflow status is not terminal' do
|
253
|
+
%w{RUNNING STARTING BOOTSTRAPPING WAITING SHUTTING_DOWN}.each do |status|
|
254
|
+
context "when the jobflow is #{status}" do
|
255
|
+
it 'is active' do
|
256
|
+
single_jobflow_status.state = status
|
257
|
+
single_jobflow_status.active?.should be_true
|
258
|
+
end
|
259
|
+
end
|
260
|
+
end
|
261
|
+
end
|
262
|
+
|
263
|
+
end
|
264
|
+
|
239
265
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elasticity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Slifka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|