All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bigdata.striterator.IChunkedOrderedIterator Maven / Gradle / Ivy

/*

Copyright (C) SYSTAP, LLC DBA Blazegraph 2006-2016.  All rights reserved.

Contact:
     SYSTAP, LLC DBA Blazegraph
     2501 Calvert ST NW #106
     Washington, DC 20008
     [email protected]

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

*/
/*
 * Created on Jun 21, 2008
 */

package com.bigdata.striterator;

import java.util.NoSuchElementException;


/**
 * An extension of {@link IChunkedIterator} interface that knows about natural
 * traversal orders and how to re-order the elements that are being visited to
 * support JOINs where the natural order for the access paths is different for
 * the left- and right-hand side of the JOIN.
 * 
 * @author Bryan Thompson
 * @version $Id$
 * 
 * @param 
 *            The generic type for the [R]elation elements.
 */
public interface IChunkedOrderedIterator extends IChunkedIterator {

    /**
     * The natural order in which elements are being visited.
     * 
     * @return The natural order in which the elements are being visited -or-
     *         null if not known.
     */
    public IKeyOrder getKeyOrder();
    
    /**
     * Return the next "chunk" of elements. The elements will be in the
     * specified order. If {@link #getKeyOrder()} would return non-null
     * and the request order corresponds to the value that would be returned by
     * {@link #getKeyOrder()} then the elements in the next chunk are NOT
     * sorted. Otherwise the elements in the next chunk are sorted before they
     * are returned. The size of the chunk is up to the implementation.
     * 
     * @param keyOrder
     *            The natural order for the elements in the chunk.
     * 
     * @return The next chunk of elements in the specified order.
     * 
     * @throws NoSuchElementException
     *             if the iterator is exhausted.
     * @throws IllegalArgumentException
     *             if the keyOrder is null.
     */
    public R[] nextChunk(IKeyOrder keyOrder);
    
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy