Class IndexRebuildFutureStorage


  • public class IndexRebuildFutureStorage
    extends Object
    Holder of up-to-date information of rebuild index futures for caches. Thread safe.
    • Constructor Detail

      • IndexRebuildFutureStorage

        public IndexRebuildFutureStorage()
    • Method Detail

      • indexRebuildFuture

        @Nullable
        public @Nullable GridFutureAdapter<Void> indexRebuildFuture​(int cacheId)
        Getting index rebuild future for the cache.
        Parameters:
        cacheId - Cache id.
        Returns:
        Future if rebuilding is in progress or null if not.
      • rebuildIndexesOnExchange

        public boolean rebuildIndexesOnExchange​(int cacheId,
                                                AffinityTopologyVersion topVer)
        Checks that the indexes need to be rebuilt on the exchange.
        Parameters:
        cacheId - Cache id.
        topVer - Topology version.
        Returns:
        True if need to rebuild.
      • cancelRebuildIndexesOnExchange

        public void cancelRebuildIndexesOnExchange​(Set<Integer> cacheIds,
                                                   AffinityTopologyVersion topVer)
        Canceling index rebuilding for caches on the exchange.
        Parameters:
        cacheIds - Cache ids.
        topVer - Topology version.
      • prepareRebuildIndexes

        public Set<Integer> prepareRebuildIndexes​(Set<Integer> cacheIds,
                                                  @Nullable
                                                  @Nullable AffinityTopologyVersion topVer)
        Preparing futures of rebuilding indexes for caches. The future for the cache will be added only if the previous one is missing or completed.
        Parameters:
        cacheIds - Cache ids.
        topVer - Topology version if rebuilding indexes should be on exchange.
        Returns:
        Cache ids for which features have not been added.
      • onFinishRebuildIndexes

        public void onFinishRebuildIndexes​(int cacheId,
                                           @Nullable
                                           @Nullable Throwable err)
        Callback on finish of rebuilding indexes for the cache.
        Parameters:
        cacheId - Cache id.
        err - Error.