Search in sources :

Example 1 with PlatformTargetProxy

use of org.apache.ignite.internal.processors.platform.PlatformTargetProxy in project ignite by apache.

the class PlatformStreamReceiverImpl method receive.

/**
 * {@inheritDoc}
 */
@Override
public void receive(IgniteCache<Object, Object> cache, Collection<Map.Entry<Object, Object>> collection) throws IgniteException {
    assert ctx != null;
    try (PlatformMemory mem = ctx.memory().allocate()) {
        PlatformOutputStream out = mem.output();
        out.writeLong(ptr);
        out.writeBoolean(keepBinary);
        BinaryRawWriterEx writer = ctx.writer(out);
        writer.writeObject(pred);
        writer.writeInt(collection.size());
        for (Map.Entry<Object, Object> e : collection) {
            writer.writeObject(e.getKey());
            writer.writeObject(e.getValue());
        }
        out.synchronize();
        PlatformCache cache0 = new PlatformCache(ctx, cache, keepBinary);
        PlatformTargetProxy cacheProxy = new PlatformTargetProxyImpl(cache0, ctx);
        ctx.gateway().dataStreamerStreamReceiverInvoke(ptr, cacheProxy, mem.pointer(), keepBinary);
    }
}
Also used : PlatformCache(org.apache.ignite.internal.processors.platform.cache.PlatformCache) PlatformTargetProxy(org.apache.ignite.internal.processors.platform.PlatformTargetProxy) PlatformTargetProxyImpl(org.apache.ignite.internal.processors.platform.PlatformTargetProxyImpl) PlatformOutputStream(org.apache.ignite.internal.processors.platform.memory.PlatformOutputStream) BinaryRawWriterEx(org.apache.ignite.internal.binary.BinaryRawWriterEx) Map(java.util.Map) PlatformMemory(org.apache.ignite.internal.processors.platform.memory.PlatformMemory)

Aggregations

Map (java.util.Map)1 BinaryRawWriterEx (org.apache.ignite.internal.binary.BinaryRawWriterEx)1 PlatformTargetProxy (org.apache.ignite.internal.processors.platform.PlatformTargetProxy)1 PlatformTargetProxyImpl (org.apache.ignite.internal.processors.platform.PlatformTargetProxyImpl)1 PlatformCache (org.apache.ignite.internal.processors.platform.cache.PlatformCache)1 PlatformMemory (org.apache.ignite.internal.processors.platform.memory.PlatformMemory)1 PlatformOutputStream (org.apache.ignite.internal.processors.platform.memory.PlatformOutputStream)1