1 21 22 package org.apache.derby.impl.store.access.sort; 23 24 import org.apache.derby.iapi.reference.SQLState; 25 26 import org.apache.derby.iapi.services.io.FormatableBitSet; 27 import org.apache.derby.iapi.services.sanity.SanityManager; 28 29 import org.apache.derby.iapi.error.StandardException; 30 import org.apache.derby.iapi.store.access.conglomerate.ScanControllerRowSource; 31 import org.apache.derby.iapi.store.access.conglomerate.TransactionManager; 32 import org.apache.derby.iapi.store.access.SortObserver; 33 import org.apache.derby.iapi.store.access.RowLocationRetRowSource; 34 35 import org.apache.derby.iapi.types.DataValueDescriptor; 36 37 import org.apache.derby.iapi.types.RowLocation; 38 39 import java.util.Vector ; 40 41 51 public class MergeScanRowSource extends MergeScan implements ScanControllerRowSource 52 { 53 54 55 MergeScanRowSource( 56 MergeSort sort, 57 TransactionManager tran, 58 SortBuffer sortBuffer, 59 Vector mergeRuns, 60 SortObserver sortObserver, 61 boolean hold) 62 { 63 super(sort, tran, sortBuffer, mergeRuns, sortObserver, hold); 64 } 65 66 70 public boolean next() throws StandardException 71 { 72 throw StandardException.newException( 73 SQLState.SORT_IMPROPER_SCAN_METHOD); 74 } 75 76 77 78 79 80 81 public DataValueDescriptor[] getNextRowFromRowSource() 82 throws StandardException 83 { 84 DataValueDescriptor[] row = sortBuffer.removeFirst(); 85 86 if (row != null) 87 { 88 mergeARow(sortBuffer.getLastAux()); 89 } 90 91 return row; 92 } 93 94 97 public boolean needsRowLocation() 98 { 99 return false; 100 } 101 102 105 public boolean needsToClone() 106 { 107 return false; 108 } 109 110 111 114 public void rowLocation(RowLocation rl) 115 { 116 if (SanityManager.DEBUG) 117 SanityManager.THROWASSERT("unexpected call to RowSource.rowLocation"); 118 } 119 120 121 124 public FormatableBitSet getValidColumns() 125 { 126 return null; 127 } 128 129 132 public void closeRowSource() 133 { 134 close(); 135 } 136 137 } 138 139 | Popular Tags |