/// <summary> /// If key provided matches that of this Composite, give JoinCollector /// iterator over values it may emit. /// </summary> /// <exception cref="System.IO.IOException"/> public virtual void Accept(CompositeRecordReader.JoinCollector jc, K key) { // No values from static EMPTY class if (HasNext() && 0 == cmp.Compare(key, Key())) { FillJoinCollector(CreateKey()); jc.Add(id, GetDelegate()); return; } jc.Add(id, Empty); }
/// <summary> /// Add an iterator to the collector at the position occupied by this /// RecordReader over the values in this stream paired with the key /// provided (ie register a stream of values from this source matching K /// with a collector). /// </summary> /// <exception cref="System.IO.IOException"/> public virtual void Accept(CompositeRecordReader.JoinCollector i, K key) { // JoinCollector comes from parent, which has // no static type for the slot this sits in vjoin.Clear(); if (0 == cmp.Compare(key, khead)) { do { vjoin.Add(vhead); }while (Next() && 0 == cmp.Compare(key, khead)); } i.Add(id, vjoin); }
/// <summary> /// Create a RecordReader with <tt>capacity</tt> children to position /// <tt>id</tt> in the parent reader. /// </summary> /// <remarks> /// Create a RecordReader with <tt>capacity</tt> children to position /// <tt>id</tt> in the parent reader. /// The id of a root CompositeRecordReader is -1 by convention, but relying /// on this is not recommended. /// </remarks> /// <exception cref="System.IO.IOException"/> public CompositeRecordReader(int id, int capacity, Type cmpcl) { // Generic array assignment System.Diagnostics.Debug.Assert(capacity > 0, "Invalid capacity"); this.id = id; if (null != cmpcl) { cmp = ReflectionUtils.NewInstance(cmpcl, null); q = new PriorityQueue <ComposableRecordReader <K, object> >(3, new _IComparer_78(this )); } jc = new CompositeRecordReader.JoinCollector(this, capacity); kids = new ComposableRecordReader[capacity]; }
public abstract void Accept(CompositeRecordReader.JoinCollector arg1, K arg2);