Class IndexProcessor

    • Field Detail

      • idxRebuildCls

        public static Class<? extends IndexesRebuildTask> idxRebuildCls
        For tests to emulate long rebuild process.
      • serializer

        public static JavaObjectKeySerializer serializer
        Serializer for representing JO as byte array in inline.
    • Method Detail

      • registerIO

        public static void registerIO()
        Register inline IOs for sorted indexes.
      • store

        public void store​(GridCacheContext<?,​?> cctx,
                          CacheDataRow newRow,
                          @Nullable
                          @Nullable CacheDataRow prevRow,
                          boolean prevRowAvailable)
                   throws IgniteSpiException
        Updates index with new row. Note that key is unique for cache, so if cache contains multiple indexes the key should be removed from indexes other than one being updated.
        Parameters:
        cctx - Cache context.
        newRow - cache row to store in index.
        prevRow - optional cache row that will be replaced with new row.
        Throws:
        IgniteSpiException
      • store

        public void store​(Collection<? extends Index> idxs,
                          CacheDataRow newRow,
                          @Nullable
                          @Nullable CacheDataRow prevRow,
                          boolean prevRowAvailable)
                   throws IgniteSpiException
        Updates index with new row. Note that key is unique for cache, so if cache contains multiple indexes the key should be removed from indexes other than one being updated.
        Parameters:
        idxs - List of indexes to update.
        newRow - cache row to store in index.
        prevRow - optional cache row that will be replaced with new row.
        Throws:
        IgniteSpiException
      • createIndexDynamically

        public Index createIndexDynamically​(GridCacheContext cctx,
                                            IndexFactory factory,
                                            IndexDefinition definition,
                                            SchemaIndexCacheVisitor cacheVisitor)
        Creates a new index.
        Parameters:
        cctx - Cache context.
        factory - Index factory.
        definition - Description of an index to create.
        cacheVisitor - Enable to cancel dynamic index populating.
      • createIndex

        public Index createIndex​(GridCacheContext<?,​?> cctx,
                                 IndexFactory factory,
                                 IndexDefinition definition)
        Creates a new index.
        Parameters:
        cctx - Cache context.
        factory - Index factory.
        definition - Description of an index to create.
      • removeIndex

        public void removeIndex​(IndexName idxName,
                                boolean softDelete)
        Removes an index.
        Parameters:
        idxName - Index name.
        softDelete - whether it's required to delete underlying structures.
      • rowCacheCleaner

        public IndexRowCache rowCacheCleaner​(int grpId)
        Index row cache.
        Parameters:
        grpId - Cache group id.
        Returns:
        Index row cache.
      • idxRowCacheRegistry

        public IndexRowCacheRegistry idxRowCacheRegistry()
        Index row cache registry.
        Returns:
        Index row cache registry.
      • markRebuildIndexesForCache

        public void markRebuildIndexesForCache​(GridCacheContext<?,​?> cctx,
                                               boolean val)
        Mark/unmark for rebuild indexes for a specific cache.
      • rebuildIndexesForCache

        @Nullable
        public @Nullable IgniteInternalFuture<?> rebuildIndexesForCache​(GridCacheContext<?,​?> cctx,
                                                                        boolean force,
                                                                        IndexRebuildCancelToken cancelTok)
        Start rebuild of indexes for specified cache.
        Parameters:
        cctx - Cache context.
        force - Force rebuild indexes.
        Returns:
        A future of rebuilding cache indexes.
      • indexes

        public Collection<Index> indexes​(String cacheName)
        Returns collection of indexes for specified cache.
        Parameters:
        cacheName - Cache name.
        Returns:
        Collection of indexes for specified cache.
      • index

        @Nullable
        public @Nullable Index index​(IndexName idxName)
        Returns index for specified name.
        Parameters:
        idxName - Index name.
        Returns:
        Index for specified index name or null if not found.
      • indexDefinition

        public IndexDefinition indexDefinition​(UUID idxId)
        Returns IndexDefinition used for creating index specified id.
        Parameters:
        idxId - UUID of index.
        Returns:
        IndexDefinition used for creating index with id idxId.
      • unregisterCache

        public void unregisterCache​(GridCacheContextInfo cacheInfo)
        Unregisters cache.
        Parameters:
        cacheInfo - Cache context info.
      • destroyOrphanIndex

        public void destroyOrphanIndex​(GridKernalContext ctx,
                                       RootPage page,
                                       String indexName,
                                       int grpId,
                                       PageMemory pageMemory,
                                       GridAtomicLong removeId,
                                       ReuseList reuseList)
                                throws IgniteCheckedException
        Destroy founded index which belongs to stopped cache.
        Parameters:
        page - Root page.
        indexName - Index name.
        grpId - Group id which contains garbage.
        pageMemory - Page memory to work with.
        removeId - Global remove id.
        reuseList - Reuse list where free pages should be stored.
        Throws:
        IgniteCheckedException - If failed.
      • keyTypeSettings

        public IndexKeyTypeSettings keyTypeSettings()
        Returns:
        Default key type settings.
      • useUnwrappedPk

        public boolean useUnwrappedPk​(GridCacheContext<?,​?> cctx,
                                      String treeName)
        Returns:
        true In case of use an unwrapped PK for the index.
      • treeIndexes

        public List<InlineIndex> treeIndexes​(String cacheName,
                                             boolean createdOnly)
        Collect indexes for rebuild.
        Parameters:
        cacheName - Cache name.
        createdOnly - Get only created indexes (not restored from dick).
      • secondaryIndexesInlineSize

        public Map<String,​Integer> secondaryIndexesInlineSize()
        Information about secondary indexes efficient (actual) inline size.
        Returns:
        Map with inline sizes. The key of entry is a full index name (with schema and table name), the value of entry is a inline size.