ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vladislav Pyatkov <vpyat...@gridgain.com>
Subject By bytes access to binary format
Date Wed, 28 Jun 2017 09:52:55 GMT

Recently, from one of Ignite user, I listened interest idea.
What if I want to pass some date to java stream from cache.

With binary I do it like this:

BinaryObject get = (BinaryObject) cache.get(key);
byte[] dataFromCache = get.<byte[]>field("data");
System.out.write(dataFromCache, 0, dataFromCache.length);

But in this case we got garbage a lot, due to each time new bytes array is

This will lead to many GC events in case we load a some of million entries.
Could we offer additional API for working with java stream:

BinaryObject.writeBytesToBuf("data", ByteBuffer.allocate(1024));

or with buffer

BinaryObject.writeBytesToBuf("data", new byte[1000], 100);

I already created a Jira ticket.

Vladislav Pyatkov
Architect-Consultant "GridGain Rus" Llc.
+7 963 716 68 99

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message