Class: Bud::PushPredicate

Inherits:
PushStatefulElement show all
Defined in:
lib/bud/executor/elements.rb

Instance Attribute Summary

Attributes inherited from PushElement

#elem_name, #found_delta, #invalidated, #outputs, #pendings, #rescan, #wired_by

Attributes inherited from BudCollection

#accumulate_tick_deltas, #bud_instance, #cols, #invalidated, #is_source, #key_cols, #new_delta, #pending, #rescan, #scanner_cnt, #struct, #tabname, #wired_by

Instance Method Summary collapse

Methods inherited from PushStatefulElement

#add_rescan_invalidate

Methods inherited from PushElement

#*, #<<, #add_rescan_invalidate, #all?, #any?, #argagg, #argmax, #argmin, #check_wiring, #each_with_index, #group, #include?, #inspected, #invalidate_tables, #join, #member?, #merge, #none?, #notin, #on_include?, #one?, #print_wiring, #pro, #push_out, #push_predicate, #reduce, #rescan_at_tick, #set_block, #sort, #stratum_end, #tick, #tick_deltas, #wire_to, #wirings

Methods inherited from BudCollection

#*, #<<, #<=, #[], #add_rescan_invalidate, #argagg, #argmax, #argmin, #bootstrap, #canonicalize_col, #close, #do_insert, #each, #each_delta, #each_raw, #each_tick_delta, #each_with_index, #empty?, #exists?, #flat_map, #flush_deltas, #group, #has_key?, #include?, #init_schema, #inspect, #inspected, #invalidate_at_tick, #keys, #length, #merge, #non_temporal_predecessors, #notin, #null_tuple, #pending_merge, #positive_predecessors, #prep_aggpairs, #pro, #qualified_tabname, #reduce, #register_coll_expr, #rename, #schema, #sort, #tick, #tick_deltas, #tick_metrics, #to_push_elem, #uniquify_tabname, #val_cols, #values

Methods included from Enumerable

#pro

Constructor Details

#initialize(pred_symbol, elem_name = nil, collection_name = nil, bud_instance = nil, schema_in = nil, &blk) ⇒ PushPredicate

Returns a new instance of PushPredicate.



392
393
394
395
396
397
# File 'lib/bud/executor/elements.rb', line 392

def initialize(pred_symbol, elem_name=nil, collection_name=nil,
               bud_instance=nil, schema_in=nil, &blk)
  @pred_symbol = pred_symbol
  @in_buf = []
  super(elem_name, bud_instance, collection_name, schema_in, &blk)
end

Instance Method Details

#flushObject



404
405
406
407
# File 'lib/bud/executor/elements.rb', line 404

def flush
  # always rescans
  @in_buf.send(@pred_symbol, @blk)
end

#insert(item, source) ⇒ Object



399
400
401
# File 'lib/bud/executor/elements.rb', line 399

def insert(item, source)
  @in_buf << item
end

#invalidate_cacheObject



409
410
411
# File 'lib/bud/executor/elements.rb', line 409

def invalidate_cache
  @in_buf.clear
end