public class PlatformUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ATTR_PLATFORM
Node attribute: platform.
|
static int |
OP_PREPARE_DOT_NET
Operation: prepare .Net platform.
|
static String |
PLATFORM_CPP
Platform: CPP.
|
static String |
PLATFORM_DOTNET
Platform: .Net.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
applyContinuousQueryEvents(PlatformContext ctx,
long lsnrPtr,
Iterable<javax.cache.event.CacheEntryEvent> evts)
Apply continuous query events to listener.
|
static <T> T |
createJavaObject(String clsName)
Create Java object.
|
static CachePeekMode[] |
decodeCachePeekModes(int modes)
Convert native cache peek modes to Java cache peek modes.
|
static byte[] |
errorData(Throwable err)
Get error data.
|
static boolean |
evaluateContinuousQueryEvent(PlatformContext ctx,
long filterPtr,
javax.cache.event.CacheEntryEvent evt)
Evaluate the filter.
|
static String |
getFullStackTrace(Throwable throwable)
Gets the entire nested stack-trace of an throwable.
|
static int[] |
getSchema(CacheObjectBinaryProcessorImpl cacheObjProc,
int typeId,
int schemaId)
Gets the schema.
|
static void |
initializeJavaObject(Object obj,
String clsName,
@Nullable Map<String,Object> props,
@Nullable GridKernalContext ctx)
Initialize Java object or object factory.
|
static GridBinaryMarshaller |
marshaller()
Create binary marshaller.
|
static PlatformContext |
platformContext(Ignite grid)
Gets interop context for the grid.
|
static PlatformProcessor |
platformProcessor(Ignite grid)
Get GridGain platform processor.
|
static BinaryMetadata |
readBinaryMetadata(BinaryRawReaderEx reader)
Reads the binary metadata.
|
static Collection<BinaryMetadata> |
readBinaryMetadataCollection(BinaryRawReaderEx reader)
Reads the binary metadata.
|
static <T> List<T> |
readCollection(BinaryRawReaderEx reader)
Read collection.
|
static <T> List<T> |
readCollection(BinaryRawReaderEx reader,
@Nullable PlatformReaderClosure<T> readClo)
Read collection.
|
static Object |
readInvocationResult(PlatformContext ctx,
BinaryRawReaderEx reader)
Reads invocation result (of a job/service/etc) using a common protocol.
|
static <K,V> Map<K,V> |
readLinkedMap(BinaryRawReaderEx reader,
@Nullable PlatformReaderBiClosure<K,V> readClo)
Read linked map.
|
static <K,V> Map<K,V> |
readMap(BinaryRawReaderEx reader)
Read map.
|
static <K,V> Map<K,V> |
readMap(BinaryRawReaderEx reader,
@Nullable PlatformReaderBiClosure<K,V> readClo)
Read map.
|
static Map<String,Object> |
readNodeAttributes(BinaryRawReaderEx reader)
Reads node attributes.
|
static <T> List<T> |
readNullableCollection(BinaryRawReaderEx reader)
Read nullable collection.
|
static <T> List<T> |
readNullableCollection(BinaryRawReaderEx reader,
@Nullable PlatformReaderClosure<T> readClo)
Read nullable collection.
|
static <K,V> Map<K,V> |
readNullableMap(BinaryRawReaderEx reader)
Read nullable map.
|
static <T> Set<T> |
readNullableSet(BinaryRawReaderEx reader) |
static <T> Set<T> |
readSet(BinaryRawReaderEx reader) |
static void |
reallocate(long memPtr,
int cap)
Reallocate arbitrary memory chunk.
|
static Object[] |
unwrapBinariesInArray(Object[] arr)
Unwrap array of binaries if needed.
|
static IgniteCheckedException |
unwrapQueryException(Throwable err)
Unwrap query exception.
|
static void |
writeBinaryMetadata(BinaryRawWriter writer,
BinaryMetadata meta,
boolean includeSchemas)
Writes the binary metadata to a writer.
|
static <T> void |
writeCollection(BinaryRawWriterEx writer,
Collection<T> col)
Write collection to the writer.
|
static <T> void |
writeCollection(BinaryRawWriterEx writer,
Collection<T> col,
@Nullable PlatformWriterClosure<T> writeClo)
Write collection to the writer.
|
static <T> void |
writeCollection(BinaryRawWriterEx writer,
Collection<T> col,
@Nullable PlatformWriterClosure<T> writeClo,
@Nullable IgnitePredicate<T> filter)
Write collection to the writer.
|
static void |
writeError(Throwable ex,
BinaryRawWriterEx writer)
Writes error.
|
static void |
writeErrorData(Throwable err,
BinaryRawWriterEx writer)
Writer error data.
|
static void |
writeErrorData(Throwable err,
BinaryRawWriterEx writer,
@Nullable IgniteLogger log)
Write error data.
|
static void |
writeIgniteUuid(BinaryRawWriterEx writer,
IgniteUuid val)
Writes IgniteUuid to a writer.
|
static void |
writeInvocationResult(BinaryRawWriterEx writer,
Object resObj,
Throwable err)
Writes invocation result (of a job/service/etc) using a common protocol.
|
static <K,V> void |
writeMap(BinaryRawWriterEx writer,
Map<K,V> map)
Write nullable map to the writer.
|
static <K,V> void |
writeMap(BinaryRawWriterEx writer,
Map<K,V> map,
@Nullable PlatformWriterBiClosure<K,V> writeClo)
Write nullable map to the writer.
|
static void |
writeNodeAttributes(BinaryRawWriterEx writer,
Map<String,Object> attrs)
Writes node attributes.
|
static void |
writeNodeVersion(BinaryRawWriterEx out,
IgniteProductVersion productVersion)
Write binary productVersion.
|
static <T> void |
writeNullableCollection(BinaryRawWriterEx writer,
@Nullable Collection<T> col)
Write nullable collection to the writer.
|
static <T> void |
writeNullableCollection(BinaryRawWriterEx writer,
@Nullable Collection<T> col,
@Nullable PlatformWriterClosure<T> writeClo)
Write nullable collection to the writer.
|
static <T> void |
writeNullableCollection(BinaryRawWriterEx writer,
@Nullable Collection<T> col,
@Nullable PlatformWriterClosure<T> writeClo,
@Nullable IgnitePredicate<T> filter)
Write collection to the writer.
|
static <K,V> void |
writeNullableMap(BinaryRawWriterEx writer,
@Nullable Map<K,V> map)
Write nullable map to the writer.
|
public static final String ATTR_PLATFORM
public static final String PLATFORM_CPP
public static final String PLATFORM_DOTNET
public static final int OP_PREPARE_DOT_NET
public static <T> void writeNullableCollection(BinaryRawWriterEx writer, @Nullable @Nullable Collection<T> col)
writer - Writer.col - Collection to write.public static <T> void writeNullableCollection(BinaryRawWriterEx writer, @Nullable @Nullable Collection<T> col, @Nullable @Nullable PlatformWriterClosure<T> writeClo)
writer - Writer.col - Collection to write.writeClo - Writer closure.public static <T> void writeNullableCollection(BinaryRawWriterEx writer, @Nullable @Nullable Collection<T> col, @Nullable @Nullable PlatformWriterClosure<T> writeClo, @Nullable @Nullable IgnitePredicate<T> filter)
writer - Writer.col - Collection to write.writeClo - Optional writer closure.filter - Optional filter.public static <T> void writeCollection(BinaryRawWriterEx writer, Collection<T> col)
writer - Writer.col - Collection to write.public static <T> void writeCollection(BinaryRawWriterEx writer, Collection<T> col, @Nullable @Nullable PlatformWriterClosure<T> writeClo)
writer - Writer.col - Collection to write.writeClo - Writer closure.public static <T> void writeCollection(BinaryRawWriterEx writer, Collection<T> col, @Nullable @Nullable PlatformWriterClosure<T> writeClo, @Nullable @Nullable IgnitePredicate<T> filter)
writer - Writer.col - Collection to write.writeClo - Optional writer closure.filter - Optional filter.public static <K,V> void writeNullableMap(BinaryRawWriterEx writer, @Nullable @Nullable Map<K,V> map)
writer - Writer.map - Map to write.public static <K,V> void writeMap(BinaryRawWriterEx writer, Map<K,V> map)
writer - Writer.map - Map to write.public static <K,V> void writeMap(BinaryRawWriterEx writer, Map<K,V> map, @Nullable @Nullable PlatformWriterBiClosure<K,V> writeClo)
writer - Writer.map - Map to write.writeClo - Writer closure.public static <T> List<T> readCollection(BinaryRawReaderEx reader)
reader - Reader.public static <T> List<T> readCollection(BinaryRawReaderEx reader, @Nullable @Nullable PlatformReaderClosure<T> readClo)
reader - Reader.readClo - Optional reader closure.public static <T> List<T> readNullableCollection(BinaryRawReaderEx reader)
reader - Reader.public static <T> List<T> readNullableCollection(BinaryRawReaderEx reader, @Nullable @Nullable PlatformReaderClosure<T> readClo)
reader - Reader.public static <T> Set<T> readSet(BinaryRawReaderEx reader)
reader - Reader.public static <T> Set<T> readNullableSet(BinaryRawReaderEx reader)
reader - Reader.public static <K,V> Map<K,V> readMap(BinaryRawReaderEx reader)
reader - Reader.public static <K,V> Map<K,V> readMap(BinaryRawReaderEx reader, @Nullable @Nullable PlatformReaderBiClosure<K,V> readClo)
reader - Reader.readClo - Reader closure.public static <K,V> Map<K,V> readLinkedMap(BinaryRawReaderEx reader, @Nullable @Nullable PlatformReaderBiClosure<K,V> readClo)
reader - Reader.readClo - Reader closure.public static <K,V> Map<K,V> readNullableMap(BinaryRawReaderEx reader)
reader - Reader.public static void writeIgniteUuid(BinaryRawWriterEx writer, IgniteUuid val)
writer - Writer.val - Values.public static CachePeekMode[] decodeCachePeekModes(int modes)
modes - Encoded peek modes.public static IgniteCheckedException unwrapQueryException(Throwable err)
err - Initial error.public static void applyContinuousQueryEvents(PlatformContext ctx, long lsnrPtr, Iterable<javax.cache.event.CacheEntryEvent> evts) throws javax.cache.event.CacheEntryListenerException
ctx - Context.lsnrPtr - Listener pointer.evts - Events.javax.cache.event.CacheEntryListenerException - In case of failure.public static boolean evaluateContinuousQueryEvent(PlatformContext ctx, long filterPtr, javax.cache.event.CacheEntryEvent evt) throws javax.cache.event.CacheEntryListenerException
ctx - Context.filterPtr - Native filter pointer.evt - Event.javax.cache.event.CacheEntryListenerException - In case of failure.public static void writeError(Throwable ex, BinaryRawWriterEx writer)
ex - Error.writer - Writer.public static void writeErrorData(Throwable err, BinaryRawWriterEx writer)
err - Error.writer - Writer.public static void writeErrorData(Throwable err, BinaryRawWriterEx writer, @Nullable @Nullable IgniteLogger log)
err - Error.writer - Writer.log - Optional logger.public static PlatformProcessor platformProcessor(Ignite grid)
grid - Ignite instance.public static PlatformContext platformContext(Ignite grid)
grid - Gridpublic static void reallocate(long memPtr,
int cap)
memPtr - Memory pointer.cap - Capacity.public static byte[] errorData(Throwable err)
err - Error.public static void writeInvocationResult(BinaryRawWriterEx writer, Object resObj, Throwable err)
writer - Writer.resObj - Result.err - Error.public static Object readInvocationResult(PlatformContext ctx, BinaryRawReaderEx reader) throws IgniteCheckedException
ctx - Platform context.reader - Reader.IgniteCheckedException - When invocation result is an error.public static GridBinaryMarshaller marshaller()
public static Object[] unwrapBinariesInArray(Object[] arr)
arr - Array.public static <T> T createJavaObject(String clsName)
clsName - Class name.public static void initializeJavaObject(Object obj, String clsName, @Nullable @Nullable Map<String,Object> props, @Nullable @Nullable GridKernalContext ctx)
obj - Object.clsName - Class name.props - Properties (optional).ctx - Kernal context (optional).public static String getFullStackTrace(Throwable throwable)
throwable - The Throwable to be examined.public static int[] getSchema(CacheObjectBinaryProcessorImpl cacheObjProc, int typeId, int schemaId)
cacheObjProc - Cache object processor.typeId - Type id.schemaId - Schema id.public static void writeBinaryMetadata(BinaryRawWriter writer, BinaryMetadata meta, boolean includeSchemas)
writer - Writer.meta - Meta.public static Collection<BinaryMetadata> readBinaryMetadataCollection(BinaryRawReaderEx reader)
reader - Reader.public static BinaryMetadata readBinaryMetadata(BinaryRawReaderEx reader)
reader - Reader.public static void writeNodeAttributes(BinaryRawWriterEx writer, Map<String,Object> attrs)
writer - Writer.attrs - Attributes.public static Map<String,Object> readNodeAttributes(BinaryRawReaderEx reader)
reader - Reader.public static void writeNodeVersion(BinaryRawWriterEx out, IgniteProductVersion productVersion)
out - Writer.productVersion - IgniteProductVersion.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.8.1 Release Date : May 21 2020