Class IgniteClientAdapter.Builder

java.lang.Object
org.gridgain.ignite.migrationtools.adapter.IgniteClientAdapter.Builder
Enclosing interface:
IgniteClientAdapter

public static class IgniteClientAdapter.Builder extends Object
  • Constructor Details

    • Builder

      public Builder(org.apache.ignite3.client.IgniteClient ignite3Client)
      Creates a new instance of this builder.
      Parameters:
      ignite3Client - An Ignite 3 client.
  • Method Details

    • tableTypeRegistry

      public IgniteClientAdapter.Builder tableTypeRegistry(org.apache.ignite.migrationtools.tablemanagement.TableTypeRegistry tableTypeRegistry)
      Overrides the default TableTypeRegistry implementation.

      The TableTypeRegistry is an important component of the adapter since it provides mappings between table and their corresponding Java Classes. In Ignite 2, this information can be found in the cache's Query Entities. However, Ignite 2 does not force records to comply with one of the Query entities defined for the cache, therefore, this registry only provides hints as to what the mappings should be; it may not cover all record schemas in the cache.

      Currently, the default TableTypeRegistry implementation is backed by a persistent table (see PersistentTableTypeRegistryImpl).

      Parameters:
      tableTypeRegistry - The new TableTypeRegistry implementation.
      Returns:
      The same instance of the builder.
    • allowExtraFields

      public IgniteClientAdapter.Builder allowExtraFields(boolean allowExtraFields)
      The adapted Ignite instances support two distinct strategies for mapping Java Objects to Ignite 3 Tables.

      With allowExtraField enabled, unsupported attributes in the mapped type, for instance, other nested Java Objects will be mapped to an additional column allowing them to be persisted and retrieved alongside the data. This mimics the default behaviour in Ignite 2 since Java Objects are fully serialized into cache rows irrespectively of the cache's indexed types and query entities.

      When this feature is disabled, the mapped classes must completely match the Ignite 3 table schema.

      Unfortunately, this feature may introduce a significant performance penalty for large objects. Therefore, it is disabled by default.

      This feature is closely related to the PACK_EXTRA mode in the migrate cache cli. If, by any chance, you are working with caches migrated using this mode, you should enable this feature to have access to all the migrated data out-of-the-box.

      Parameters:
      allowExtraFields - Enables or Disables this feature.
      Returns:
      The same instance of the builder.
    • allowNonDefaultConstructors

      public IgniteClientAdapter.Builder allowNonDefaultConstructors(boolean allowNonDefaultConstructors)
      This enables mapping Java classes which do not define a default constructor.

      This feature is not supported natively in Ignite 3 / Gridgain 9. As a result, we encourage you to implement default constructors in your data classes instead of relying on this feature since it relies on unsafe mechanisms and introduces a small performance penalty.

      This feature is disabled by default.
      Parameters:
      allowNonDefaultConstructors - Enables or Disables this feature.
      Returns:
      The same instance of the builder.
    • build

      public org.apache.ignite.client.IgniteClient build()
      Creates a new adapted IgniteClient instance.
      Returns:
      The new instance.