public TupleBuffer sort(int rowLimit) throws TeiidComponentException, TeiidProcessingException { boolean success = false; try { if(this.phase == INITIAL_SORT) { initialSort(false, false, rowLimit); } if(this.phase == MERGE) { mergePhase(rowLimit); } success = true; return this.activeTupleBuffers.get(0); } catch (BlockedException e) { success = true; throw e; } finally { if (!success) { remove(); } } }
public TupleBuffer sort(int rowLimit) throws TeiidComponentException, TeiidProcessingException { boolean success = false; try { waitForWork(); synchronized (this) { if(this.phase == INITIAL_SORT) { initialSort(false, false, rowLimit); } if(this.phase == MERGE) { mergePhase(rowLimit); } success = true; return this.activeTupleBuffers.get(0); } } catch (BlockedException e) { success = true; throw e; } finally { if (!success) { remove(); } } }
public TupleBuffer sort(int rowLimit) throws TeiidComponentException, TeiidProcessingException { boolean success = false; try { waitForWork(); synchronized (this) { if(this.phase == INITIAL_SORT) { initialSort(false, false, rowLimit); } if(this.phase == MERGE) { mergePhase(rowLimit); } success = true; return this.activeTupleBuffers.get(0); } } catch (BlockedException e) { success = true; throw e; } finally { if (!success) { remove(); } } }
public List<TupleBuffer> onePassSort(boolean lowLatency) throws TeiidComponentException, TeiidProcessingException { boolean success = false; try { if(this.phase == INITIAL_SORT) { initialSort(true, lowLatency, -1); if (!isDoneReading()) { this.phase = INITIAL_SORT; } } for (TupleBuffer tb : activeTupleBuffers) { tb.close(); tb.setForwardOnly(false); //it is up to the caller to set the flag now } success = true; return activeTupleBuffers; } catch (BlockedException e) { success = true; throw e; } finally { if (!success) { remove(); } } }
public List<TupleBuffer> onePassSort(boolean lowLatency) throws TeiidComponentException, TeiidProcessingException { boolean success = false; try { if(this.phase == INITIAL_SORT) { initialSort(true, lowLatency, -1); if (!isDoneReading()) { this.phase = INITIAL_SORT; } } for (TupleBuffer tb : activeTupleBuffers) { tb.close(); tb.setForwardOnly(false); //it is up to the caller to set the flag now } success = true; return activeTupleBuffers; } catch (BlockedException e) { success = true; throw e; } finally { if (!success) { remove(); } } }
public List<TupleBuffer> onePassSort(boolean lowLatency) throws TeiidComponentException, TeiidProcessingException { boolean success = false; try { if(this.phase == INITIAL_SORT) { initialSort(true, lowLatency, -1); if (!isDoneReading()) { this.phase = INITIAL_SORT; } } for (TupleBuffer tb : activeTupleBuffers) { tb.close(); tb.setForwardOnly(false); //it is up to the caller to set the flag now } success = true; return activeTupleBuffers; } catch (BlockedException e) { success = true; throw e; } finally { if (!success) { remove(); } } }