Class LastByTableImportState<KEY_TYPE>
java.lang.Object
com.illumon.iris.db.tables.dataimport.importstate.TupleKeyedAbstractImportState<KEY_TYPE>
com.illumon.iris.db.tables.dataimport.importstate.lastby.BaseLastByTableImportState<KEY_TYPE>
com.illumon.iris.db.tables.dataimport.importstate.lastby.LastByTableImportState<KEY_TYPE>
- All Implemented Interfaces:
ImportState,LiveTable,Externalizable,Serializable,Runnable
ImportState that publishes a last-by view of the data being imported, producing a table intended for concurrent usage by clients with access to the importing process.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classLocalTableMap with an associated LiveTableRefreshCombiner.Nested classes/interfaces inherited from class com.illumon.iris.db.tables.dataimport.importstate.lastby.BaseLastByTableImportState
BaseLastByTableImportState.RowSetFactoryAdapter -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for an empty import state with null name.LastByTableImportState(String name) Constructor for an empty import state. -
Method Summary
Modifier and TypeMethodDescriptionvoidensureInitialized(FullTableLocationKey locationKey) Called when non-import code needs to ensure that an ImportState's internals have been initialized because of their side effects.Get the builder suitable for creating an initial RowSet (or Index) for this engine.getTableMap(TableKey tableKey) Get aLocalTableMapkeyed byTableLocationKeyofDynamicTables that contain only anIndexand no user-facingColumnSources.getTableMap(TableKey tableKey, String name) Get aLocalTableMapkeyed byTableLocationKeyofDynamicTables that contain only anIndexand no user-facingColumnSources.protected booleanVerify that this state remains valid for refreshing.protected voidmaybeUpdate(long[] addedKeys, long[] removedKeys) Update the table if we remain the owner of the ImportStatevoidonResume(FullTableLocationKey locationKey) Called when data ingestion is resumed for the location observed by this ImportState.voidonTruncate(FullTableLocationKey locationKey) Called when the underlying table location has been truncated.protected voidprotected voidMethods inherited from class com.illumon.iris.db.tables.dataimport.importstate.lastby.BaseLastByTableImportState
getImportDetails, getName, newRowForKey, onClose, onFlush, onRelease, readExternal, refresh, skipRow, writeExternalMethods inherited from class com.illumon.iris.db.tables.dataimport.importstate.TupleKeyedAbstractImportState
newRow, newRow, newRow, newRow, prepareElement, prepareKey
-
Constructor Details
-
LastByTableImportState
public LastByTableImportState()Constructor for an empty import state with null name. -
LastByTableImportState
Constructor for an empty import state.- Parameters:
name- The name for this last-by view (seegetTableMap(TableKey, String)).
-
-
Method Details
-
getTableMap
Get aLocalTableMapkeyed byTableLocationKeyofDynamicTables that contain only anIndexand no user-facingColumnSources. The contents of the result are produced by LastByImportState instances for the suppliedTableKeyand null name- Parameters:
tableKey- The key- Returns:
- The table map, possibly empty
-
getTableMap
public static LastByTableImportState.ResultTableMap getTableMap(@NotNull TableKey tableKey, String name) Get aLocalTableMapkeyed byTableLocationKeyofDynamicTables that contain only anIndexand no user-facingColumnSources. The contents of the result are produced by LastByTableImportState instances for the suppliedTableKeyand name. Distinct names should be used for distinct last-by import state views of the same table. TODO: Consider whether we should implement a LocalTableMap equivalent that stores weakly-reachable values.- Parameters:
tableKey- The keyname- The name- Returns:
- The table map, possibly empty
-
getRowSetFactoryAdapter
Description copied from class:BaseLastByTableImportStateGet the builder suitable for creating an initial RowSet (or Index) for this engine.- Specified by:
getRowSetFactoryAdapterin classBaseLastByTableImportState<KEY_TYPE>- Returns:
- the RowSetAdapter for this concrete state.
-
ensureInitialized
Description copied from interface:ImportStateCalled 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 theLiveTableMonitorlock.- Specified by:
ensureInitializedin interfaceImportState- Specified by:
ensureInitializedin classBaseLastByTableImportState<KEY_TYPE>- Parameters:
locationKey- The full table location key of the location whose ImportState is being initialized
-
onResume
Description copied from interface:ImportStateCalled when data ingestion is resumed for the location observed by this ImportState.- Specified by:
onResumein interfaceImportState- Specified by:
onResumein classBaseLastByTableImportState<KEY_TYPE>- Parameters:
locationKey- The full table location key of the location that has been resumed
-
onTruncate
Description copied from interface:ImportStateCalled when the underlying table location has been truncated. Useful for resetting any in-memory state that may otherwise linger inappropriately.- Specified by:
onTruncatein interfaceImportState- Overrides:
onTruncatein classBaseLastByTableImportState<KEY_TYPE>- Parameters:
locationKey- The full table location key of the location that has been truncated
-
startRefreshing
protected void startRefreshing()- Specified by:
startRefreshingin classBaseLastByTableImportState<KEY_TYPE>
-
stopRefreshing
protected void stopRefreshing()- Specified by:
stopRefreshingin classBaseLastByTableImportState<KEY_TYPE>
-
isValidToRefresh
protected boolean isValidToRefresh()Description copied from class:BaseLastByTableImportStateVerify that this state remains valid for refreshing.- Specified by:
isValidToRefreshin classBaseLastByTableImportState<KEY_TYPE>- Returns:
- true if this state is valid for refreshing.
-
maybeUpdate
protected void maybeUpdate(long[] addedKeys, long[] removedKeys) Description copied from class:BaseLastByTableImportStateUpdate the table if we remain the owner of the ImportState- Specified by:
maybeUpdatein classBaseLastByTableImportState<KEY_TYPE>- Parameters:
addedKeys- row keys (positions in this partition) added to the tableremovedKeys- row keys (positions in this partition) removed from the table
-