public abstract class HoodieLogBlock extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
HoodieLogBlock.FooterMetadataType
Log Metadata footers abstraction for a HoodieLogBlock WARNING : This enum is serialized as the ordinal.
|
static class |
HoodieLogBlock.HeaderMetadataType
Log Metadata headers abstraction for a HoodieLogBlock WARNING : This enum is serialized as the ordinal.
|
static class |
HoodieLogBlock.HoodieLogBlockContentLocation
This class is used to store the Location of the Content of a Log Block.
|
static class |
HoodieLogBlock.HoodieLogBlockType
Type of the log block WARNING: This enum is serialized as the ordinal.
|
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
readBlockLazily |
static int |
version
The current version of the log block.
|
| Constructor and Description |
|---|
HoodieLogBlock(Map<HoodieLogBlock.HeaderMetadataType,String> logBlockHeader,
Map<HoodieLogBlock.HeaderMetadataType,String> logBlockFooter,
Option<HoodieLogBlock.HoodieLogBlockContentLocation> blockContentLocation,
Option<byte[]> content,
org.apache.hadoop.fs.FSDataInputStream inputStream,
boolean readBlockLazily) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
deflate()
After the content bytes is converted into the required DataStructure by a logBlock, deflate the content to release
byte [] and relieve memory pressure when GC kicks in.
|
Option<HoodieLogBlock.HoodieLogBlockContentLocation> |
getBlockContentLocation() |
abstract HoodieLogBlock.HoodieLogBlockType |
getBlockType() |
Option<byte[]> |
getContent() |
byte[] |
getContentBytes() |
Map<HoodieLogBlock.HeaderMetadataType,String> |
getLogBlockFooter() |
Map<HoodieLogBlock.HeaderMetadataType,String> |
getLogBlockHeader() |
long |
getLogBlockLength() |
static Map<HoodieLogBlock.HeaderMetadataType,String> |
getLogMetadata(DataInputStream dis)
Convert bytes to LogMetadata, follow the same order as
getLogMetadataBytes(java.util.Map<org.apache.hudi.common.table.log.block.HoodieLogBlock.HeaderMetadataType, java.lang.String>). |
static byte[] |
getLogMetadataBytes(Map<HoodieLogBlock.HeaderMetadataType,String> metadata)
Convert log metadata to bytes 1.
|
byte[] |
getMagic() |
protected void |
inflate()
When lazyReading of blocks is turned on, inflate the content of a log block from disk.
|
static Option<byte[]> |
tryReadContent(org.apache.hadoop.fs.FSDataInputStream inputStream,
Integer contentLength,
boolean readLazily)
Read or Skip block content of a log block in the log file.
|
public static int version
HoodieLogBlockVersion TODO : Change this to a class, something
like HoodieLogBlockVersionV1/V2 and implement/override operations thereprotected boolean readBlockLazily
public HoodieLogBlock(@Nonnull Map<HoodieLogBlock.HeaderMetadataType,String> logBlockHeader, @Nonnull Map<HoodieLogBlock.HeaderMetadataType,String> logBlockFooter, @Nonnull Option<HoodieLogBlock.HoodieLogBlockContentLocation> blockContentLocation, @Nonnull Option<byte[]> content, @Nullable org.apache.hadoop.fs.FSDataInputStream inputStream, boolean readBlockLazily)
public byte[] getContentBytes()
throws IOException
IOExceptionpublic byte[] getMagic()
public abstract HoodieLogBlock.HoodieLogBlockType getBlockType()
public long getLogBlockLength()
public Option<HoodieLogBlock.HoodieLogBlockContentLocation> getBlockContentLocation()
public Map<HoodieLogBlock.HeaderMetadataType,String> getLogBlockHeader()
public Map<HoodieLogBlock.HeaderMetadataType,String> getLogBlockFooter()
public Option<byte[]> getContent()
public static byte[] getLogMetadataBytes(Map<HoodieLogBlock.HeaderMetadataType,String> metadata) throws IOException
IOExceptionpublic static Map<HoodieLogBlock.HeaderMetadataType,String> getLogMetadata(DataInputStream dis) throws IOException
getLogMetadataBytes(java.util.Map<org.apache.hudi.common.table.log.block.HoodieLogBlock.HeaderMetadataType, java.lang.String>).IOExceptionpublic static Option<byte[]> tryReadContent(org.apache.hadoop.fs.FSDataInputStream inputStream, Integer contentLength, boolean readLazily) throws IOException
HoodieMergedLogRecordScannerIOExceptionprotected void inflate()
throws HoodieIOException
HoodieIOExceptionprotected void deflate()
Copyright © 2022 The Apache Software Foundation. All rights reserved.