bud 0.9.3 → 0.9.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.
- data/History.txt +9 -0
- data/lib/bud.rb +2 -5
- data/lib/bud/collections.rb +17 -5
- data/lib/bud/executor/elements.rb +1 -1
- data/lib/bud/executor/group.rb +5 -7
- data/lib/bud/executor/join.rb +4 -4
- data/lib/bud/storage/dbm.rb +1 -1
- metadata +2 -2
data/History.txt
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
== 0.9.4 / 2012-09-06
|
2
|
+
|
3
|
+
* Optimize grouping performance
|
4
|
+
* Fix regression in dbm-backed collections with MRI 1.8
|
5
|
+
* Fix regression in grouping operator with MRI 1.8 (#280)
|
6
|
+
* Fix bug in programs that applied non-monotonic operators to scratch
|
7
|
+
collections under certain circumstances (#281)
|
8
|
+
* Fix bug in "notin" with multiple qualifiers (#282)
|
9
|
+
|
1
10
|
== 0.9.3 / 2012-08-20
|
2
11
|
|
3
12
|
* Change behavior of accum() aggregate to return a Set, rather than an Array in
|
data/lib/bud.rb
CHANGED
@@ -466,16 +466,13 @@ module Bud
|
|
466
466
|
rescan_invalidate_tc(stratum, rescan, invalidate)
|
467
467
|
end
|
468
468
|
|
469
|
-
puts "(PRE) Default rescan: #{rescan.inspect}" if $BUD_DEBUG
|
470
|
-
puts "(PRE) Default inval: #{invalidate.inspect}" if $BUD_DEBUG
|
471
|
-
|
472
469
|
prune_rescan_invalidate(rescan, invalidate)
|
473
470
|
# transitive closure
|
474
471
|
@default_rescan = rescan.to_a
|
475
472
|
@default_invalidate = invalidate.to_a
|
476
473
|
|
477
|
-
puts "
|
478
|
-
puts "
|
474
|
+
puts "Default rescan: #{rescan.inspect}" if $BUD_DEBUG
|
475
|
+
puts "Default inval: #{invalidate.inspect}" if $BUD_DEBUG
|
479
476
|
|
480
477
|
# Now compute for each table that is to be scanned, the set of dependent
|
481
478
|
# tables and elements that will be invalidated if that table were to be
|
data/lib/bud/collections.rb
CHANGED
@@ -254,6 +254,11 @@ module Bud
|
|
254
254
|
@storage.each_value(&block)
|
255
255
|
end
|
256
256
|
|
257
|
+
public
|
258
|
+
def each_tick_delta(&block)
|
259
|
+
@tick_delta.each(&block)
|
260
|
+
end
|
261
|
+
|
257
262
|
public
|
258
263
|
def invalidate_at_tick
|
259
264
|
true # being conservative here as a default.
|
@@ -566,16 +571,16 @@ module Bud
|
|
566
571
|
public
|
567
572
|
def tick_deltas # :nodoc: all
|
568
573
|
unless @delta.empty?
|
569
|
-
puts "#{qualified_tabname}.
|
574
|
+
puts "#{qualified_tabname}.tick_deltas delta --> storage (#{@delta.size} elems)" if $BUD_DEBUG
|
570
575
|
@storage.merge!(@delta)
|
571
576
|
@tick_delta.concat(@delta.values) if accumulate_tick_deltas
|
572
577
|
@delta.clear
|
573
578
|
end
|
574
579
|
|
575
580
|
unless @new_delta.empty?
|
576
|
-
puts "#{qualified_tabname}.
|
581
|
+
puts "#{qualified_tabname}.tick_deltas new_delta --> delta (#{@new_delta.size} elems)" if $BUD_DEBUG
|
577
582
|
|
578
|
-
# NB: key conflicts between
|
583
|
+
# NB: key conflicts between two new_delta tuples are detected in
|
579
584
|
# do_insert().
|
580
585
|
@new_delta.each_pair do |key, tup|
|
581
586
|
merge_to_buf(@delta, key, tup, @storage[key])
|
@@ -713,10 +718,18 @@ module Bud
|
|
713
718
|
end
|
714
719
|
|
715
720
|
class BudScratch < BudCollection # :nodoc: all
|
721
|
+
# We don't need to accumulate @tick_delta separately from @storage for
|
722
|
+
# scratch collections, since @storage for scratches doesn't persistent
|
723
|
+
# across ticks (semantics-wise, at least).
|
716
724
|
def accumulate_tick_deltas
|
717
725
|
false
|
718
726
|
end
|
719
727
|
|
728
|
+
public
|
729
|
+
def each_tick_delta(&block)
|
730
|
+
@storage.each_value(&block)
|
731
|
+
end
|
732
|
+
|
720
733
|
public
|
721
734
|
def tick # :nodoc: all
|
722
735
|
@delta.clear
|
@@ -808,10 +821,9 @@ module Bud
|
|
808
821
|
end
|
809
822
|
|
810
823
|
def bootstrap
|
811
|
-
# override BudCollection;
|
824
|
+
# override BudCollection; pending should not be moved into delta.
|
812
825
|
end
|
813
826
|
|
814
|
-
|
815
827
|
private
|
816
828
|
def remove_at_sign!(cols)
|
817
829
|
i = cols.find_index {|c| c.to_s.start_with? "@"}
|
@@ -492,7 +492,7 @@ module Bud
|
|
492
492
|
else
|
493
493
|
# In the first iteration, tick_delta would be non-null IFF the
|
494
494
|
# collection has grown in an earlier stratum
|
495
|
-
@collection.
|
495
|
+
@collection.each_tick_delta {|item| push_out(item)}
|
496
496
|
end
|
497
497
|
end
|
498
498
|
|
data/lib/bud/executor/group.rb
CHANGED
@@ -35,7 +35,7 @@ module Bud
|
|
35
35
|
end
|
36
36
|
|
37
37
|
@seen_new_data = true
|
38
|
-
key =
|
38
|
+
key = item.values_at(*@keys)
|
39
39
|
group_state = @groups[key]
|
40
40
|
if group_state.nil?
|
41
41
|
@groups[key] = @aggpairs.map do |ap|
|
@@ -71,14 +71,12 @@ module Bud
|
|
71
71
|
return unless @seen_new_data
|
72
72
|
@seen_new_data = false
|
73
73
|
|
74
|
-
@groups.each do |
|
75
|
-
|
74
|
+
@groups.each do |key, group_state|
|
75
|
+
rv = key.clone
|
76
76
|
@aggpairs.each_with_index do |ap, agg_ix|
|
77
|
-
|
77
|
+
rv << ap[0].final(group_state[agg_ix])
|
78
78
|
end
|
79
|
-
|
80
|
-
(1..grp.length-1).each {|i| outval << grp[i]}
|
81
|
-
push_out(outval)
|
79
|
+
push_out(rv)
|
82
80
|
end
|
83
81
|
end
|
84
82
|
end
|
data/lib/bud/executor/join.rb
CHANGED
@@ -552,10 +552,10 @@ module Bud
|
|
552
552
|
# the tables.
|
553
553
|
@lhs_keycols, @rhs_keycols = preds.reduce([[], []]) do |memo, item|
|
554
554
|
# each item is a hash
|
555
|
-
l
|
556
|
-
|
557
|
-
|
558
|
-
|
555
|
+
item.each_pair do |l, r|
|
556
|
+
memo[0] << find_col(l, @lhs)
|
557
|
+
memo[1] << find_col(r, @rhs)
|
558
|
+
end
|
559
559
|
memo
|
560
560
|
end
|
561
561
|
end
|
data/lib/bud/storage/dbm.rb
CHANGED
@@ -147,7 +147,7 @@ module Bud
|
|
147
147
|
# We allow @new_delta to contain duplicates but eliminate them here. We
|
148
148
|
# can't just allow duplicate delta tuples because that might cause
|
149
149
|
# spurious infinite delta processing loops.
|
150
|
-
@new_delta.reject! {|key| self[key] ==
|
150
|
+
@new_delta.reject! {|key, val| self[key] == val}
|
151
151
|
|
152
152
|
@delta = @new_delta
|
153
153
|
@new_delta = {}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2012-
|
16
|
+
date: 2012-09-06 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: eventmachine
|