while (currentTuple != null || (currentTuple = ts.nextTuple()) != null) { if (crit == null || eval.evaluate(crit, currentTuple)) { tuplePassed(currentTuple); updateCount++; if (undoLog != null && currentTuple != null) { success(); success = true; } finally { try { afterCompletion(success); if (!success && undoLog != null) { undoLog.setFinal(true); while ((tuple = undoTs.nextTuple()) != null) { try { undo(tuple); } catch (TeiidException e) { LogManager.logError(LogConstants.CTX_DQP, e, e.getMessage()); bm.releaseBuffers(reserved); lock.writeLock().unlock(); close();
long updateCount = up.process(); tid.getTableData().dataModified(updateCount); return CollectionTupleSource.createUpdateCountTupleSource((int)Math.min(Integer.MAX_VALUE, updateCount));
long updateCount = up.process(); tid.getTableData().dataModified(updateCount); return CollectionTupleSource.createUpdateCountTupleSource((int)Math.min(Integer.MAX_VALUE, updateCount));
long updateCount = up.process(); tid.getTableData().dataModified(updateCount); return CollectionTupleSource.createUpdateCountTupleSource((int)Math.min(Integer.MAX_VALUE, updateCount));
while (currentTuple != null || (currentTuple = ts.nextTuple()) != null) { if (crit == null || eval.evaluate(crit, currentTuple)) { tuplePassed(currentTuple); updateCount++; if (undoLog != null && currentTuple != null) { success(); success = true; } finally { try { afterCompletion(success); if (!success && undoLog != null) { undoLog.setFinal(true); while ((tuple = undoTs.nextTuple()) != null) { try { undo(tuple); } catch (TeiidException e) { LogManager.logError(LogConstants.CTX_DQP, e, e.getMessage()); bm.releaseBuffers(reserved); lock.writeLock().unlock(); close();
while (currentTuple != null || (currentTuple = ts.nextTuple()) != null) { if (crit == null || eval.evaluate(crit, currentTuple)) { tuplePassed(currentTuple); updateCount++; if (undoLog != null && currentTuple != null) { success(); success = true; } finally { try { afterCompletion(success); if (!success && undoLog != null) { undoLog.setFinal(true); while ((tuple = undoTs.nextTuple()) != null) { try { undo(tuple); } catch (TeiidException e) { LogManager.logError(LogConstants.CTX_DQP, e, e.getMessage()); bm.releaseBuffers(reserved); lock.writeLock().unlock(); close();
public TupleSource delete(Criteria crit) throws TeiidComponentException, ExpressionEvaluationException, TeiidProcessingException { final TupleBrowser browser = createTupleBrower(crit, OrderBy.ASC); UpdateProcessor up = new UpdateProcessor(crit, browser, true) { @Override protected void tuplePassed(List tuple) throws ExpressionEvaluationException, BlockedException, TeiidComponentException { browser.removed(); deleteTuple(tuple); } @Override protected void undo(List<?> tuple) throws TeiidComponentException, TeiidProcessingException { insertTuple(tuple, false, true); } }; long updateCount = up.process(); tid.setCardinality(tree.getRowCount()); tid.getTableData().dataModified(updateCount); return CollectionTupleSource.createUpdateCountTupleSource((int)Math.min(Integer.MAX_VALUE, updateCount)); }
public TupleSource delete(Criteria crit) throws TeiidComponentException, ExpressionEvaluationException, TeiidProcessingException { final TupleBrowser browser = createTupleBrower(crit, OrderBy.ASC); UpdateProcessor up = new UpdateProcessor(crit, browser, true) { @Override protected void tuplePassed(List tuple) throws ExpressionEvaluationException, BlockedException, TeiidComponentException { browser.removed(); deleteTuple(tuple); } @Override protected void undo(List<?> tuple) throws TeiidComponentException, TeiidProcessingException { insertTuple(tuple, false, true); } }; long updateCount = up.process(); tid.setCardinality(tree.getRowCount()); tid.getTableData().dataModified(updateCount); return CollectionTupleSource.createUpdateCountTupleSource((int)Math.min(Integer.MAX_VALUE, updateCount)); }
public TupleSource delete(Criteria crit) throws TeiidComponentException, ExpressionEvaluationException, TeiidProcessingException { final TupleBrowser browser = createTupleBrower(crit, OrderBy.ASC); UpdateProcessor up = new UpdateProcessor(crit, browser, true) { @Override protected void tuplePassed(List tuple) throws ExpressionEvaluationException, BlockedException, TeiidComponentException { browser.removed(); deleteTuple(tuple); } @Override protected void undo(List<?> tuple) throws TeiidComponentException, TeiidProcessingException { insertTuple(tuple, false, true); } }; long updateCount = up.process(); tid.setCardinality(tree.getRowCount()); tid.getTableData().dataModified(updateCount); return CollectionTupleSource.createUpdateCountTupleSource((int)Math.min(Integer.MAX_VALUE, updateCount)); }
@Override public void close() { super.close(); changeSetProcessor = null; if (changeSet != null) { changeSet.remove(); changeSet = null; } }
@Override void success() throws TeiidComponentException, ExpressionEvaluationException, TeiidProcessingException { //existing tuples have been removed //changeSet contains possible updates if (primaryKeyChangePossible) { changeSet.close(); if (changeSetProcessor == null) { changeSetProcessor = new InsertUpdateProcessor(changeSet.createIndexedTupleSource(true), false, null, true, false); } changeSetProcessor.process(); //when this returns, we're up to date } }
@Override public void close() { super.close(); changeSetProcessor = null; if (changeSet != null) { changeSet.remove(); changeSet = null; } }
@Override public void close() { super.close(); changeSetProcessor = null; if (changeSet != null) { changeSet.remove(); changeSet = null; } }
@Override long process() throws ExpressionEvaluationException, TeiidComponentException, TeiidProcessingException { tree.setBatchInsert(addRowId); return super.process(); }
@Override long process() throws ExpressionEvaluationException, TeiidComponentException, TeiidProcessingException { tree.setBatchInsert(addRowId); return super.process(); }
@Override long process() throws ExpressionEvaluationException, TeiidComponentException, TeiidProcessingException { tree.setBatchInsert(addRowId); return super.process(); }
@Override public void close() { super.close(); if (this.upsertUndoLog != null) { this.upsertUndoLog.remove(); } } }
@Override public void close() { super.close(); if (this.upsertUndoLog != null) { this.upsertUndoLog.remove(); } } }
@Override void success() throws TeiidComponentException, ExpressionEvaluationException, TeiidProcessingException { //existing tuples have been removed //changeSet contains possible updates if (primaryKeyChangePossible) { changeSet.close(); if (changeSetProcessor == null) { changeSetProcessor = new InsertUpdateProcessor(changeSet.createIndexedTupleSource(true), false, null, true, false); } changeSetProcessor.process(); //when this returns, we're up to date } }
@Override void success() throws TeiidComponentException, ExpressionEvaluationException, TeiidProcessingException { //existing tuples have been removed //changeSet contains possible updates if (primaryKeyChangePossible) { changeSet.close(); if (changeSetProcessor == null) { changeSetProcessor = new InsertUpdateProcessor(changeSet.createIndexedTupleSource(true), false, null, true, false); } changeSetProcessor.process(); //when this returns, we're up to date } }