tiny-presto 0.0.5 → 0.0.6

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
  SHA256:
3
- metadata.gz: 938398a2ef1f907c63890cc11389d86bfe9560157ad87a79612d141f0be68be7
4
- data.tar.gz: 533ecedfa97e00887022f3cccdfe015213e43974eff8a9c677ccd011504d6ce1
3
+ metadata.gz: b9450ad107fdacbc74c5bb6701fe14dffeedeea73271c482f9215c34560feea9
4
+ data.tar.gz: edf1b44fcf2e83f231e7e98f9162e87518397f0b31dd5d6cf8ddc2dc517d62cf
5
5
  SHA512:
6
- metadata.gz: f5fbcc42461d7cbeb4a05cd69a46eca6cb9ae4869d467b798180896fbafc22b7941bf884d2833a9f28293130712ee921fee2bd9f8cfa643d84a48ae9f8dc28d8
7
- data.tar.gz: cbcf3ff9bdb6ddad85e0d22db795fdcca10ed13c82be0e6c0cd4e1b9063f4ee2c02698f8abfcd6f8a3800d4af6a49f400c219ecff54f21f07f2e3d6919adfb19
6
+ metadata.gz: c8b3d5ad1609dc68e8a5b5149d3381ffb103b0ef9aa6ac286eae9b0ff639b371ffa10ecd2734709e8710dcf43d62344548556f36d66d37bc2247b9d3e9339f70
7
+ data.tar.gz: 64ab5b8eb78343a27d94097ff4a841b6855b8bb7a90ef6e79aecc87e2438c54e5998df5660ac45c0b65ffd426f21116376c6a4f91f3f0d927bd60a464c061384
@@ -74,6 +74,9 @@ module TinyPresto
74
74
  rows
75
75
  end
76
76
 
77
+ RETRYABLE_ERRORS = [
78
+ /No nodes available to run query/
79
+ ]
77
80
  # Run the given query with retrying in case of undeterministic error.
78
81
  #
79
82
  # TinyPresto.run_with_retry("show schemas")
@@ -83,10 +86,11 @@ module TinyPresto
83
86
  return run(sql)
84
87
  rescue Presto::Client::PrestoQueryError => e
85
88
  # Cluster may be in the initialization phase.
86
- raise unless e.message.match?(/^No nodes available to run query/)
87
-
88
- sleep(1000)
89
- next
89
+ if RETRYABLE_ERRORS.any? { |err| e.message =~ err }
90
+ sleep(1)
91
+ next
92
+ end
93
+ raise
90
94
  end
91
95
  end
92
96
 
@@ -17,6 +17,7 @@ module TinyPresto
17
17
  Docker::Image.create('fromImage' => @image_name)
18
18
  @container = Docker::Container.create(
19
19
  'Image' => @image_name,
20
+ 'ExposedPorts' => { '8080/tcp' => {} },
20
21
  'HostConfig' => {
21
22
  'PortBindings' => {
22
23
  '8080/tcp' => [
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TinyPresto
4
- VERSION = '0.0.5'.freeze
4
+ VERSION = '0.0.6'.freeze
5
5
  end
@@ -5,7 +5,7 @@ require 'spec_helper'
5
5
  RSpec.describe TinyPresto do
6
6
  describe '#version' do
7
7
  it 'correct' do
8
- expect(TinyPresto::VERSION).to eq('0.0.5')
8
+ expect(TinyPresto::VERSION).to eq('0.0.6')
9
9
  end
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tiny-presto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kai Sasaki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-12 00:00:00.000000000 Z
11
+ date: 2020-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docker-api