Search in sources :

Example 6 with Sort

use of org.apache.derby.iapi.store.access.conglomerate.Sort in project derby by apache.

the class RAMTransaction method openSortRowSource.

/**
 *	@see TransactionController#openSortRowSource
 *	@exception StandardException Standard error policy.
 */
public RowLocationRetRowSource openSortRowSource(long id) throws StandardException {
    Sort sort;
    // if it doesn't exist.
    if (sorts == null || id >= sorts.size() || (sort = (sorts.get((int) id))) == null) {
        throw StandardException.newException(SQLState.AM_NO_SUCH_SORT, id);
    }
    // Open a scan row source on it.
    ScanControllerRowSource sc = sort.openSortRowSource(this);
    // Keep track of it so we can release on close.
    scanControllers.add((ScanManager) sc);
    return sc;
}
Also used : ScanControllerRowSource(org.apache.derby.iapi.store.access.conglomerate.ScanControllerRowSource) Sort(org.apache.derby.iapi.store.access.conglomerate.Sort)

Example 7 with Sort

use of org.apache.derby.iapi.store.access.conglomerate.Sort in project derby by apache.

the class RAMTransaction method dropSort.

/**
 *	Drop a sort.
 *    <p>
 *    Drop a sort created by a call to createSort() within the current
 *    transaction (sorts are automatically "dropped" at the end of a
 *    transaction.  This call should only be made after all openSortScan()'s
 *    and openSort()'s have been closed.
 *    <p>
 *
 *    @param sortid The identifier of the sort to drop, as returned from
 *                  createSort.
 * 	@exception StandardException From a lower-level exception.
 */
public void dropSort(long sortid) throws StandardException {
    // should call close on the sort.
    Sort sort = sorts.get((int) sortid);
    if (sort != null) {
        sort.drop(this);
        sorts.set((int) sortid, null);
        freeSortIds.add((int) sortid);
    }
}
Also used : Sort(org.apache.derby.iapi.store.access.conglomerate.Sort)

Aggregations

Sort (org.apache.derby.iapi.store.access.conglomerate.Sort)7 SortController (org.apache.derby.iapi.store.access.SortController)3 ScanManager (org.apache.derby.iapi.store.access.conglomerate.ScanManager)3 ConglomerateController (org.apache.derby.iapi.store.access.ConglomerateController)2 ArrayList (java.util.ArrayList)1 GroupFetchScanController (org.apache.derby.iapi.store.access.GroupFetchScanController)1 ScanController (org.apache.derby.iapi.store.access.ScanController)1 Conglomerate (org.apache.derby.iapi.store.access.conglomerate.Conglomerate)1 MethodFactory (org.apache.derby.iapi.store.access.conglomerate.MethodFactory)1 ScanControllerRowSource (org.apache.derby.iapi.store.access.conglomerate.ScanControllerRowSource)1 SortFactory (org.apache.derby.iapi.store.access.conglomerate.SortFactory)1