Class LocalTableLocation
java.lang.Object
com.illumon.iris.db.v2.locations.SubscriptionAggregator<TableLocation.Listener>
com.illumon.iris.db.v2.locations.AbstractTableLocation<TableKey,LocalColumnLocation>
com.illumon.iris.db.v2.locations.local.LocalTableLocation
- All Implemented Interfaces:
com.fishlib.base.log.LogOutputAppendable,DeephavenFormatTableLocation<LocalColumnLocation>,TableLocation<LocalColumnLocation>,TableLocationKey,TableLocationState,NamedImplementation
- Direct Known Subclasses:
ReadOnlyLocalTableLocation,WritableLocalTableLocation
public abstract class LocalTableLocation extends AbstractTableLocation<TableKey,LocalColumnLocation> implements DeephavenFormatTableLocation<LocalColumnLocation>
Base class for local table location 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 -
Method Summary
Modifier and Type Method Description voidensureReaderCheckpointInitialized()Ensure that the checkpoint record for this location has been read sufficiently to allow access to metadata, such as sorted columns, version, and column version.FilegetCheckpointRecordFile()Get the checkpoint record file.intgetColumnVersion()Get the column version for this location.TablegetDataIndex(com.illumon.dataobjects.ColumnDefinition<?>... columns)Get the data index table for the specified set of columns.FilegetDirectory()CheckpointRecordgetReaderCheckpointRecord()Access the checkpoint record in use by readers of this location.List<SortPair>getSortedColumns()Get an ordered list of columns this location is sorted by.booleanhasDataIndexFor(com.illumon.dataobjects.ColumnDefinition<?>... columns)Check if this location has a data index for the specified columns.protected LocalColumnLocationmakeColumnLocation(String name)CheckpointRecordreadCheckpointRecordForImporters()Read the supplied directory's entire checkpoint record file into a newly-allocated checkpoint record.static CheckpointRecordreadCheckpointRecordForImporters(File directory)Read the supplied directory's entire checkpoint record file into a newly-allocated checkpoint record.static CheckpointRecordreadCheckpointRecordForImporters(File directory, boolean requireFileToExist)Read the supplied directory's entire checkpoint record file into a newly-allocated checkpoint record.static CheckpointRecordreadCheckpointRecordForImportersFromFile(File file)Read the entire supplied checkpoint record file into a newly-allocated checkpoint record.static CheckpointRecordreadCheckpointRecordForImportersFromFile(File file, boolean requireFileToExist)Read the entire supplied checkpoint record file into a newly-allocated checkpoint record.static voidreadCheckpointRecordForSerialConsumers(File checkpointRecordFile, CheckpointRecord checkpointRecord)Read the serial consumer fields of the specified checkpoint record file into the supplied checkpoint record.voidrefreshReaderCheckpointRecord()Read the serial consumer fields from the checkpoint record file into the internal reader checkpoint record.voidsetSnapshot(TableLocationMetadataIndex.TableLocationSnapshot snapshot)static voidwriteCheckpointRecord(CheckpointRecord checkpointRecord, File directory)Write the supplied checkpoint record to the destination directory's checkpoint record file.Methods inherited from class com.illumon.iris.db.v2.locations.AbstractTableLocation
clearColumnLocations, deliverInitialSnapshot, getColumnLocation, getColumnPartition, getInternalPartition, getLastModifiedTimeMillis, getSize, getStateLock, getTableKey, getVisit, handleUpdate, handleUpdate, toString, visitMethods 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.DeephavenFormatTableLocation
getFormatMethods inherited from interface com.illumon.iris.db.v2.locations.TableLocation
append, getColumnLocation, getTableKey, getVisit, refresh, subscribe, supportsSubscriptions, toGenericString, toStringDetailed, toStringHelper, unsubscribe, visitMethods inherited from interface com.illumon.iris.db.v2.locations.TableLocationKey
getColumnPartition, getInternalPartition, writeToMethods inherited from interface com.illumon.iris.db.v2.locations.TableLocationState
copyStateValuesTo, getLastModifiedTimeMillis, getSize, getSizeStr, getStateLock, writeStateValuesTo
-
Method Details
-
getDirectory
-
getSortedColumns
Description copied from interface:TableLocationGet an ordered list of columns this location is sorted by.- Specified by:
getSortedColumnsin interfaceTableLocation<LocalColumnLocation>- Returns:
- a non-null ordered list of
SortPairs
-
hasDataIndexFor
public boolean hasDataIndexFor(@NotNull com.illumon.dataobjects.ColumnDefinition<?>... columns)Description copied from interface:TableLocationCheck if this location has a data index for the specified columns.- Specified by:
hasDataIndexForin interfaceTableLocation<LocalColumnLocation>- Parameters:
columns- the set of columns to check for.- Returns:
- true if the table has a Data Index for the specified columns
-
getDataIndex
@Nullable public Table getDataIndex(@NotNull com.illumon.dataobjects.ColumnDefinition<?>... columns)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.- Specified by:
getDataIndexin interfaceTableLocation<LocalColumnLocation>- Parameters:
columns- the key columns for the index- Returns:
- the index table or null if one does not exist.
-
getColumnVersion
public int getColumnVersion()Description copied from interface:TableLocationGet the column version for this location.- Specified by:
getColumnVersionin interfaceTableLocation<LocalColumnLocation>- Returns:
- the column version
-
makeColumnLocation
- Specified by:
makeColumnLocationin classAbstractTableLocation<TableKey,LocalColumnLocation>
-
ensureReaderCheckpointInitialized
public void ensureReaderCheckpointInitialized()Ensure that the checkpoint record for this location has been read sufficiently to allow access to metadata, such as sorted columns, version, and column version.
-
getCheckpointRecordFile
Get the checkpoint record file.- Returns:
- The checkpoint record file
-
getReaderCheckpointRecord
Access the checkpoint record in use by readers of this location. This is for advanced use only.- Returns:
- The checkpoint record used for reading data from this location
-
readCheckpointRecordForImporters
Read the supplied directory's entire checkpoint record file into a newly-allocated checkpoint record. If the file cannot be found, an empty record will be returned. This is intended for use by import, merge, and validation code, or other miscellaneous data-related jobs.- Returns:
- The newly-allocated checkpoint record
-
readCheckpointRecordForImporters
Read the supplied directory's entire checkpoint record file into a newly-allocated checkpoint record. If the file cannot be found, an empty record will be returned. This is intended for use by import, merge, and validation code.- Parameters:
directory- The directory- Returns:
- The newly-allocated checkpoint record
-
readCheckpointRecordForImporters
public static CheckpointRecord readCheckpointRecordForImporters(@NotNull File directory, boolean requireFileToExist)Read the supplied directory's entire checkpoint record file into a newly-allocated checkpoint record. If the file cannot be found, an empty record will be returned (unless requireFileToExist is true). This is intended for use by import, merge, and validation code.- Parameters:
directory- The directoryrequireFileToExist- if true, throw a TableDataException if the checkpoint file does not exist- Returns:
- The newly-allocated checkpoint record
- Throws:
TableDataException- if requireFileToExist is true and the checkpoint file does not exist
-
readCheckpointRecordForImportersFromFile
@NotNull public static CheckpointRecord readCheckpointRecordForImportersFromFile(@NotNull File file)Read the entire supplied checkpoint record file into a newly-allocated checkpoint record. If the file cannot be found, an empty record will be returned. This is intended for use by import, merge, and validation code.- Parameters:
file- The file- Returns:
- The newly-allocated checkpoint record
-
readCheckpointRecordForImportersFromFile
@NotNull public static CheckpointRecord readCheckpointRecordForImportersFromFile(@NotNull File file, boolean requireFileToExist)Read the entire supplied checkpoint record file into a newly-allocated checkpoint record. If the file cannot be found, an empty record will be returned (unless requireFileToExist is true). This is intended for use by import, merge, and validation code.- Parameters:
file- The filerequireFileToExist- if true, throw a TableDataException if the checkpoint file does not exist- Returns:
- The newly-allocated checkpoint record
- Throws:
TableDataException- if requireFileToExist is true and the checkpoint file does not exist
-
readCheckpointRecordForSerialConsumers
public static void readCheckpointRecordForSerialConsumers(@NotNull File checkpointRecordFile, @NotNull CheckpointRecord checkpointRecord) throws IOExceptionRead the serial consumer fields of the specified checkpoint record file into the supplied checkpoint record. Note that the record is cleared before read. If the file no longer exists, the record will remain cleared.- Parameters:
checkpointRecordFile- The file to readcheckpointRecord- The record to fill- Throws:
IOException
-
writeCheckpointRecord
public static void writeCheckpointRecord(@NotNull CheckpointRecord checkpointRecord, @NotNull File directory)Write the supplied checkpoint record to the destination directory's checkpoint record file.- Parameters:
checkpointRecord- The checkpoint record to read fromdirectory- The directory
-
refreshReaderCheckpointRecord
public void refreshReaderCheckpointRecord()Read the serial consumer fields from the checkpoint record file into the internal reader checkpoint record. Note that the record is cleared before read. If the file no longer exists, the record will remain cleared. -
setSnapshot
-