qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob Godfrey (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (QPID-8245) [Broker-J] [AMQP 0-8..0-91] Decode FieldTable fields on demand
Date Mon, 01 Oct 2018 09:19:00 GMT

    [ https://issues.apache.org/jira/browse/QPID-8245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16633750#comment-16633750
] 

Rob Godfrey edited comment on QPID-8245 at 10/1/18 9:18 AM:
------------------------------------------------------------

[~alex.rufous] Yes - that was my intent, I just also imagined changing the name to imply that
the map was no longer a reference of all the properties, but just a cache of some of them

One comment on your patch, in FieldTable.java:

{code:java}
        QpidByteBuffer dup = _encodedForm.duplicate();
        while(dup.hasRemaining())
        {
            final byte[] bytes = AMQShortString.readAMQShortStringAsBytes(dup);
            if(Arrays.equals(keyBytes, bytes))
            {
                return AMQTypedValue.readFromBuffer(dup);
            }
            else
            {
                AMQType type = AMQTypeMap.getType(dup.get());
                type.skip(dup);
            }
        }
{code}

Shouldn't his be

{code:java}

    try(QpidByteBuffer dup = _encodedForm.duplicate())
    {
        while(dup.hasRemaining())
        {
            final byte[] bytes = AMQShortString.readAMQShortStringAsBytes(dup);
            if(Arrays.equals(keyBytes, bytes))
            {
                return AMQTypedValue.readFromBuffer(dup);
            }
            else
            {
                AMQType type = AMQTypeMap.getType(dup.get());
                type.skip(dup);
            }
        }
    }
{code}

To stop the duplicate leaking?





was (Author: rgodfrey):
[~alex.rufous] Yes - that was my intent, I just also imagined changing the name to imply that
the map was no longer a reference of all the properties, but just a cache of some of them

> [Broker-J] [AMQP 0-8..0-91] Decode FieldTable fields on demand
> --------------------------------------------------------------
>
>                 Key: QPID-8245
>                 URL: https://issues.apache.org/jira/browse/QPID-8245
>             Project: Qpid
>          Issue Type: Improvement
>          Components: Broker-J
>    Affects Versions: qpid-java-broker-7.1.0
>            Reporter: Alex Rudyy
>            Priority: Major
>             Fix For: qpid-java-broker-7.1.0
>
>         Attachments: 0001-QPID-8245-Broker-J-Stop-rellocating-message-headers-.patch,
0002-QPID-8245-Add-factory-methods-to-create-field-table-.patch, 0003-QPID-8245-Remove-FiledTable-setters-methods-modifyin.patch,
0004-QPID-8245-Decode-field-table-properties-when-require.patch, 0005-QPID-8245-Remove-methods-getXXX-in-order-to-simplify.patch,
0005-QPID-8245-Split-field-table-into-2-implementations.patch, 0006-QPID-8245-some-code-clean-up.patch,
0007-QPID-8245-Change-decoding-to-decode-only-value-for-t.patch
>
>
> At the moment all field table properties are decoded when decode functionality is invoked.
For use cases when only some of the field table properties are queried, the decoding functionality
can be changed to stop decoding on getting the requested property. Potentially, such approach
can improve the performance of routing transient messages when destinations are bound to the
routing exchange using selector filters. As filter expression contains only some properties,
the decoding of message headers can be stopped on getting all fields specified in selector
expression.
> The idea is illustrated by Rob Godfrey on [QPID-8238|https://issues.apache.org/jira/browse/QPID-8238?focusedCommentId=16601936&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16601936]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


Mime
View raw message