flydata 0.8.3 → 0.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3b07bc6d96c6f880657b1c3bd04cdca32b6a7733
4
- data.tar.gz: c229361c0f7a9a901c47d843575472ded9160580
3
+ metadata.gz: 4c20a47aa58c47fa1b27cbc66f95ddf6a1e2167f
4
+ data.tar.gz: b3004ee91995280c34054010d17b30ee969f5f32
5
5
  SHA512:
6
- metadata.gz: 055ebeaa6935d909a447d38ecaabe75a99886fe4640bde07b58724274967a487d122da6cf6ae2948d0a1fec742df011cda5bdb3ec1ce46250f639826b0aa78c9
7
- data.tar.gz: 86341f2728f2d142e9e4b44b9d10cabc583c3b3507b92dde437aab89d49a1fa6e303d0344a43a2cc2e82fb8bee4716975eb8892f55f06e888858f43efae1444e
6
+ metadata.gz: b114a92cdb9ec3559a1bd631bb79abe43da8f4b1b75627024acb4d29c9763daf566a68094c97ded5a2c0a028a1545d3f3159d3c2326b7df3c111cc4ad909250d
7
+ data.tar.gz: a35079372596b80168ea1222fbb8c8649fe191288b2e3dd71d0507f718664a6976337527ca831f1d8aba1f73a48c4ec7cb01f416ab4bbfc469647e988d788ddb
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.3
1
+ 0.8.4
data/circle.yml CHANGED
@@ -15,6 +15,7 @@ dependencies:
15
15
  - wget --no-check-certificate -O mysql-replication-listener.zip https://github.com/flydata/mysql-replication-listener/archive/master.zip
16
16
  - unzip mysql-replication-listener.zip
17
17
  - cd mysql-replication-listener-master; cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DBoost_NO_BOOST_CMAKE=ON .; make -j4; sudo make install
18
+ - gem install io-console -v 0.4.6
18
19
 
19
20
  database:
20
21
  override:
data/flydata.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "flydata"
8
- s.version = "0.8.3"
8
+ s.version = "0.8.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Koichi Fujikawa", "Masashi Miyazaki", "Matthew Luu", "Mak Inada", "Sriram NS"]
12
- s.date = "2017-02-14"
12
+ s.date = "2017-02-22"
13
13
  s.description = "FlyData Agent"
14
14
  s.email = "sysadmin@flydata.com"
15
15
  s.executables = ["fdredshift", "flydata", "serverinfo", "split_sync_ddl.rb"]
@@ -207,6 +207,7 @@ Gem::Specification.new do |s|
207
207
  "lib/flydata/helper/action/check_abnormal_shutdown.rb",
208
208
  "lib/flydata/helper/action/check_remote_actions.rb",
209
209
  "lib/flydata/helper/action/clear.rb",
210
+ "lib/flydata/helper/action/flush.rb",
210
211
  "lib/flydata/helper/action/repair.rb",
211
212
  "lib/flydata/helper/action/reset.rb",
212
213
  "lib/flydata/helper/action/restart_agent.rb",
@@ -367,6 +368,7 @@ Gem::Specification.new do |s|
367
368
  "spec/flydata/helper/action/check_abnormal_shutdown_spec.rb",
368
369
  "spec/flydata/helper/action/check_remote_actions_spec.rb",
369
370
  "spec/flydata/helper/action/clear_spec.rb",
371
+ "spec/flydata/helper/action/flush_spec.rb",
370
372
  "spec/flydata/helper/action/repair_spec.rb",
371
373
  "spec/flydata/helper/action/reset_spec.rb",
372
374
  "spec/flydata/helper/action/restart_agent_spec.rb",
@@ -97,6 +97,8 @@ module Flydata
97
97
  on 'f', 'skip-flush', 'Skip server flush'
98
98
  on 'y', 'yes', 'Skip command prompt assuming yes to all questions. Use this for batch operation.'
99
99
  on 'force-run', 'Run forcefully, ignoring exclusive run info'
100
+ on 'server-timeout=', 'Server data processing timeout', as: Integer, default: SERVER_DATA_PROCESSING_TIMEOUT
101
+ on 'dont-wait-upload', 'Do not wait for queue items to be processed.'
100
102
  end
101
103
  end
102
104
 
@@ -104,7 +106,9 @@ module Flydata
104
106
  # - Entry method
105
107
  def flush(*tables)
106
108
  begin
107
- flush_buffer_and_stop(tables, skip_flush: opts.skip_flush?)
109
+ flush_buffer_and_stop(tables, skip_flush: opts.skip_flush?,
110
+ timeout: opts[:'server-timeout'],
111
+ dont_wait_upload: opts.dont_wait_upload?)
108
112
  rescue ServerDataProcessingTimeout => e
109
113
  ee = ServerDataProcessingTimeout.new("Delayed Data Processing")
110
114
  ee.description = <<EOS
@@ -0,0 +1,32 @@
1
+ require 'flydata/helper/action/agent_action'
2
+
3
+ module Flydata
4
+ module Helper
5
+ module Action
6
+ class Flush < AgentAction
7
+ def command(opts = {})
8
+ "sync:flush -y %s" % [build_options(opts)]
9
+ end
10
+
11
+ def build_options(opts)
12
+ opt_str = ""
13
+
14
+ if config_hash(opts)[:skip_flush] # skip server flush
15
+ opt_str << " --skip-flush"
16
+ end
17
+
18
+ timeout = config_hash(opts)[:server_timeout].to_i
19
+ if timeout > 0 && timeout <= 3600 # max 1 hour
20
+ opt_str << " --server-timeout #{timeout}"
21
+ end
22
+
23
+ if !!config_hash(opts)[:dont_wait_upload]
24
+ opt_str << " --dont-wait-upload"
25
+ end
26
+
27
+ opt_str
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -53,6 +53,7 @@ module Flydata
53
53
  self.new(:clear, true, Action::Clear),
54
54
  self.new(:stop_helper, true, Action::StopHelper),
55
55
  self.new(:reset, true, Action::Reset),
56
+ self.new(:flush, true, Action::Flush),
56
57
  ].inject({}) do |h, action|
57
58
  h[action.action_name] = action
58
59
  h
@@ -0,0 +1,37 @@
1
+ require 'spec_helper'
2
+ require_relative '../helper_shared_context'
3
+ require 'flydata/helper/action/flush'
4
+
5
+ module Flydata
6
+ module Helper
7
+ module Action
8
+ describe Flush do
9
+ include_context 'helper context'
10
+
11
+ describe "#command" do
12
+ subject { described_class.new(config).command(opts) }
13
+
14
+ context 'without opts' do
15
+ let(:opts) { {} }
16
+ it { is_expected.to eq("sync:flush -y ") }
17
+ end
18
+
19
+ context 'with skip flush option' do
20
+ let(:opts) { {config_hash: {skip_flush: true}} }
21
+ it { is_expected.to eq("sync:flush -y --skip-flush") }
22
+ end
23
+
24
+ context 'with server-timeout option' do
25
+ let(:opts) { {config_hash: {server_timeout: 180}} }
26
+ it { is_expected.to eq("sync:flush -y --server-timeout 180")}
27
+ end
28
+
29
+ context 'with dont-wait-upload option' do
30
+ let(:opts) { {config_hash: {dont_wait_upload: true}} }
31
+ it { is_expected.to eq("sync:flush -y --dont-wait-upload")}
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flydata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Koichi Fujikawa
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2017-02-14 00:00:00.000000000 Z
15
+ date: 2017-02-22 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rest-client
@@ -710,6 +710,7 @@ files:
710
710
  - lib/flydata/helper/action/check_abnormal_shutdown.rb
711
711
  - lib/flydata/helper/action/check_remote_actions.rb
712
712
  - lib/flydata/helper/action/clear.rb
713
+ - lib/flydata/helper/action/flush.rb
713
714
  - lib/flydata/helper/action/repair.rb
714
715
  - lib/flydata/helper/action/reset.rb
715
716
  - lib/flydata/helper/action/restart_agent.rb
@@ -870,6 +871,7 @@ files:
870
871
  - spec/flydata/helper/action/check_abnormal_shutdown_spec.rb
871
872
  - spec/flydata/helper/action/check_remote_actions_spec.rb
872
873
  - spec/flydata/helper/action/clear_spec.rb
874
+ - spec/flydata/helper/action/flush_spec.rb
873
875
  - spec/flydata/helper/action/repair_spec.rb
874
876
  - spec/flydata/helper/action/reset_spec.rb
875
877
  - spec/flydata/helper/action/restart_agent_spec.rb