Package com.illumon.iris.db.v2.locations
Class DeferredTableLocation.SnapshotDriven
java.lang.Object
com.illumon.iris.db.v2.locations.DeferredTableLocation
com.illumon.iris.db.v2.locations.DeferredTableLocation.SnapshotDriven
- All Implemented Interfaces:
com.fishlib.base.log.LogOutputAppendable,TableLocation,TableLocationKey,TableLocationState,NamedImplementation
- Enclosing class:
- DeferredTableLocation
DeferredTableLocation that implements metadata getters by delegating to a snapshot. Snapshotted TableLocations
never support subscriptions, and don't allow any sort of metadata refresh.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.illumon.iris.db.v2.locations.DeferredTableLocation
DeferredTableLocation.DataDriven, DeferredTableLocation.SnapshotDriven, DeferredTableLocation.TableLocationCreatorNested 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
ConstructorsConstructorDescriptionSnapshotDriven(TableKey tableKey, TableLocationMetadataIndex.TableLocationSnapshot tableLocationSnapshot, DeferredTableLocation.TableLocationCreator tableLocationCreator) -
Method Summary
Modifier and TypeMethodDescriptiongetDataIndex(String... columns) Get the data index table for the specified set of columns.Get the format that was used to persist this table location.longlonggetSize()Get an ordered list of columns this location is sorted by.booleanhasDataIndexFor(String... columns) Check if this location has a data index for the specified columns.voidrefresh()Initialize or refresh state information.voidsubscribe(TableLocation.Listener listener) Subscribe to pushed location updates.booleanDoes this location support subscriptions? That is, can this location ever have ticking data?voidunsubscribe(TableLocation.Listener listener) Unsubscribe from pushed location updates.Methods inherited from class com.illumon.iris.db.v2.locations.DeferredTableLocation
as, clearColumnLocations, getColumnLocation, getColumnPartition, getImplementationName, getInternalPartition, getTableKey, getVisit, handleUpdate, isRealized, toString, visitMethods 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, getColumnLocation, toGenericString, toStringDetailed, toStringHelperMethods inherited from interface com.illumon.iris.db.v2.locations.TableLocationKey
writeToMethods inherited from interface com.illumon.iris.db.v2.locations.TableLocationState
copyStateValuesTo, getSizeStr, writeStateValuesTo
-
Constructor Details
-
SnapshotDriven
public SnapshotDriven(@NotNull TableKey tableKey, @NotNull TableLocationMetadataIndex.TableLocationSnapshot tableLocationSnapshot, @NotNull DeferredTableLocation.TableLocationCreator tableLocationCreator)
-
-
Method Details
-
getStateLock
- Returns:
- The Object that accessors should synchronize on if they want to invoke multiple getters with consistent results.
-
getSize
public long getSize()- 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 long getLastModifiedTimeMillis()- 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
-
getFormat
Description copied from interface:TableLocationGet the format that was used to persist this table location.- Returns:
- The format for this table location
-
supportsSubscriptions
public boolean supportsSubscriptions()Description copied from interface:TableLocationDoes this location support subscriptions? That is, can this location ever have ticking data?- Returns:
- True if this location supports subscriptions
-
subscribe
Description copied from interface:TableLocationSubscribe to pushed location updates. Subscribing more than once with the same listener without an intervening unsubscribe is an error, and may result in undefined behavior.
This is a possibly asynchronous operation - listener will receive 1 or more handleUpdate callbacks, followed by 0 or 1 handleException callbacks during invocation and continuing after completion, on a thread determined by the implementation. Don't hold a lock that prevents notification delivery while subscribing!
This method only guarantees eventually consistent state. To force a state update, use refresh() after subscription completes.
- Parameters:
listener- A listener
-
unsubscribe
Description copied from interface:TableLocationUnsubscribe from pushed location updates.- Parameters:
listener- The listener to forget about
-
refresh
public void refresh()Description copied from interface:TableLocationInitialize or refresh state information. -
getSortedColumns
Description copied from interface:TableLocationGet an ordered list of columns this location is sorted by.- Returns:
- a non-null ordered list of
SortPairs
-
hasDataIndexFor
Description copied from interface:TableLocationCheck if this location has a data index for the specified columns.- Parameters:
columns- the set of columns to check for.- Returns:
- true if the table has a Data Index for the specified columns
-
getDataIndex
Description copied from interface:TableLocationGet the data index table for the specified set of columns. Note that the order of columns does not matter here.- Parameters:
columns- the key columns for the index- Returns:
- the index table or null if one does not exist.
-