public Pair < ListenableFuture < ? > , Boolean > streamMore ( SystemProcedureExecutionContext context , List < DBBPool . BBContainer > outputBuffers , int [ ] rowCountAccumulator ) { ListenableFuture < ? > writeFuture = null ; prepareBuffers ( outputBuffers ) ; Pair < Long , int [ ] > serializeResult = context . tableStreamSerializeMore ( m_tableId , m_type , outputBuffers ) ; if ( serializeResult . getFirst ( ) == SERIALIZATION_ERROR ) { // Cancel the snapshot here for ( DBBPool . BBContainer container : outputBuffers ) { container . discard ( ) ; } SnapshotSerializationException ex = new SnapshotSerializationException ( "Snapshot of table " + m_tableId + " failed to complete." ) ; for ( SnapshotTableTask task : m_tableTasks ) { task . m_target . reportSerializationFailure ( ex ) ; } return Pair . of ( null , false ) ; } if ( serializeResult . getSecond ( ) [ 0 ] > 0 ) { if ( rowCountAccumulator != null && rowCountAccumulator . length == 1 ) { rowCountAccumulator [ 0 ] += getTupleDataRowCount ( outputBuffers ) ; } writeFuture = writeBlocksToTargets ( outputBuffers , serializeResult . getSecond ( ) ) ; } else { // Return all allocated snapshot output buffers for ( DBBPool . BBContainer container : outputBuffers ) { container . discard ( ) ; } } return Pair . of ( writeFuture , serializeResult . getFirst ( ) > 0 ) ; }
Streams more tuples from the table .