use of org.apache.ignite.internal.processors.platform.memory.PlatformInputStream in project ignite by apache.
the class PlatformFullJob method serialize.
/**
* Internal job serialization routine.
*
* @throws org.apache.ignite.IgniteCheckedException If failed.
*/
private void serialize() throws IgniteCheckedException {
try (PlatformMemory mem = ctx.memory().allocate()) {
PlatformInputStream in = mem.input();
boolean res = ctx.gateway().computeJobSerialize(ptr, mem.pointer()) == 1;
in.synchronize();
BinaryRawReaderEx reader = ctx.reader(in);
if (res)
job = reader.readObjectDetached();
else
throw new IgniteCheckedException(reader.readString());
}
}
use of org.apache.ignite.internal.processors.platform.memory.PlatformInputStream in project ignite by apache.
the class PlatformCacheEntryProcessorImpl method execute0.
/**
* Executes interop entry processor on a given entry, updates entry and returns result.
*
* @param ctx Context.
* @param entry Entry.
* @return Processing result.
*/
private Object execute0(PlatformContext ctx, MutableEntry entry) {
try (PlatformMemory mem = ctx.memory().allocate()) {
PlatformOutputStream out = mem.output();
BinaryRawWriterEx writer = ctx.writer(out);
writeEntryAndProcessor(entry, writer);
out.synchronize();
ctx.gateway().cacheInvoke(mem.pointer());
PlatformInputStream in = mem.input();
in.synchronize();
BinaryRawReaderEx reader = ctx.reader(in);
return readResultAndUpdateEntry(ctx, entry, reader);
}
}
use of org.apache.ignite.internal.processors.platform.memory.PlatformInputStream in project ignite by apache.
the class PlatformAbstractBootstrap method start.
/** {@inheritDoc} */
@Override
public PlatformProcessor start(IgniteConfiguration cfg, @Nullable GridSpringResourceContext springCtx, long envPtr, long dataPtr) {
final PlatformInputStream input = new PlatformExternalMemory(null, dataPtr).input();
Ignition.setClientMode(input.readBoolean());
processInput(input, cfg);
IgniteConfiguration cfg0 = closure(envPtr).apply(cfg);
try {
IgniteEx node = (IgniteEx) IgnitionEx.start(cfg0, springCtx);
return node.context().platform();
} catch (IgniteCheckedException e) {
throw U.convertException(e);
}
}
Aggregations