Class AbstractModify<T>

java.lang.Object
org.apache.drill.metastore.operate.AbstractModify<T>
Type Parameters:
T - Metastore metadata unit
All Implemented Interfaces:
Modify<T>
Direct Known Subclasses:
IcebergModify, MongoModify, RdbmsModify

public abstract class AbstractModify<T> extends Object implements Modify<T>
Abstract implementation of Modify<T> interface which contains all boilerplace code for collecting overwrite units and delete operations. Delete operations metadata types are validated before adding to the list of pending delete operations.
  • Constructor Details

  • Method Details

    • overwrite

      public final Modify<T> overwrite(List<T> units)
      Description copied from interface: Modify
      Adds overwrite operation for the Metastore component. For Metastore Tables component, can be used to add new table data or replace partially / fully existing. For example, if one of the table segments has changed, all this segment data and table general information must be replaced with updated data. Thus provided units must include updated data, filter by which existing data will be overwritten will be determined based on given data.
      Specified by:
      overwrite in interface Modify<T>
      Parameters:
      units - component units to be overwritten
      Returns:
      current instance of Modify interface implementation
    • delete

      public final Modify<T> delete(Delete delete)
      Description copied from interface: Modify
      Adds delete operation for the Metastore component based on the filter expression and metadata types. For example for Metastore Tables component, if table has two segments and data for one of the segments needs to be deleted. Thus filter must be based on unique identifier of the table's top-level segment: storagePlugin = 'dfs' and workspace = 'tmp' and tableName = 'nation' and metadataKey = 'part_int=3'. Metadata types should include all metadata types present in this segment: SEGMENT, FILE, ROW_GROUP, PARTITION. If all table metadata should be deleted, ALL segment can be indicated along with unique table identifier: storagePlugin = 'dfs' and workspace = 'tmp' and tableName = 'nation'.
      Specified by:
      delete in interface Modify<T>
      Parameters:
      delete - delete operation holder
      Returns:
      current instance of Modify interface implementation
    • addOverwrite

      protected abstract void addOverwrite(List<T> units)
      Adds overwrite operation to the list of pending operations. Is used to ensure operations execution order.
      Parameters:
      units - list of Metastore metadata units
    • addDelete

      protected abstract void addDelete(Delete delete)
      Adds delete operation to the list of pending operations. Is used to ensure operations execution order.
      Parameters:
      delete - Metastore delete operation holder