Top Description Fields Constructors Methods
com.mysql.cj.protocol.a.result

public Class ResultsetRowsStreaming<T extends ProtocolEntity>

extends AbstractResultsetRows
implements ResultsetRows
Class Inheritance
All Implemented Interfaces
com.mysql.cj.protocol.ResultsetRows, com.mysql.cj.protocol.ProtocolEntity, com.mysql.cj.result.RowList, java.util.Iterator
Type Parameters
<T>
ProtocolEntity type
Imports
java.util.concurrent.locks.Lock, .ReentrantLock, com.mysql.cj.Messages, .Session, com.mysql.cj.conf.PropertyKey, com.mysql.cj.exceptions.CJException, .ExceptionFactory, .ExceptionInterceptor, .StreamingNotifiable, com.mysql.cj.log.ProfilerEvent, com.mysql.cj.protocol.ColumnDefinition, .ProtocolEntity, .ProtocolEntityFactory, .Resultset.Concurrency, .ResultsetRow, .ResultsetRows, com.mysql.cj.protocol.a.BinaryRowFactory, .NativeMessageBuilder, .NativePacketPayload, .NativeProtocol, .TextRowFactory, com.mysql.cj.result.Row, com.mysql.cj.telemetry.TelemetryAttribute, .TelemetryScope, .TelemetrySpan, .TelemetrySpanName, com.mysql.cj.util.Util

Provides streaming of Resultset rows. Each next row is consumed from the input stream only on next() call. Consumed rows are not cached thus result sets are streamed only when they are forward-only, read-only, and the fetch size has been set to Integer.MIN_VALUE (rows are read one by one).

Field Summary

Modifier and TypeField and Description
private NativeMessageBuilder
private ExceptionInterceptor
private boolean
private boolean
private final Lock
private Row
private boolean
private NativeProtocol
private ProtocolEntityFactory<T, NativePacketPayload>
private boolean
Inherited from com.mysql.cj.protocol.a.result.AbstractResultsetRows:
BEFORE_START_OF_ROWScurrentPositionInFetchedRowsmetadataownerrowFactorywasEmpty

Constructor Summary

AccessConstructor and Description
public
ResultsetRowsStreaming(NativeProtocol
the connection to MySQL that this data is coming from
protocol
,
ColumnDefinition
the metadata that describe this data
columnDefinition
,
boolean
is this data in native format?
isBinaryEncoded
,
ProtocolEntityFactory<T, NativePacketPayload> resultSetFactory)

Creates a new ResultsetRowsStreaming object.

Method Summary

Modifier and TypeMethod and Description
public void
afterLast()

Overrides default com.mysql.cj.protocol.ResultsetRows.afterLast.

Moves to after last.

public void
beforeFirst()

Overrides default com.mysql.cj.protocol.ResultsetRows.beforeFirst.

Moves to before first.

public void
beforeLast()

Overrides default com.mysql.cj.protocol.ResultsetRows.beforeLast.

Moves to before last.

public void
close()

Overrides default com.mysql.cj.protocol.ResultsetRows.close.

We're done.

public int
getPosition()

Overrides default com.mysql.cj.result.RowList.getPosition.

Returns the current position.

public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.

public boolean
isAfterLast()

Implements com.mysql.cj.protocol.ResultsetRows.isAfterLast.

Returns true if we got the last element.

public boolean
isBeforeFirst()

Implements com.mysql.cj.protocol.ResultsetRows.isBeforeFirst.

Returns if iteration has not occured yet.

public boolean
isEmpty()

Overrides default com.mysql.cj.protocol.ResultsetRows.isEmpty.

Has no records.

public boolean
isFirst()

Overrides default com.mysql.cj.protocol.ResultsetRows.isFirst.

Are we on the first row of the result set?

public boolean
isLast()

Overrides default com.mysql.cj.protocol.ResultsetRows.isLast.

Are we on the last row of the result set?

public void
moveRowRelative(int
the relative number of rows to move
rows
)

Overrides default com.mysql.cj.protocol.ResultsetRows.moveRowRelative.

Moves the current position relative 'rows' from the current position.

public Row
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.

public void
setCurrentRow(int
row to move to
rowNumber
)

Overrides default com.mysql.cj.protocol.ResultsetRows.setCurrentRow.

Moves the current position in the result set to the given row number.

Inherited from com.mysql.cj.protocol.a.result.AbstractResultsetRows:
getMetadatagetOwnersetMetadatasetOwnerwasEmpty

Field Detail

commandBuilderback to summary
private NativeMessageBuilder commandBuilder
exceptionInterceptorback to summary
private ExceptionInterceptor exceptionInterceptor
isAfterEndback to summary
private boolean isAfterEnd
isBinaryEncodedback to summary
private boolean isBinaryEncoded
lockback to summary
private final Lock lock
nextRowback to summary
private Row nextRow
noMoreRowsback to summary
private boolean noMoreRows
protocolback to summary
private NativeProtocol protocol
resultSetFactoryback to summary
private ProtocolEntityFactory<T, NativePacketPayload> resultSetFactory
streamerClosedback to summary
private boolean streamerClosed

Constructor Detail

ResultsetRowsStreamingback to summary
public ResultsetRowsStreaming(NativeProtocol protocol, ColumnDefinition columnDefinition, boolean isBinaryEncoded, ProtocolEntityFactory<T, NativePacketPayload> resultSetFactory)

Creates a new ResultsetRowsStreaming object.

Parameters
protocol:NativeProtocol

the connection to MySQL that this data is coming from

columnDefinition:ColumnDefinition

the metadata that describe this data

isBinaryEncoded:boolean

is this data in native format?

resultSetFactory:ProtocolEntityFactory<T, NativePacketPayload>

ProtocolEntityFactory

Method Detail

afterLastback to summary
public void afterLast()

Overrides default com.mysql.cj.protocol.ResultsetRows.afterLast.

Doc from com.mysql.cj.protocol.ResultsetRows.afterLast.

Moves to after last.

Annotations
@Override
beforeFirstback to summary
public void beforeFirst()

Overrides default com.mysql.cj.protocol.ResultsetRows.beforeFirst.

Doc from com.mysql.cj.protocol.ResultsetRows.beforeFirst.

Moves to before first.

Annotations
@Override
beforeLastback to summary
public void beforeLast()

Overrides default com.mysql.cj.protocol.ResultsetRows.beforeLast.

Doc from com.mysql.cj.protocol.ResultsetRows.beforeLast.

Moves to before last.

Annotations
@Override
closeback to summary
public void close()

Overrides default com.mysql.cj.protocol.ResultsetRows.close.

Doc from com.mysql.cj.protocol.ResultsetRows.close.

We're done.

Annotations
@Override
getPositionback to summary
public int getPosition()

Overrides default com.mysql.cj.result.RowList.getPosition.

Doc from com.mysql.cj.result.RowList.getPosition.

Returns the current position.

Returns:int

the current row number

Annotations
@Override
hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Doc from java.util.Iterator.hasNext.

Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Returns:boolean

true if the iteration has more elements

Annotations
@Override
isAfterLastback to summary
public boolean isAfterLast()

Implements com.mysql.cj.protocol.ResultsetRows.isAfterLast.

Doc from com.mysql.cj.protocol.ResultsetRows.isAfterLast.

Returns true if we got the last element.

Returns:boolean

true if after last row

Annotations
@Override
isBeforeFirstback to summary
public boolean isBeforeFirst()

Implements com.mysql.cj.protocol.ResultsetRows.isBeforeFirst.

Doc from com.mysql.cj.protocol.ResultsetRows.isBeforeFirst.

Returns if iteration has not occured yet.

Returns:boolean

true if before first row

Annotations
@Override
isEmptyback to summary
public boolean isEmpty()

Overrides default com.mysql.cj.protocol.ResultsetRows.isEmpty.

Doc from com.mysql.cj.protocol.ResultsetRows.isEmpty.

Has no records.

Returns:boolean

true if no records

Annotations
@Override
isFirstback to summary
public boolean isFirst()

Overrides default com.mysql.cj.protocol.ResultsetRows.isFirst.

Doc from com.mysql.cj.protocol.ResultsetRows.isFirst.

Are we on the first row of the result set?

Returns:boolean

true if on first row

Annotations
@Override
isLastback to summary
public boolean isLast()

Overrides default com.mysql.cj.protocol.ResultsetRows.isLast.

Doc from com.mysql.cj.protocol.ResultsetRows.isLast.

Are we on the last row of the result set?

Returns:boolean

true if on last row

Annotations
@Override
moveRowRelativeback to summary
public void moveRowRelative(int rows)

Overrides default com.mysql.cj.protocol.ResultsetRows.moveRowRelative.

Doc from com.mysql.cj.protocol.ResultsetRows.moveRowRelative.

Moves the current position relative 'rows' from the current position.

Parameters
rows:int

the relative number of rows to move

Annotations
@Override
nextback to summary
public Row next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Returns:Row

the next element in the iteration

Annotations
@SuppressWarnings:unchecked
@Override
setCurrentRowback to summary
public void setCurrentRow(int rowNumber)

Overrides default com.mysql.cj.protocol.ResultsetRows.setCurrentRow.

Doc from com.mysql.cj.protocol.ResultsetRows.setCurrentRow.

Moves the current position in the result set to the given row number.

Parameters
rowNumber:int

row to move to

Annotations
@Override