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.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
-
Method Summary
Modifier and Type Method Description 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.File
getCheckpointRecordFile()
Get the checkpoint record file.int
getColumnVersion()
Get the column version for this location.Table
getDataIndex(com.illumon.dataobjects.ColumnDefinition<?>... columns)
Get the data index table for the specified set of columns.File
getDirectory()
CheckpointRecord
getReaderCheckpointRecord()
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.boolean
hasDataIndexFor(com.illumon.dataobjects.ColumnDefinition<?>... columns)
Check if this location has a data index for the specified columns.protected LocalColumnLocation
makeColumnLocation(String name)
CheckpointRecord
readCheckpointRecordForImporters()
Read the supplied directory's entire checkpoint record file into a newly-allocated checkpoint record.static CheckpointRecord
readCheckpointRecordForImporters(File directory)
Read the supplied directory's entire checkpoint record file into a newly-allocated checkpoint record.static CheckpointRecord
readCheckpointRecordForImporters(File directory, boolean requireFileToExist)
Read the supplied directory's entire checkpoint record file into a newly-allocated checkpoint record.static CheckpointRecord
readCheckpointRecordForImportersFromFile(File file)
Read the entire supplied checkpoint record file into a newly-allocated checkpoint record.static CheckpointRecord
readCheckpointRecordForImportersFromFile(File file, boolean requireFileToExist)
Read the entire supplied checkpoint record file into a newly-allocated checkpoint record.static void
readCheckpointRecordForSerialConsumers(File checkpointRecordFile, CheckpointRecord checkpointRecord)
Read the serial consumer fields of the specified checkpoint record file into the supplied checkpoint record.void
refreshReaderCheckpointRecord()
Read the serial consumer fields from the checkpoint record file into the internal reader checkpoint record.void
setSnapshot(TableLocationMetadataIndex.TableLocationSnapshot snapshot)
static void
writeCheckpointRecord(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, visit
Methods inherited from class com.illumon.iris.db.v2.locations.SubscriptionAggregator
activateUnderlyingDataSource, activationFailed, activationSuccessful, checkHasSubscribers, deactivateUnderlyingDataSource, matchSubscriptionToken, postActivationHook, subscribe, supportsSubscriptions, unsubscribe
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.DeephavenFormatTableLocation
getFormat
Methods inherited from interface com.illumon.iris.db.v2.locations.TableLocation
append, getColumnLocation, getTableKey, getVisit, refresh, subscribe, supportsSubscriptions, toGenericString, toStringDetailed, toStringHelper, unsubscribe, visit
Methods inherited from interface com.illumon.iris.db.v2.locations.TableLocationKey
getColumnPartition, getInternalPartition, writeTo
Methods inherited from interface com.illumon.iris.db.v2.locations.TableLocationState
copyStateValuesTo, getLastModifiedTimeMillis, getSize, getSizeStr, getStateLock, writeStateValuesTo
-
Method Details
-
getDirectory
-
getSortedColumns
Description copied from interface:TableLocation
Get an ordered list of columns this location is sorted by.- Specified by:
getSortedColumns
in interfaceTableLocation<LocalColumnLocation>
- Returns:
- a non-null ordered list of
SortPair
s
-
hasDataIndexFor
public boolean hasDataIndexFor(@NotNull com.illumon.dataobjects.ColumnDefinition<?>... columns)Description copied from interface:TableLocation
Check if this location has a data index for the specified columns.- Specified by:
hasDataIndexFor
in 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:TableLocation
Get the data index table for the specified set of columns. Note that the order of columns does not matter here.- Specified by:
getDataIndex
in 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:TableLocation
Get the column version for this location.- Specified by:
getColumnVersion
in interfaceTableLocation<LocalColumnLocation>
- Returns:
- the column version
-
makeColumnLocation
- Specified by:
makeColumnLocation
in 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
-