Search in sources :

Example 21 with BinaryRawReaderEx

use of org.apache.ignite.internal.binary.BinaryRawReaderEx in project ignite by apache.

the class PlatformTestPluginTarget method invokeCallback.

/**
 * Invokes the platform callback.
 *
 * @param val Value to send.
 * @return Result.
 */
private String invokeCallback(String val) {
    PlatformMemory outMem = platformCtx.memory().allocate();
    PlatformMemory inMem = platformCtx.memory().allocate();
    PlatformOutputStream outStream = outMem.output();
    BinaryRawWriterEx writer = platformCtx.writer(outStream);
    writer.writeString(val);
    outStream.synchronize();
    platformCtx.gateway().pluginCallback(1, outMem, inMem);
    BinaryRawReaderEx reader = platformCtx.reader(inMem);
    return reader.readString();
}
Also used : PlatformOutputStream(org.apache.ignite.internal.processors.platform.memory.PlatformOutputStream) BinaryRawReaderEx(org.apache.ignite.internal.binary.BinaryRawReaderEx) BinaryRawWriterEx(org.apache.ignite.internal.binary.BinaryRawWriterEx) PlatformMemory(org.apache.ignite.internal.processors.platform.memory.PlatformMemory)

Aggregations

BinaryRawReaderEx (org.apache.ignite.internal.binary.BinaryRawReaderEx)21 PlatformMemory (org.apache.ignite.internal.processors.platform.memory.PlatformMemory)14 BinaryRawWriterEx (org.apache.ignite.internal.binary.BinaryRawWriterEx)13 PlatformOutputStream (org.apache.ignite.internal.processors.platform.memory.PlatformOutputStream)11 PlatformInputStream (org.apache.ignite.internal.processors.platform.memory.PlatformInputStream)8 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)4 IgniteException (org.apache.ignite.IgniteException)4 Nullable (org.jetbrains.annotations.Nullable)3 CacheLoaderException (javax.cache.integration.CacheLoaderException)2 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)2 NearCacheConfiguration (org.apache.ignite.configuration.NearCacheConfiguration)2 IgniteCacheProxy (org.apache.ignite.internal.processors.cache.IgniteCacheProxy)2 PlatformFutureUtils (org.apache.ignite.internal.processors.platform.utils.PlatformFutureUtils)2 IgniteFuture (org.apache.ignite.lang.IgniteFuture)2 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 HashMap (java.util.HashMap)1 ClusterNode (org.apache.ignite.cluster.ClusterNode)1 BinaryFieldMetadata (org.apache.ignite.internal.binary.BinaryFieldMetadata)1 BinaryMetadata (org.apache.ignite.internal.binary.BinaryMetadata)1