Class JsonMetadataDomain

Object
io.delta.kernel.internal.metadatadomain.JsonMetadataDomain
Direct Known Subclasses:
ClusteringMetadataDomain, RowTrackingMetadataDomain

public abstract class JsonMetadataDomain extends Object
Abstract class representing a metadata domain, whose configuration string is a JSON serialization of a domain object. This class provides methods to serialize and deserialize a metadata domain to and from JSON. Concrete implementations, such as RowTrackingMetadataDomain, should extend this class to define a specific metadata domain.

A metadata domain differs from DomainMetadata: DomainMetadata represents an action that modifies the table's state by updating the configuration of a named metadata domain. A metadata domain is a named domain used to organize configurations related to a specific table feature.

For example, the row tracking feature uses a RowTrackingMetadataDomain to store the highest assigned fresh row id of the table. When updated, the row tracking feature creates and commits a new DomainMetadata action to reflect the change.

Serialization and deserialization are handled using Jackson's annotations. By default, all public fields and getters are included in the serialization. When creating subclasses, ensure that all fields to be serialized are accessible either through public fields or getters.

To control this behavior:

  • Annotate methods/fields with JsonIgnore if they should be excluded from serialization/deserialization.
  • Annotate constructor with JsonCreator to specify which constructor to use during deserialization.
  • Use JsonProperty on constructor parameters to define the JSON field names during deserialization.
  • Constructor Details

    • JsonMetadataDomain

      public JsonMetadataDomain()
  • Method Details

    • getDomainName

      public abstract String getDomainName()
      Returns the name of the domain.
      Returns:
      the domain name
    • toJsonConfiguration

      public String toJsonConfiguration()
      Serializes this object into a JSON string.
      Returns:
      the JSON string representation of this object
      Throws:
      KernelException - if the object cannot be serialized
    • toDomainMetadata

      public DomainMetadata toDomainMetadata()
      Generate a DomainMetadata action from this metadata domain.
      Returns:
      the DomainMetadata action instance