rbarman 0.0.7 → 0.0.8

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: 29bd950718d01de50692a5a2ff8a853519df6114
4
- data.tar.gz: 93b31c506f43ceb45ee987b3b47e1dc7677f4de5
3
+ metadata.gz: 51204ed022e1cb170e2b95a345423251ce9cfbfb
4
+ data.tar.gz: 02c0228594aaea19f4e6526645b74212ca55d895
5
5
  SHA512:
6
- metadata.gz: ad2af43f8affe524a9f503fce285b5b0508c17d21dd9985e89113aafd3cbe4aa6d5ea159c3dd3d013bef74ad8e0aaee187733b9fb10ae21f0a30464119f19eef
7
- data.tar.gz: 95f33262cde6ef80f2976157bad11ea2e7d22a88ddd7cdd0c6f88703b244d2fd49f4396035783239e750fcc61f74198ec3d660be0219835fbbfeb892c4c04939
6
+ metadata.gz: 2f0e62639147bab58e67c0067f8590217dc267337ca40d72362d4e90eeb9372db410937627e4cb57012369fc2a625c2c782fc463237efb772667e2ae1815ef65
7
+ data.tar.gz: fb0fc2ff0e19e5d5a711ac03add7a53a2f1ff740140c9d8d11ff9e49747de6295e8c5a5fcd3a9899b2f8e5b3b43e2d66f40ceb370cfb5b387fd2fae5ac9629bd
@@ -192,6 +192,47 @@ module RBarman
192
192
  @deleted = true
193
193
  end
194
194
 
195
+ # @return [Array, String] a range of available xlog entries
196
+ def xlog_range
197
+ start_xlog = @begin_wal.xlog
198
+ end_xlog = @wal_files.last.xlog
199
+ xlog_range = Array.new
200
+ (start_xlog.to_i(16)..end_xlog.to_i(16)).to_a.each do |i|
201
+ xlog_range << i.to_s(16).upcase
202
+ end
203
+ xlog_range
204
+ end
205
+
206
+ # @return [WalFiles] all wal files which should exist in this backup
207
+ def needed_wal_files
208
+ needed = Array.new
209
+ xlog_range.each do |xlog|
210
+ start = 0
211
+ if @begin_wal.xlog == xlog.to_s.rjust(8,'0')
212
+ start = @begin_wal.segment.to_i(16)
213
+ end
214
+ (start..254).each do |seg|
215
+ w = WalFile.new
216
+ w.timeline = @begin_wal.timeline
217
+ w.xlog = xlog.rjust(8,'0')
218
+ w.segment = seg.to_s(16).rjust(8,'0').upcase
219
+ needed << w
220
+ break if w == @wal_files.last
221
+ end
222
+ end
223
+ WalFiles.new(needed)
224
+ end
225
+
226
+ # @return [WalFiles] all wal files which don't exist in this backup
227
+ def missing_wal_files
228
+ missing = Array.new
229
+ needed_wal_files.each do |needed|
230
+ existing = @wal_files.select { |f| f == needed }.first
231
+ missing << existing unless existing
232
+ end
233
+ WalFiles.new(missing)
234
+ end
235
+
195
236
  # Instructs the underlying (barman) command to recover this backup
196
237
  # @param [String] path the path to which the backup should be restored
197
238
  # @param [Hash] opts options passed as arguments to barman recover cmd
@@ -1,3 +1,3 @@
1
1
  module RBarman
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbarman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Holger Amann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-13 00:00:00.000000000 Z
11
+ date: 2013-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  version: '0'
106
106
  requirements: []
107
107
  rubyforge_project:
108
- rubygems_version: 2.0.0
108
+ rubygems_version: 2.1.8
109
109
  signing_key:
110
110
  specification_version: 4
111
111
  summary: Wrapper for 2ndQuadrant's PostgreSQL backup tool 'barman'