anton-vinogradov commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3664530048
##########
modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java:
##########
@@ -460,6 +461,9 @@ public void resetMetrics() {
msg.getClass().getName() + ". Most likely
GridCommunicationSpi is being used directly, " +
"which is illegal - make sure to send messages
only via GridProjection API.");
}
+ catch (IgniteCheckedException e) {
Review Comment:
Good catch — it was redundant and is gone now, together with the `throws
IgniteCheckedException` on `onMessage0` that made me add it. The body of
`onMessage0` is entirely wrapped in a try whose `catch
(IgniteCheckedException)` logs and continues (that is how master handles the
reserved-policy throw), and the `unmarshalNio` call this PR adds sits inside
that try — so nothing ever escaped. The listener is byte-identical to master
again.
##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java:
##########
@@ -61,7 +62,10 @@ public QueryBatchMessage(UUID qryId, long fragmentId, long
exchangeId, int batch
this.batchId = batchId;
this.last = last;
- mRows = rows.stream().map(o -> o == null ? null : new
GenericValueMessage(o)).collect(Collectors.toList());
+ mRows = new ArrayList<>(rows.size());
Review Comment:
It is the same conversion as on master, just without the stream pipeline:
master does `mRows = rows.stream().map(o -> o == null ? null : new
GenericValueMessage(o)).collect(toList())`, this is the equivalent loop into a
pre-sized ArrayList — no lambda/collector allocations per batch, same result.
(The lazy variant I had here earlier is reverted, as agreed in the F.view
thread.)
##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java:
##########
@@ -99,6 +103,11 @@ public boolean last() {
* @return Rows.
*/
public List<Object> rows() {
- return
mRows.stream().map(GenericValueMessage::value).collect(Collectors.toList());
+ List<Object> rows = new ArrayList<>(mRows.size());
Review Comment:
Same on the read side: master's `rows()` is
`mRows.stream().map(GenericValueMessage::value).collect(toList())`, this is the
same thing as a loop into a pre-sized list.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]