Package com.illumon.iris.db.v2.locations
Class AbstractTableLocation<TKT extends TableKey,CLT extends ColumnLocation>
java.lang.Object
com.illumon.iris.db.v2.locations.SubscriptionAggregator<TableLocation.Listener>
com.illumon.iris.db.v2.locations.AbstractTableLocation<TKT,CLT>
- All Implemented Interfaces:
com.fishlib.base.log.LogOutputAppendable,TableLocation<CLT>,TableLocationKey,TableLocationState,NamedImplementation
- Direct Known Subclasses:
LocalTableLocation,ReadOnlyParquetTableLocation
public abstract class AbstractTableLocation<TKT extends TableKey,CLT extends ColumnLocation> extends SubscriptionAggregator<TableLocation.Listener> implements TableLocation<CLT>
Partial TableLocation implementation for use by TableDataService implementations.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.db.v2.locations.TableLocation
TableLocation.Format, TableLocation.ListenerNested classes/interfaces inherited from interface com.illumon.iris.db.v2.locations.TableLocationKey
TableLocationKey.ComparatorImpl, TableLocationKey.KeyedObjectKeyImpl<VALUE_TYPE>, TableLocationKey.SelfKeyedObjectKeyImpl<VALUE_TYPE extends TableLocationKey> -
Field Summary
Fields inherited from interface com.illumon.iris.db.v2.locations.TableLocationKey
COMPARATOR, NULL_PARTITIONFields inherited from interface com.illumon.iris.db.v2.locations.TableLocationState
NULL_SIZE, NULL_TIME, REMOVE_SIZE -
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractTableLocation(TKT tableKey, TableLocationKey tableLocationKey, boolean supportsSubscriptions) -
Method Summary
Modifier and Type Method Description protected voidclearColumnLocations()Clear all column locations (usually because a truncated location was observed).protected voiddeliverInitialSnapshot(TableLocation.Listener listener)Prompt listeners to record current state, under the subscriptions lock.CLTgetColumnLocation(CharSequence name)StringgetColumnPartition()StringgetInternalPartition()longgetLastModifiedTimeMillis()longgetSize()ObjectgetStateLock()TKTgetTableKey()longgetVisit()return the last value set inTableLocation.visit(long)voidhandleUpdate(long size, long lastModifiedTimeMillis)See TableLocationState for documentation of values.voidhandleUpdate(TableLocationState source)Update all state fields from source's values, as inhandleUpdate(long, long).protected abstract CLTmakeColumnLocation(String name)StringtoString()AbstractTableLocation<TKT,CLT>visit(long stamp)Mark this table location as visited, with the given (time)stamp.Methods inherited from class com.illumon.iris.db.v2.locations.SubscriptionAggregator
activateUnderlyingDataSource, activationFailed, activationSuccessful, checkHasSubscribers, deactivateUnderlyingDataSource, matchSubscriptionToken, postActivationHook, subscribe, supportsSubscriptions, unsubscribeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.illumon.iris.db.v2.locations.TableLocation
append, getColumnVersion, getDataIndex, getFormat, getSortedColumns, hasDataIndexFor, refresh, subscribe, supportsSubscriptions, toGenericString, toStringDetailed, toStringHelper, unsubscribeMethods inherited from interface com.illumon.iris.db.v2.locations.TableLocationState
copyStateValuesTo, getSizeStr, writeStateValuesTo
-
Constructor Details
-
AbstractTableLocation
protected AbstractTableLocation(@NotNull TKT tableKey, @NotNull TableLocationKey tableLocationKey, boolean supportsSubscriptions)- Parameters:
tableKey- Table key for the table this location belongs totableLocationKey- A key whose field values will be deep-copied to this locationsupportsSubscriptions- Whether subscriptions are to be supported
-
-
Method Details
-
visit
Description copied from interface:TableLocationMark this table location as visited, with the given (time)stamp.- Specified by:
visitin interfaceTableLocation<TKT extends TableKey>- Parameters:
stamp- a monotonically increasing value indicating when this location was visited.- Returns:
- returns itself for chaining
-
getVisit
public long getVisit()Description copied from interface:TableLocationreturn the last value set inTableLocation.visit(long)- Specified by:
getVisitin interfaceTableLocation<TKT extends TableKey>- Returns:
- the last value set in visit()
-
toString
-
getInternalPartition
- Specified by:
getInternalPartitionin interfaceTableLocationKey- Returns:
- The internal partition that encloses the identified table location, or null if none exists
-
getColumnPartition
- Specified by:
getColumnPartitionin interfaceTableLocationKey- Returns:
- The column partition that encloses the identified table location, or null if none exists
-
getStateLock
- Specified by:
getStateLockin interfaceTableLocationState- Returns:
- The Object that accessors should synchronize on if they want to invoke multiple getters with consistent results.
-
getSize
public final long getSize()- Specified by:
getSizein interfaceTableLocationState- Returns:
- The size of a table location:
NULL_SIZE : Size information is unknown or does not exist for this table location
>= 0 : The table location exists and has (possibly empty) data
-
getLastModifiedTimeMillis
public final long getLastModifiedTimeMillis()- Specified by:
getLastModifiedTimeMillisin interfaceTableLocationState- Returns:
- The last modified time for a table location, in milliseconds from the epoch:
NULL_TIME : Modification time information is unknown or does not exist for this table location
>= 0L : The time this table was last modified, in milliseconds from the UTC epoch
-
getTableKey
- Specified by:
getTableKeyin interfaceTableLocation<TKT extends TableKey>- Returns:
- A TableKey instance for the enclosing table
-
deliverInitialSnapshot
Description copied from class:SubscriptionAggregatorPrompt listeners to record current state, under the subscriptions lock.- Specified by:
deliverInitialSnapshotin classSubscriptionAggregator<TableLocation.Listener>- Parameters:
listener- The listener to notify
-
handleUpdate
public final void handleUpdate(long size, long lastModifiedTimeMillis)See TableLocationState for documentation of values.- Parameters:
size- The new sizelastModifiedTimeMillis- The new lastModificationTimeMillis
-
handleUpdate
Update all state fields from source's values, as inhandleUpdate(long, long). SeeTableLocationStatefor documentation of values.- Parameters:
source- The source to copy state values from
-
getColumnLocation
- Specified by:
getColumnLocationin interfaceTableLocation<TKT extends TableKey>- Parameters:
name- The column name- Returns:
- The ColumnLocation for the defined column under this table location
-
makeColumnLocation
-
clearColumnLocations
protected final void clearColumnLocations()Clear all column locations (usually because a truncated location was observed).
-