Anticipated flow of a COPY TO STDOUT operation:
CopyManager.copyOut() ->QueryExecutor.startCopy() - sends given query to server ->processCopyResults(): - receives CopyOutResponse from Server - creates new CopyOutImpl ->initCopy(): - receives copy metadata from server ->CopyOutImpl.init() ->lock() connection for this operation - if query fails an exception is thrown - if query returns wrong CopyOperation, copyOut() cancels it before throwing exception <-returned: new CopyOutImpl holding lock on connection repeat CopyOut.readFromCopy() until null ->CopyOutImpl.readFromCopy() ->QueryExecutorImpl.readFromCopy() ->processCopyResults() - on copydata row from server ->CopyOutImpl.handleCopydata() stores reference to byte array - on CopyDone, CommandComplete, ReadyForQuery ->unlock() connection for use by other operations <-returned: byte array of data received from server or null at end.
| Modifier and Type | Field and Description |
|---|---|
| private @Nullable byte[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | handleCopydata(byte[]
data that was receive by copy protocol data)Implements abstract org. Consume received copy data. |
| public @Nullable byte[] | readFromCopy()
Implements org. Blocks wait for a row of data to be received from server on an active copy operation. |
| public @Nullable byte[] | readFromCopy(boolean
true if need wait data from server otherwise false and will read
pending message from serverImplements org. Wait for a row of data to be received from server on an active copy operation. |
| currentDataRow | back to summary |
|---|---|
| private @Nullable byte[] currentDataRow | |
| CopyOutImpl | back to summary |
|---|---|
| public CopyOutImpl() | |
| handleCopydata | back to summary |
|---|---|
| protected void handleCopydata(byte[] data) Implements abstract org. Doc from org. Consume received copy data.
| |
| readFromCopy | back to summary |
|---|---|
| public @Nullable byte[] readFromCopy() throws SQLException Implements org. Doc from org. Blocks wait for a row of data to be received from server on an active copy operation.
| |
| readFromCopy | back to summary |
|---|---|
| public @Nullable byte[] readFromCopy(boolean block) throws SQLException Implements org. Doc from org. Wait for a row of data to be received from server on an active copy operation.
| |