Class LocalColumnLocation
- All Implemented Interfaces:
com.fishlib.base.log.LogOutputAppendable
,StringUtils.StringKeyedObject
,ColumnLocation<LocalTableLocation>
,DeephavenFormatColumnLocation<LocalTableLocation>
,NamedImplementation
public class LocalColumnLocation extends AbstractColumnLocation<LocalTableLocation> implements DeephavenFormatColumnLocation<LocalTableLocation>
Implements filesystem layout for Iris DB filesystem-backed columns, relative to a LocalTableLocation.
Header format explanations: (all sizes/offsets are in bytes)
Variables:
- m = serialized metadata object size
- d = data start position
- m_h = min(d - 8, m) = size of the serialized metadata object prefix stored in the primary file's header region
- m_o = m - m_h = size of the serialized metadata object suffix stored in an overflow file (usually 0)
- e = end of file
Format for data and symbol offset files (by byte range):
- [0 - 3]: serialized metadata object size (m)
- [4 - 7]: data start position (d)
- [8 - m_h): serialized metadata object prefix
- [m_h - d): unused space
- [d - e): binary column data
Note that m and d are written in big-endian byte order. The high bit of m denotes the byte order of all subsequent data in the file, with 0 denoting big-endian byte order and 1 denoting little-endian byte order. The higher 14 bits of d should also be considered reserved - the current maximum value used is 128K (1 << 17).
Typically, the metadata object for a data file is just the partitionKeysToRange map (a Map<TYPE, int[]>) or null if the column location is not grouped. For a symbol offset file, the metadata object is typically null.
Legacy column locations may have data and symbol offset files that instead contain an instance of a DiskMappedDataColumn subclass, which in turn may contain a valid partitionKeysToRange map. ColumnFileHeaderObjectInputStream handles translation in this case.
-
Constructor Summary
Constructors Constructor Description LocalColumnLocation(LocalTableLocation tableLocation, String name)
Construct a new LocalColumnLocation for the specified LocalTableLocation and column name. -
Method Summary
Modifier and Type Method Description ByteOrder
determineHeaderByteOrder()
Read the ByteOrder for this location from the file header.boolean
exists()
Check for existence of this ColumnLocation.ByteOrder
getByteOrder()
Get theByteOrder
used by allFileDataBufferStore
s associated with this column location.File
getColumnFile(ColumnFileType columnFileType)
FileDataBufferStore
getColumnFileBufferStore(ColumnFileType columnFileType)
Get theFileDataBufferStore
for buffers from this column location for the specifiedColumnFileType
.FileAccessor
getColumnFileDataAccessor(ColumnFileType columnFileType)
int
getColumnFileDataStartPosition(ColumnFileType columnFileType)
String
getColumnFileName(ColumnFileType columnFileType)
<METADATA_TYPE>
METADATA_TYPEgetMetadata(com.illumon.dataobjects.ColumnDefinition<?> columnDefinition)
Get the metadata object stored with this column, or null if no such data exists.void
initializeColumnFile(ColumnFileType columnFileType)
Methods inherited from class com.illumon.iris.db.v2.locations.AbstractColumnLocation
getName, getTableLocation, toString
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.ColumnLocation
append, asDeephavenFormat, asParquetFormat, getFormat, getName, getStringRepresentation, getTableLocation, toStringHelper
Methods inherited from interface com.illumon.iris.db.v2.locations.DeephavenFormatColumnLocation
makeColumnRegionByte, makeColumnRegionChar, makeColumnRegionDouble, makeColumnRegionFloat, makeColumnRegionInt, makeColumnRegionLong, makeColumnRegionObject, makeColumnRegionShort
-
Constructor Details
-
LocalColumnLocation
Construct a new LocalColumnLocation for the specified LocalTableLocation and column name.- Parameters:
tableLocation
- The table location enclosing this column locationname
- The name of the column
-
-
Method Details
-
exists
public boolean exists()Description copied from interface:ColumnLocation
Check for existence of this ColumnLocation.- Specified by:
exists
in interfaceColumnLocation<LocalTableLocation>
- Returns:
- True iff the ColumnLocation actually exists
-
getByteOrder
Description copied from interface:DeephavenFormatColumnLocation
Get theByteOrder
used by allFileDataBufferStore
s associated with this column location. Invoking this method is an error for any column location ifColumnLocation.exists()
has not been invoked and returned true.- Specified by:
getByteOrder
in interfaceDeephavenFormatColumnLocation<LocalTableLocation>
- Returns:
- The
ByteOrder
-
determineHeaderByteOrder
Read the ByteOrder for this location from the file header. This is only valid forV1
column formats- Returns:
- the byte order
-
getMetadata
@Nullable public <METADATA_TYPE> METADATA_TYPE getMetadata(@NotNull com.illumon.dataobjects.ColumnDefinition<?> columnDefinition)Description copied from interface:ColumnLocation
Get the metadata object stored with this column, or null if no such data exists.
This is typically a value to range map (grouping metadata). The value to range map, if non-null, is a map from unique (boxed) column values for this location to the associated ranges in which they occur. Ranges are either 2-element int[]s, or 2-element long[]s.
- Specified by:
getMetadata
in interfaceColumnLocation<LocalTableLocation>
- Returns:
- The metadata stored with this column, or null if no such data exists
-
getColumnFileDataStartPosition
-
initializeColumnFile
-
getColumnFileName
-
getColumnFile
-
getColumnFileDataAccessor
-
getColumnFileBufferStore
@NotNull public FileDataBufferStore getColumnFileBufferStore(@NotNull ColumnFileType columnFileType)Description copied from interface:DeephavenFormatColumnLocation
Get theFileDataBufferStore
for buffers from this column location for the specifiedColumnFileType
.- Specified by:
getColumnFileBufferStore
in interfaceDeephavenFormatColumnLocation<LocalTableLocation>
- Parameters:
columnFileType
- TheColumnFileType
- Returns:
- The buffer store for the specified column file type for this column location
-