Package com.illumon.iris.db.v2.locations
Class DeferredTableLocation.DataDriven
java.lang.Object
com.illumon.iris.db.v2.locations.DeferredTableLocation
com.illumon.iris.db.v2.locations.DeferredTableLocation.DataDriven
- All Implemented Interfaces:
com.fishlib.base.log.LogOutputAppendable
,TableLocation
,TableLocationKey
,TableLocationState
,NamedImplementation
- Enclosing class:
- DeferredTableLocation
DeferredTableLocation that needs to initialize its inner location for all non-key methods.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.illumon.iris.db.v2.locations.DeferredTableLocation
DeferredTableLocation.DataDriven, DeferredTableLocation.SnapshotDriven, DeferredTableLocation.TableLocationCreator
Nested classes/interfaces inherited from interface com.illumon.iris.db.v2.locations.TableLocation
TableLocation.Format, TableLocation.Listener
Nested 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_PARTITION
Fields inherited from interface com.illumon.iris.db.v2.locations.TableLocationState
NULL_SIZE, NULL_TIME, REMOVE_SIZE
-
Constructor Summary
ConstructorsConstructorDescriptionDataDriven
(TableKey tableKey, TableLocationKey tableLocationKey, 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.long
long
getSize()
Get an ordered list of columns this location is sorted by.boolean
hasDataIndexFor
(String... columns) Check if this location has a data index for the specified columns.void
refresh()
Initialize or refresh state information.void
subscribe
(TableLocation.Listener listener) Subscribe to pushed location updates.boolean
Does this location support subscriptions? That is, can this location ever have ticking data?void
unsubscribe
(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, visit
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.illumon.iris.db.v2.locations.TableLocation
append, getColumnLocation, toGenericString, toStringDetailed, toStringHelper
Methods inherited from interface com.illumon.iris.db.v2.locations.TableLocationKey
writeTo
Methods inherited from interface com.illumon.iris.db.v2.locations.TableLocationState
copyStateValuesTo, getSizeStr, writeStateValuesTo
-
Constructor Details
-
DataDriven
public DataDriven(@NotNull TableKey tableKey, @NotNull TableLocationKey tableLocationKey, @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:TableLocation
Get 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:TableLocation
Does 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:TableLocation
Subscribe 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:TableLocation
Unsubscribe from pushed location updates.- Parameters:
listener
- The listener to forget about
-
refresh
public void refresh()Description copied from interface:TableLocation
Initialize or refresh state information. -
getSortedColumns
Description copied from interface:TableLocation
Get an ordered list of columns this location is sorted by.- Returns:
- a non-null ordered list of
SortPair
s
-
hasDataIndexFor
Description copied from interface:TableLocation
Check 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:TableLocation
Get 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.
-