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 ImportState
s
simultaneously.- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description CompositeImportState()
Public no-arg constructor forExternalizable
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_TYPEat(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 newProperties
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)
-
Constructor Details
-
CompositeImportState
public CompositeImportState()Public no-arg constructor forExternalizable
support. Do not use this in application code! -
CompositeImportState
Construct a new composite of the supplied states.- Parameters:
importStates
- The states to composite
-
-
Method Details
-
at
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
By default, gets the import details for the member import states in order and accumulates them into a newProperties
instance.- Specified by:
getImportDetails
in interfaceImportState
- Returns:
- The accumulated import details
-
ensureInitialized
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 theLiveTableMonitor
lock.- Specified by:
ensureInitialized
in interfaceImportState
- Parameters:
locationKey
- The full table location key of the location whose ImportState is being initialized
-
onResume
Description copied from interface:ImportState
Called when data ingestion is resumed for the location observed by this ImportState.- Specified by:
onResume
in interfaceImportState
- Parameters:
locationKey
- The full table location key of the location that has been resumed
-
onTruncate
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 interfaceImportState
- 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 interfaceImportState
-
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 interfaceImportState
-
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 interfaceImportState
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-