public abstract class HoodieDataBlock extends HoodieLogBlock
The Datablock contains: 1. Data Block version 2. Total number of records in the block 3. Actual serialized content of the records
HoodieLogBlock.FooterMetadataType, HoodieLogBlock.HeaderMetadataType, HoodieLogBlock.HoodieLogBlockContentLocation, HoodieLogBlock.HoodieLogBlockType| Modifier and Type | Field and Description |
|---|---|
protected org.apache.avro.Schema |
readerSchema |
readBlockLazily, version| Modifier | Constructor and Description |
|---|---|
|
HoodieDataBlock(List<HoodieRecord> records,
Map<HoodieLogBlock.HeaderMetadataType,String> header,
Map<HoodieLogBlock.HeaderMetadataType,String> footer,
String keyFieldName)
NOTE: This ctor is used on the write-path (ie when records ought to be written into the log)
|
protected |
HoodieDataBlock(Option<byte[]> content,
Supplier<SeekableDataInputStream> inputStreamSupplier,
boolean readBlockLazily,
Option<HoodieLogBlock.HoodieLogBlockContentLocation> blockContentLocation,
Option<org.apache.avro.Schema> readerSchema,
Map<HoodieLogBlock.HeaderMetadataType,String> headers,
Map<HoodieLogBlock.HeaderMetadataType,String> footer,
String keyFieldName,
boolean enablePointLookups)
NOTE: This ctor is used on the write-path (ie when records ought to be written into the log)
|
deflate, getBlockContentLocation, getContent, getLogBlockFooter, getLogBlockHeader, getLogBlockLength, getLogMetadata, getLogMetadataBytes, getMagic, getRecordPositions, inflate, isCompactedLogBlock, tryReadContentpublic HoodieDataBlock(List<HoodieRecord> records, Map<HoodieLogBlock.HeaderMetadataType,String> header, Map<HoodieLogBlock.HeaderMetadataType,String> footer, String keyFieldName)
protected HoodieDataBlock(Option<byte[]> content, Supplier<SeekableDataInputStream> inputStreamSupplier, boolean readBlockLazily, Option<HoodieLogBlock.HoodieLogBlockContentLocation> blockContentLocation, Option<org.apache.avro.Schema> readerSchema, Map<HoodieLogBlock.HeaderMetadataType,String> headers, Map<HoodieLogBlock.HeaderMetadataType,String> footer, String keyFieldName, boolean enablePointLookups)
public byte[] getContentBytes(HoodieStorage storage) throws IOException
getContentBytes in class HoodieLogBlockIOExceptionpublic String getKeyFieldName()
protected static org.apache.avro.Schema getWriterSchema(Map<HoodieLogBlock.HeaderMetadataType,String> logBlockHeader)
public final <T> ClosableIterator<HoodieRecord<T>> getRecordIterator(HoodieRecord.HoodieRecordType type)
public org.apache.avro.Schema getSchema()
public final <T> ClosableIterator<HoodieRecord<T>> getRecordIterator(List<String> keys, boolean fullKey, HoodieRecord.HoodieRecordType type) throws IOException
keys - keys of interest.IOException - in case of failures encountered when reading/parsing recordsprotected <T> ClosableIterator<HoodieRecord<T>> readRecordsFromBlockPayload(HoodieRecord.HoodieRecordType type) throws IOException
IOExceptionprotected <T> ClosableIterator<HoodieRecord<T>> lookupRecords(List<String> keys, boolean fullKey) throws IOException
IOExceptionprotected abstract byte[] serializeRecords(List<HoodieRecord> records, HoodieStorage storage) throws IOException
IOExceptionprotected abstract <T> ClosableIterator<HoodieRecord<T>> deserializeRecords(byte[] content, HoodieRecord.HoodieRecordType type) throws IOException
IOExceptionpublic abstract HoodieLogBlock.HoodieLogBlockType getBlockType()
getBlockType in class HoodieLogBlockprotected Option<org.apache.avro.Schema.Field> getKeyField(org.apache.avro.Schema schema)
protected Option<String> getRecordKey(HoodieRecord record)
protected org.apache.avro.Schema getSchemaFromHeader()
Copyright © 2024 The Apache Software Foundation. All rights reserved.