Class SegmentFileMetadata

java.lang.Object
org.apache.druid.segment.file.SegmentFileMetadata

public class SegmentFileMetadata extends Object
Consolidated metadata for a V10 segment format container file. This is built by SegmentFileBuilderV10, and is used by SegmentFileMapperV10 to do its magic to turn these file bytes into segments.

V10 file format: | version (byte) | meta compression (byte) | meta length (int) | meta json | container 0 | ... | container n |

where this class is the 'meta json' in ^ which describes the positions and possibly how to read the contents of the containers which follow and any files contained within them.

containers and files will always be present in a segment file, since a V10 segment file always contains one or more internal files which are concatenated together, organized into containers (at least as long as we use ByteBuffer... we could drop containers someday if we can shed our 2g limitation).

Optionally there will be addtional metadata about the schema and how to read these internal files if the file is a load 'entry point' (e.g. IndexIO.V10_FILE_NAME). The contents of the segment are expressed as a list of ProjectionMetadata the first entry is always the base table projection (or super-projection) of type BaseTableProjectionSchema. Additionally, a mapping of column names to ColumnDescriptor is provided which defines how to deserialize the contents of the files into a ColumnHolder. The column names here are prefixed by the projection that they belong to, as the projections defined are used to provide the structure of how the files are organized during serialization to prevent naming conflicts between projections, or even between operator defined contents such as column names and system defined data.