You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Dmitriy Pavlov (JIRA)" <ji...@apache.org> on 2018/05/21 10:14:00 UTC
[jira] [Resolved] (IGNITE-8054) Let serialize only valuable part of
GridLongList
[ https://issues.apache.org/jira/browse/IGNITE-8054?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dmitriy Pavlov resolved IGNITE-8054.
------------------------------------
Resolution: Fixed
Hi [~sharpler], I've merged changes to master.
Let's keep an eye on TC results.
> Let serialize only valuable part of GridLongList
> ------------------------------------------------
>
> Key: IGNITE-8054
> URL: https://issues.apache.org/jira/browse/IGNITE-8054
> Project: Ignite
> Issue Type: Improvement
> Components: messaging
> Affects Versions: 2.4
> Reporter: Alexander Menshikov
> Assignee: Alexander Menshikov
> Priority: Major
> Labels: easyfix
> Fix For: 2.6
>
>
> Here in GridLongList we serialize all elements and don't take into account `idx` value:
> {code:java}
> @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
> writer.setBuffer(buf);
>
> if (!writer.isHeaderWritten()) {
> if (!writer.writeHeader(directType(), fieldsCount()))
> return false;
>
> writer.onHeaderWritten();
> }
>
> switch (writer.state()) {
> case 0:
> if (!writer.writeLongArray("arr", arr))
> return false;
>
> writer.incrementState();
>
> case 1:
> if (!writer.writeInt("idx", idx))
> return false;
>
> writer.incrementState();
>
> }
>
> return true;
> } {code}
> Which is not happening in another serialization method in the same class:
> {code:java}
> public static void writeTo(DataOutput out, @Nullable GridLongList list) throws IOException {
> out.writeInt(list != null ? list.idx : -1);
>
> if (list != null) {
> for (int i = 0; i < list.idx; i++)
> out.writeLong(list.arr[i]);
> }
> } {code}
> So, we can simply reduce messages size by sending only a valuable part of the array.
> I created this issue according to a discussion on the mailing list:
> [http://apache-ignite-developers.2346864.n4.nabble.com/Optimize-GridLongList-serialization-td28571.html]
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)