tapsoob 0.5.5 → 0.5.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tapsoob/data_stream.rb +9 -9
- data/lib/tapsoob/schema.rb +2 -2
- data/lib/tapsoob/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4f6bba051edfb49552f8f9e8612ca25f55570b9065546941e534462caac0673
|
4
|
+
data.tar.gz: 28750edabd5e25d66ce1498f8e1fa3c32079affabc8d857cf043489566faa268
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c91aeb288d41875ae9d2a43361fd4d31938c0d80d087320499948825a9cfd7818b25a6656d5aab9ce995786dbd75a124ddb49eaa6c125905bcef936f829d886a
|
7
|
+
data.tar.gz: 912725aa7e52cd41812260704a9fb91b543e1ff4b77ea904c784f1497a227f8914c10404132d30c5339d220b01369e9ea6f5000ce3126adab02c8059e24c3591
|
data/lib/tapsoob/data_stream.rb
CHANGED
@@ -72,7 +72,7 @@ module Tapsoob
|
|
72
72
|
# keep a record of the average chunksize within the first few hundred thousand records, after chunksize
|
73
73
|
# goes below 100 or maybe if offset is > 1000
|
74
74
|
def fetch_rows
|
75
|
-
state[:chunksize] = fetch_chunksize
|
75
|
+
#state[:chunksize] = fetch_chunksize
|
76
76
|
ds = table.order(*order_by).limit(state[:chunksize], state[:offset])
|
77
77
|
state[:size] = table.count
|
78
78
|
log.debug "DataStream#fetch_rows SQL -> #{ds.sql}"
|
@@ -86,7 +86,7 @@ module Tapsoob
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def fetch_file(dump_path)
|
89
|
-
state[:chunksize] = fetch_chunksize
|
89
|
+
#state[:chunksize] = fetch_chunksize
|
90
90
|
ds = JSON.parse(File.read(File.join(dump_path, "data", "#{table_name}.json")))
|
91
91
|
state[:size] = ds["data"].size
|
92
92
|
log.debug "DataStream#fetch_file"
|
@@ -104,13 +104,13 @@ module Tapsoob
|
|
104
104
|
20
|
105
105
|
end
|
106
106
|
|
107
|
-
def fetch_chunksize
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
end
|
107
|
+
#def fetch_chunksize
|
108
|
+
# chunksize = state[:chunksize]
|
109
|
+
# return chunksize if state[:num_chunksize] < max_chunksize_training
|
110
|
+
# return chunksize if state[:avg_chunksize] == 0
|
111
|
+
# return chunksize if state[:error]
|
112
|
+
# state[:avg_chunksize] > chunksize ? state[:avg_chunksize] : chunksize
|
113
|
+
#end
|
114
114
|
|
115
115
|
def update_chunksize_stats
|
116
116
|
return if state[:num_chunksize] >= max_chunksize_training
|
data/lib/tapsoob/schema.rb
CHANGED
@@ -15,13 +15,13 @@ module Tapsoob
|
|
15
15
|
template = ERB.new <<-END_MIG
|
16
16
|
Class.new(Sequel::Migration) do
|
17
17
|
def up
|
18
|
-
<% db.tables.each do |table| %>
|
18
|
+
<% db.send(:sort_dumped_tables, db.tables, {}).each do |table| %>
|
19
19
|
<%= db.dump_table_schema(table, indexes: false) %>
|
20
20
|
<% end %>
|
21
21
|
end
|
22
22
|
|
23
23
|
def down
|
24
|
-
<% db.tables.each do |table| %>
|
24
|
+
<% db.send(:sort_dumped_tables, db.tables, {}).reverse.each do |table| %>
|
25
25
|
drop_table("<%= table %>", if_exists: true)
|
26
26
|
<% end %>
|
27
27
|
end
|
data/lib/tapsoob/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tapsoob
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Félix Bellanger
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-04-
|
12
|
+
date: 2022-04-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ripl
|