Interface PlatformContext

  • All Known Implementing Classes:
    PlatformContextImpl

    public interface PlatformContext
    Platform context. Acts as an entry point for platform operations.
    • Method Detail

      • kernalContext

        GridKernalContext kernalContext()
        Gets kernal context.
        Returns:
        Kernal context.
      • addNode

        void addNode​(ClusterNode node)
        Sends node info to native platform, if necessary.
        Parameters:
        node - Node.
      • writeNode

        void writeNode​(BinaryRawWriterEx writer,
                       ClusterNode node)
        Writes a node id to a stream and sends node info to native platform, if necessary.
        Parameters:
        writer - Writer.
        node - Node.
      • writeNodes

        void writeNodes​(BinaryRawWriterEx writer,
                        Collection<ClusterNode> nodes)
        Writes multiple node ids to a stream and sends node info to native platform, if necessary.
        Parameters:
        writer - Writer.
        nodes - Nodes.
      • processMetadata

        void processMetadata​(BinaryRawReaderEx reader)
        Process metadata from the platform.
        Parameters:
        reader - Reader.
      • writeMetadata

        void writeMetadata​(BinaryRawWriterEx writer,
                           int typeId,
                           boolean includeSchemas)
        Write metadata for the given type ID.
        Parameters:
        writer - Writer.
        typeId - Type ID.
        includeSchemas - Whether to include binary object schemas into the result.
      • writeAllMetadata

        void writeAllMetadata​(BinaryRawWriterEx writer)
        Write all available metadata.
        Parameters:
        writer - Writer.
      • writeSchema

        void writeSchema​(BinaryRawWriterEx writer,
                         int typeId,
                         int schemaId)
        Write schema for the given type ID and schema ID.
        Parameters:
        writer - Writer.
        typeId - Type ID.
        schemaId - Schema ID.
      • writeClusterMetrics

        void writeClusterMetrics​(BinaryRawWriterEx writer,
                                 @Nullable
                                 @Nullable ClusterMetrics metrics)
        Write cluster metrics.
        Parameters:
        writer - Writer.
        metrics - Metrics.
      • createContinuousQuery

        PlatformContinuousQuery createContinuousQuery​(long ptr,
                                                      boolean hasFilter,
                                                      @Nullable
                                                      @Nullable Object filter)
        Parameters:
        ptr - Pointer to continuous query deployed on the platform.
        hasFilter - Whether filter exists.
        filter - Filter.
        Returns:
        Platform continuous query.
      • createContinuousQueryFilter

        PlatformContinuousQueryFilter createContinuousQueryFilter​(Object filter)
        Create continuous query filter to be deployed on remote node.
        Parameters:
        filter - Native filter.
        Returns:
        Filter.
      • createRemoteMessageFilter

        PlatformMessageFilter createRemoteMessageFilter​(Object filter,
                                                        long ptr)
        Create remote message filter.
        Parameters:
        filter - Native filter.
        ptr - Pointer of deployed native filter.
        Returns:
        Filter.
      • isEventTypeSupported

        boolean isEventTypeSupported​(int evtTyp)
        Check whether the given event type is supported.
        Parameters:
        evtTyp - Event type.
        Returns:
        True if supported.
      • writeEvent

        void writeEvent​(BinaryRawWriterEx writer,
                        Event evt)
        Write event.
        Parameters:
        writer - Writer.
        evt - Event.
      • createLocalEventFilter

        PlatformEventFilterListener createLocalEventFilter​(long hnd)
        Create local event filter.
        Parameters:
        hnd - Native handle.
        Returns:
        Filter.
      • createRemoteEventFilter

        PlatformEventFilterListener createRemoteEventFilter​(Object pred,
                                                            int... types)
        Create remote event filter.
        Parameters:
        pred - Native predicate.
        types - Event types.
        Returns:
        Filter.
      • createNativeException

        PlatformNativeException createNativeException​(Object cause)
        Create native exception.
        Parameters:
        cause - Native cause.
        Returns:
        Exception.
      • createJob

        PlatformJob createJob​(Object task,
                              long ptr,
                              @Nullable
                              @Nullable Object job,
                              String jobName)
        Create job.
        Parameters:
        task - Task.
        ptr - Pointer.
        job - Native job.
        jobName - Native job name.
        Returns:
        job.
      • createClosureJob

        PlatformJob createClosureJob​(Object task,
                                     long ptr,
                                     Object job,
                                     String jobName)
        Create closure job.
        Parameters:
        task - Native task.
        ptr - Pointer.
        job - Native job.
        jobName - Closure name.
        Returns:
        Closure job.
      • createCacheEntryProcessor

        PlatformCacheEntryProcessor createCacheEntryProcessor​(Object proc,
                                                              long ptr)
        Create cache entry processor.
        Parameters:
        proc - Native processor.
        ptr - Pointer.
        Returns:
        Entry processor.
      • createCacheEntryFilter

        PlatformCacheEntryFilter createCacheEntryFilter​(Object filter,
                                                        long ptr)
        Create cache entry filter.
        Parameters:
        filter - Native filter.
        ptr - Pointer.
        Returns:
        Entry filter.
      • createStreamReceiver

        PlatformStreamReceiver createStreamReceiver​(Object rcv,
                                                    long ptr,
                                                    boolean keepBinary)
        Create stream receiver.
        Parameters:
        rcv - Native receiver.
        ptr - Pointer.
        keepBinary - Keep binary flag.
        Returns:
        Stream receiver.
      • createClusterNodeFilter

        PlatformClusterNodeFilter createClusterNodeFilter​(Object filter)
        Create cluster node filter.
        Parameters:
        filter - Native filter.
        Returns:
        Cluster node filter.
      • platform

        String platform()
        Gets the current platform name.
        Returns:
        Current platform name.
      • isPlatformCacheSupported

        boolean isPlatformCacheSupported()
        Gets a value indicating whether current platform supports native cache.
        Returns:
        True when native caching is supported; false otherwise.
      • updatePlatformCache

        void updatePlatformCache​(int cacheId,
                                 byte[] keyBytes,
                                 byte[] valBytes,
                                 int part,
                                 AffinityTopologyVersion ver)
        Updates the platform cache cache.
        Parameters:
        cacheId - Cache id.
        keyBytes - Serialized key to update.
        valBytes - Serialized value.
        part - Key partition.
        ver - Key version.
      • enableThreadLocalForPlatformCacheUpdate

        void enableThreadLocalForPlatformCacheUpdate()
        Enables thread-local optimization for platform cache update.
      • disableThreadLocalForPlatformCacheUpdate

        void disableThreadLocalForPlatformCacheUpdate()
        Disables thread-local optimization for platform cache update.
      • getBinaryType

        @Nullable
        @Nullable BinaryMetadata getBinaryType​(String typeName)
        Gets platform binary type metadata.
        Parameters:
        typeName - Type name.
        Returns:
        Metadata when type exists; null otherwise.
      • getMarshallerPlatformId

        byte getMarshallerPlatformId()
        Gets marshaller platform id (see MarshallerPlatformIds).
        Returns:
        Marshaller platform id.