Interface DataSourceMetadata

All Known Implementing Classes:
ObjectMetadata

public interface DataSourceMetadata
Commit metadata for a dataSource. Used by IndexerMetadataStorageCoordinator#commitSegmentsAndMetadata(Set, DataSourceMetadata, DataSourceMetadata, SegmentSchemaMapping) to provide metadata transactions for segment inserts. Two metadata instances can be added together, and any conflicts are resolved in favor of the right-hand side. This means metadata can be partitioned.
  • Method Details

    • isValidStart

      boolean isValidStart()
      Returns true if this instance should be considered a valid starting point for a new dataSource that has no existing metadata.
    • asStartMetadata

      DataSourceMetadata asStartMetadata()
      As in IndexerMetadataStorageCoordinator.commitSegments(java.util.Set<org.apache.druid.timeline.DataSegment>, org.apache.druid.segment.SegmentSchemaMapping), this class can represent start and end of a sequence. This method converts itself into the one for start of a sequence. Most implementations can simply return this.
    • matches

      boolean matches(DataSourceMetadata other)
      Returns true if any information present in this instance matches analogous information from "other" and so they are conflict-free. In other words, "one.plus(two)" and "two.plus(one)" should return equal instances if "one" matches "two". One simple way to implement this is to make it the same as "equals", although that doesn't allow for partitioned metadata. Behavior is undefined if you pass in an instance of a different class from this one.
      Parameters:
      other - another instance
      Returns:
      true or false
    • plus

      Returns a copy of this instance with "other" merged in. Any conflicts should be resolved in favor of information from "other". Behavior is undefined if you pass in an instance of a different class from this one.
      Parameters:
      other - another instance
      Returns:
      merged copy
    • minus

      Returns a copy of this instance with "other" subtracted. Behavior is undefined if you pass in an instance of a different class from this one.
      Parameters:
      other - another instance
      Returns:
      subtracted copy