Class CompositeImportState

java.lang.Object
com.illumon.iris.db.tables.dataimport.importstate.CompositeImportState
All Implemented Interfaces:
ImportState, Externalizable, Serializable

public class CompositeImportState
extends Object
implements ImportState, Externalizable
ImportState class that allows a single table partition to produce multiple ImportStates simultaneously.
See Also:
Serialized Form
  • Constructor Summary

    Constructors 
    Constructor Description
    CompositeImportState()
    Public no-arg constructor for Externalizable support.
    CompositeImportState​(ImportState... importStates)
    Construct a new composite of the supplied states.
  • Method Summary

    Modifier and Type Method Description
    <IMPORT_STATE_TYPE extends ImportState>
    IMPORT_STATE_TYPE
    at​(int index)
    Get the import state at the supplied index.
    void ensureInitialized​(FullTableLocationKey locationKey)
    Called when non-import code needs to ensure that an ImportState's internals have been initialized because of their side effects.
    Properties getImportDetails()
    By default, gets the import details for the member import states in order and accumulates them into a new Properties instance.
    void onClose()
    Called when the data ingestion process for the location observed by this ImportState is finished, temporarily or permanently, in a consistent state.
    void onFlush()
    Called when the data ingestion process for the location observed by this ImportState is flushed (properly, after it has been flushed and when the resulting size has been made visible if applicable).
    void onRelease()
    Call when the data ingestion process for the location observed by this ImportState is finished, temporarily or permanently, in an inconsistent state.
    void onResume​(FullTableLocationKey locationKey)
    Called when data ingestion is resumed for the location observed by this ImportState.
    void onTruncate​(FullTableLocationKey locationKey)
    Called when the underlying table location has been truncated.
    void readExternal​(ObjectInput in)  
    void writeExternal​(ObjectOutput out)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CompositeImportState

      public CompositeImportState()
      Public no-arg constructor for Externalizable support. Do not use this in application code!
    • CompositeImportState

      public CompositeImportState​(@NotNull ImportState... importStates)
      Construct a new composite of the supplied states.
      Parameters:
      importStates - The states to composite
  • Method Details

    • at

      public <IMPORT_STATE_TYPE extends ImportState> IMPORT_STATE_TYPE at​(int index)
      Get the import state at the supplied index.
      Type Parameters:
      IMPORT_STATE_TYPE - The type of the import state to return
      Parameters:
      index - An index into the import states array for this composite import state
      Returns:
      The import state at index
    • getImportDetails

      @NotNull public Properties getImportDetails()
      By default, gets the import details for the member import states in order and accumulates them into a new Properties instance.
      Specified by:
      getImportDetails in interface ImportState
      Returns:
      The accumulated import details
    • ensureInitialized

      public final void ensureInitialized​(@NotNull FullTableLocationKey locationKey)
      Description copied from interface: ImportState
      Called when non-import code needs to ensure that an ImportState's internals have been initialized because of their side effects. Must not interfere with concurrent data ingestion in the same process. Generally should be treated as a query operation, and the caller should hold the LiveTableMonitor lock.
      Specified by:
      ensureInitialized in interface ImportState
      Parameters:
      locationKey - The full table location key of the location whose ImportState is being initialized
    • onResume

      public final void onResume​(@NotNull FullTableLocationKey locationKey)
      Description copied from interface: ImportState
      Called when data ingestion is resumed for the location observed by this ImportState.
      Specified by:
      onResume in interface ImportState
      Parameters:
      locationKey - The full table location key of the location that has been resumed
    • onTruncate

      public final void onTruncate​(@NotNull FullTableLocationKey locationKey)
      Description copied from interface: ImportState
      Called when the underlying table location has been truncated. Useful for resetting any in-memory state that may otherwise linger inappropriately.
      Specified by:
      onTruncate in interface ImportState
      Parameters:
      locationKey - The full table location key of the location that has been truncated
    • onFlush

      public final void onFlush()
      Description copied from interface: ImportState
      Called when the data ingestion process for the location observed by this ImportState is flushed (properly, after it has been flushed and when the resulting size has been made visible if applicable).
      Specified by:
      onFlush in interface ImportState
    • onRelease

      public final void onRelease()
      Description copied from interface: ImportState
      Call when the data ingestion process for the location observed by this ImportState is finished, temporarily or permanently, in an inconsistent state.
      Specified by:
      onRelease in interface ImportState
    • onClose

      public final void onClose()
      Description copied from interface: ImportState
      Called when the data ingestion process for the location observed by this ImportState is finished, temporarily or permanently, in a consistent state.
      Specified by:
      onClose in interface ImportState
    • writeExternal

      public final void writeExternal​(@NotNull ObjectOutput out) throws IOException
      Specified by:
      writeExternal in interface Externalizable
      Throws:
      IOException
    • readExternal

      public final void readExternal​(@NotNull ObjectInput in) throws IOException, ClassNotFoundException
      Specified by:
      readExternal in interface Externalizable
      Throws:
      IOException
      ClassNotFoundException