use of org.apache.ignite.internal.processors.platform.PlatformProcessor in project ignite by apache.
the class GridCacheMapEntry method updatePlatformCache.
/**
* Invokes platform cache update callback, if applicable.
*
* @param val Updated value, null on remove.
* @param ver Topology version, null on remove.
*/
protected void updatePlatformCache(@Nullable CacheObject val, @Nullable AffinityTopologyVersion ver) {
if (!hasPlatformCache())
return;
PlatformProcessor proc = this.cctx.kernalContext().platform();
if (!proc.hasContext() || !proc.context().isPlatformCacheSupported())
return;
try {
CacheObjectContext ctx = this.cctx.cacheObjectContext();
// val is null when entry is removed.
byte[] keyBytes = this.key.valueBytes(ctx);
byte[] valBytes = val == null ? null : val.valueBytes(ctx);
proc.context().updatePlatformCache(this.cctx.cacheId(), keyBytes, valBytes, partition(), ver);
} catch (Throwable e) {
U.error(log, "Failed to update Platform Cache: " + e);
}
}
use of org.apache.ignite.internal.processors.platform.PlatformProcessor in project ignite by apache.
the class PlatformAbstractJob method execute.
/**
* {@inheritDoc}
*/
@Nullable
@Override
public Object execute() {
try {
PlatformProcessor interopProc = PlatformUtils.platformProcessor(ignite);
interopProc.awaitStart();
return execute0(interopProc.context());
} catch (IgniteCheckedException e) {
throw U.convertException(e);
}
}
use of org.apache.ignite.internal.processors.platform.PlatformProcessor in project ignite by apache.
the class PlatformCacheEntryProcessorImpl method process.
/**
* {@inheritDoc}
*/
@Override
public Object process(MutableEntry entry, Object... args) throws EntryProcessorException {
try {
Ignite ignite = (Ignite) entry.unwrap(Ignite.class);
PlatformProcessor interopProc;
try {
interopProc = PlatformUtils.platformProcessor(ignite);
} catch (IllegalStateException ex) {
throw new EntryProcessorException(ex);
}
interopProc.awaitStart();
return execute0(interopProc.context(), entry);
} catch (IgniteCheckedException e) {
throw U.convertException(e);
}
}
use of org.apache.ignite.internal.processors.platform.PlatformProcessor in project ignite by apache.
the class CacheOsStoreManager method start0.
/**
* {@inheritDoc}
*/
@Override
protected void start0() throws IgniteCheckedException {
if (configured()) {
CacheStore store = configuredStore();
assert store != null;
assert !(store instanceof GridCacheWriteBehindStore);
if (store instanceof PlatformCacheStore) {
PlatformProcessor proc = ctx.platform();
proc.registerStore((PlatformCacheStore) store, configuredConvertBinary());
}
}
super.start0();
}
use of org.apache.ignite.internal.processors.platform.PlatformProcessor in project ignite by apache.
the class GridQueryProcessor method registerPlatformTypeLocally.
/**
* Registers platform type locally.
*
* @param clsName Class name.
* @param binProc Binary processor.
*/
private void registerPlatformTypeLocally(String clsName, CacheObjectBinaryProcessorImpl binProc) {
PlatformProcessor platformProc = ctx.platform();
if (platformProc == null || !platformProc.hasContext())
return;
PlatformContext platformCtx = platformProc.context();
BinaryMetadata meta = platformCtx.getBinaryType(clsName);
if (meta != null)
binProc.binaryContext().registerClassLocally(meta.wrap(binProc.binaryContext()), false, platformCtx.getMarshallerPlatformId());
}
Aggregations