/** * @throws TeiidProcessingException * @see org.teiid.query.processor.relational.RelationalNode#nextBatchDirect() * @since 4.2 */ public TupleBatch nextBatchDirect() throws BlockedException, TeiidComponentException, TeiidProcessingException { int numExpectedCounts = updateCommands.size(); for (;commandCount < numExpectedCounts; commandCount++) { // If the command at this index was not executed if (tupleSource == null || unexecutedCommands[commandCount]) { addBatchRow(ZERO_COUNT_TUPLE); } else { // Otherwise, get the next count in the batch List<?> tuple = tupleSource.nextTuple(); if (tuple != null) { // Assumption: the number of returned tuples exactly equals the number of commands submitted addBatchRow(Arrays.asList(new Object[] {tuple.get(0)})); } else { // Should never happen since the number of expected results is known throw new TeiidComponentException(QueryPlugin.Event.TEIID30192, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30192, commandCount, numExpectedCounts)); } } } // This is the only tuple batch we need. terminateBatches(); return pullBatch(); }
/** * @throws TeiidProcessingException * @see org.teiid.query.processor.relational.RelationalNode#nextBatchDirect() * @since 4.2 */ public TupleBatch nextBatchDirect() throws BlockedException, TeiidComponentException, TeiidProcessingException { int numExpectedCounts = updateCommands.size(); for (;commandCount < numExpectedCounts; commandCount++) { // If the command at this index was not executed if (tupleSource == null || unexecutedCommands[commandCount]) { addBatchRow(ZERO_COUNT_TUPLE); } else { // Otherwise, get the next count in the batch List<?> tuple = tupleSource.nextTuple(); if (tuple != null) { // Assumption: the number of returned tuples exactly equals the number of commands submitted addBatchRow(Arrays.asList(new Object[] {tuple.get(0)})); } else { // Should never happen since the number of expected results is known throw new TeiidComponentException(QueryPlugin.Event.TEIID30192, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30192, commandCount, numExpectedCounts)); } } } // This is the only tuple batch we need. terminateBatches(); return pullBatch(); }
/** * @throws TeiidProcessingException * @see org.teiid.query.processor.relational.RelationalNode#nextBatchDirect() * @since 4.2 */ public TupleBatch nextBatchDirect() throws BlockedException, TeiidComponentException, TeiidProcessingException { int numExpectedCounts = updateCommands.size(); for (;commandCount < numExpectedCounts; commandCount++) { // If the command at this index was not executed if (tupleSource == null || unexecutedCommands[commandCount]) { addBatchRow(ZERO_COUNT_TUPLE); } else { // Otherwise, get the next count in the batch List<?> tuple = tupleSource.nextTuple(); if (tuple != null) { // Assumption: the number of returned tuples exactly equals the number of commands submitted addBatchRow(Arrays.asList(new Object[] {tuple.get(0)})); } else { // Should never happen since the number of expected results is known throw new TeiidComponentException(QueryPlugin.Event.TEIID30192, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30192, commandCount, numExpectedCounts)); } } } // This is the only tuple batch we need. terminateBatches(); return pullBatch(); }