tapsoob 0.5.26-java → 0.5.27-java
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 +4 -4
 - data/lib/tapsoob/operation.rb +7 -4
 - data/lib/tapsoob/version.rb +1 -1
 - metadata +1 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 64913bf573488ae2289aa0f84f33b09430b64e7556df3829c5d96cfea40bbb1d
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 50e3ddb402f4775b791553f1c804368cf42e1c0ebb0925240a92f116a2bbca4e
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: f2c54e67813d6c1209b884e67bbfde35a1940c5ccbb82f53f4371742d0d63baa898e3f888ed94b2f7feba5428e6db3d4e5f12ac0c17ba54413e09484ffc3b82a
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: f7e820052a312fc0d81e9e146a204ed9454a724ddb642cc2c24c4100588e1825dce59e1f34585e2f5d629dad6f8a5d08180b8b2e074cd171c4b4519609f5e5d9
         
     | 
    
        data/lib/tapsoob/operation.rb
    CHANGED
    
    | 
         @@ -198,11 +198,12 @@ module Tapsoob 
     | 
|
| 
       198 
198 
     | 
    
         
             
                  log.info "#{tables.size} tables, #{format_number(record_count)} records"
         
     | 
| 
       199 
199 
     | 
    
         | 
| 
       200 
200 
     | 
    
         
             
                  tables.each do |table_name, count|
         
     | 
| 
       201 
     | 
    
         
            -
                    progress = (opts[:progress] ? ProgressBar.new(table_name.to_s, count) : nil)
         
     | 
| 
       202 
201 
     | 
    
         
             
                    stream   = Tapsoob::DataStream.factory(db, {
         
     | 
| 
       203 
202 
     | 
    
         
             
                      :chunksize  => default_chunksize,
         
     | 
| 
       204 
203 
     | 
    
         
             
                      :table_name => table_name
         
     | 
| 
       205 
204 
     | 
    
         
             
                    }, { :debug => opts[:debug] })
         
     | 
| 
      
 205 
     | 
    
         
            +
                    estimated_chunks = (count.to_f / default_chunksize).ceil
         
     | 
| 
      
 206 
     | 
    
         
            +
                    progress = (opts[:progress] ? ProgressBar.new(table_name.to_s, estimated_chunks) : nil)
         
     | 
| 
       206 
207 
     | 
    
         
             
                    pull_data_from_table(stream, progress)
         
     | 
| 
       207 
208 
     | 
    
         
             
                  end
         
     | 
| 
       208 
209 
     | 
    
         
             
                end
         
     | 
| 
         @@ -214,8 +215,10 @@ module Tapsoob 
     | 
|
| 
       214 
215 
     | 
    
         
             
                  record_count = tables[table_name.to_s]
         
     | 
| 
       215 
216 
     | 
    
         
             
                  log.info "Resuming #{table_name}, #{format_number(record_count)} records"
         
     | 
| 
       216 
217 
     | 
    
         | 
| 
       217 
     | 
    
         
            -
                  progress = (opts[:progress] ? ProgressBar.new(table_name.to_s, record_count) : nil)
         
     | 
| 
       218 
218 
     | 
    
         
             
                  stream = Tapsoob::DataStream.factory(db, stream_state)
         
     | 
| 
      
 219 
     | 
    
         
            +
                  chunksize = stream_state[:chunksize] || default_chunksize
         
     | 
| 
      
 220 
     | 
    
         
            +
                  estimated_chunks = (record_count.to_f / chunksize).ceil
         
     | 
| 
      
 221 
     | 
    
         
            +
                  progress = (opts[:progress] ? ProgressBar.new(table_name.to_s, estimated_chunks) : nil)
         
     | 
| 
       219 
222 
     | 
    
         
             
                  pull_data_from_table(stream, progress)
         
     | 
| 
       220 
223 
     | 
    
         
             
                end
         
     | 
| 
       221 
224 
     | 
    
         | 
| 
         @@ -249,8 +252,8 @@ module Tapsoob 
     | 
|
| 
       249 
252 
     | 
    
         
             
                        stream.fetch_data_from_database(data) do |rows|
         
     | 
| 
       250 
253 
     | 
    
         
             
                          next if rows == {}
         
     | 
| 
       251 
254 
     | 
    
         | 
| 
       252 
     | 
    
         
            -
                          # Update progress bar  
     | 
| 
       253 
     | 
    
         
            -
                          progress.inc( 
     | 
| 
      
 255 
     | 
    
         
            +
                          # Update progress bar by 1 chunk
         
     | 
| 
      
 256 
     | 
    
         
            +
                          progress.inc(1) if progress
         
     | 
| 
       254 
257 
     | 
    
         | 
| 
       255 
258 
     | 
    
         
             
                          if dump_path.nil?
         
     | 
| 
       256 
259 
     | 
    
         
             
                            puts JSON.generate(rows)
         
     | 
    
        data/lib/tapsoob/version.rb
    CHANGED