Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Scan"/> class.
        /// </summary>
        /// <param name="planOperator">The descriptive query plan operator that is the counterpart of this physical operator.</param>
        /// <param name="cursor">The triple cursor used for reading in triples.</param>
        /// <param name="inputSortOrder">The sort order the triples arrive in.</param>
        /// <param name="pattern">The Simple Access Pattern to match.</param>
        /// <param name="count">The number of triples to read.</param>
        public Scan(qp::Operator planOperator, TripleCursor cursor, SortOrder inputSortOrder, Triple <TripleItem, TripleItem, TripleItem> pattern, long count = -1)
        {
            m_planOperator = planOperator;
#if DEBUG
            m_planOperator.StartCPUWork();
#endif
            m_cursor     = cursor;
            m_inputOrder = inputSortOrder;
            m_pattern    = pattern;

            if (count > -1)
            {
                m_isMiniBucket = true;
                m_count        = count;
            }
            else
            {
                m_isMiniBucket = false;
            }

            //
            // identify the atoms in the given SAP to match

            m_patternAtoms = TriplePosition.None;
            if (m_pattern.S is Atom)
            {
                m_patternAtoms |= TriplePosition.S;
            }
            if (m_pattern.P is Atom)
            {
                m_patternAtoms |= TriplePosition.P;
            }
            if (m_pattern.O is Atom)
            {
                m_patternAtoms |= TriplePosition.O;
            }
#if DEBUG
            m_planOperator.StopCPUWork();
#endif
            //
            // prepare the next set of output bindings

            TryReadNext();
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HashJoin"/> class.
        /// </summary>
        /// <param name="planOperator">The descriptive query plan operator that is the counterpart of this physical operator.</param>
        /// <param name="left">This operator's left input operator.</param>
        /// <param name="right">This operator's right input operator.</param>
        public HashJoin(qp::Operator planOperator, Operator left, Operator right)
        {
            m_planOperator = planOperator;
#if DEBUG
            m_planOperator.StartCPUWork();
#endif
            m_left             = left;
            m_right            = right;
            m_tmpDbsCreated    = false;
            m_joinVariables    = new List <Variable>();
            m_byteComparer     = new ByteArrayComparer(1);
            m_chunkTable       = new Dictionary <byte[], List <BindingSet> >(new ByteArrayEqualityComparer());
            m_currentChunkList = new Queue <BindingSet>();
#if DEBUG
            m_planOperator.StopCPUWork();
#endif
            //
            // prepare the next set of output bindings

            TryReadNext();
        }