Class Ignite2PersistentCacheTools

java.lang.Object
org.apache.ignite.migrationtools.persistence.Ignite2PersistentCacheTools

public class Ignite2PersistentCacheTools extends Object
Utility methods to interact with Ignite 2 persistent caches.
  • Constructor Details

    • Ignite2PersistentCacheTools

      public Ignite2PersistentCacheTools()
  • Method Details

    • persistentCaches

      public static Set<org.apache.commons.lang3.tuple.Pair<Integer,String>> persistentCaches(List<MigrationKernalContext> nodes) throws org.apache.ignite.IgniteCheckedException
      List the persistent caches in the provided nodes.
      Parameters:
      nodes - The cluster nodes.
      Returns:
      Set of cacheId cacheName pairs.
      Throws:
      org.apache.ignite.IgniteCheckedException - in case of error.
    • publishCacheCursor

      public static void publishCacheCursor(List<MigrationKernalContext> nodes, String cacheName, BiFunction<Flow.Publisher<Map.Entry<Object,Object>>,Integer,Optional<CompletableFuture<Void>>> partitionStreamFactory) throws org.apache.ignite.IgniteCheckedException
      Publishes a cache cursor on the given nodes.
      Parameters:
      nodes - Cluster nodes.
      cacheName - Cache name.
      partitionStreamFactory - Function that allows the caller to react when each partition cursor is opened.
      Throws:
      org.apache.ignite.IgniteCheckedException - in case of error.
    • publishCacheCursorAtNode

      public static void publishCacheCursorAtNode(MigrationKernalContext nodeCtx, org.apache.ignite.internal.processors.cache.DynamicCacheDescriptor cacheDescriptor, BiFunction<Flow.Publisher<Map.Entry<Object,Object>>,Integer,Optional<CompletableFuture<Void>>> partitionStreamFactory) throws org.apache.ignite.IgniteCheckedException
      Publishes a cache cursor on the given node.
      Parameters:
      nodeCtx - Cluster node context.
      cacheDescriptor - Cache descriptor.
      partitionStreamFactory - Function that allows the caller to react when each partition cursor is opened.
      Throws:
      org.apache.ignite.IgniteCheckedException - in case of error.
    • migrateCache

      public static void migrateCache(org.apache.ignite3.client.IgniteClient client, SqlDdlGenerator sqlGenerator, List<MigrationKernalContext> nodeContexts, String cacheName, Ignite2PersistentCacheTools.ColumnsProcessorFactory columnsProcessorFactory) throws org.apache.ignite.IgniteCheckedException
      Wrapper method that migrates a given cache.
      Parameters:
      client - Adapted client.
      sqlGenerator - SQL DDL Generator.
      nodeContexts - Node contexts.
      cacheName - Cache name.
      columnsProcessorFactory - Column processor factory.
      Throws:
      org.apache.ignite.IgniteCheckedException - in case of error.