@Private
@Evolving
public class BlockMetadataHeader
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
static short |
VERSION |
| Constructor | Description |
|---|---|
BlockMetadataHeader(short version,
org.apache.hadoop.util.DataChecksum checksum) |
| Modifier and Type | Method | Description |
|---|---|---|
org.apache.hadoop.util.DataChecksum |
getChecksum() |
Get the checksum
|
static int |
getHeaderSize() |
Returns the size of the header
|
short |
getVersion() |
Get the version
|
static BlockMetadataHeader |
preadHeader(java.nio.channels.FileChannel fc) |
Read the header without changing the position of the FileChannel.
|
static org.apache.hadoop.util.DataChecksum |
readDataChecksum(java.io.DataInputStream metaIn,
java.lang.Object name) |
Read the checksum header from the meta input stream.
|
static org.apache.hadoop.util.DataChecksum |
readDataChecksum(java.io.FileInputStream inputStream,
int bufSize,
java.io.File metaFile) |
Read the checksum header from the meta file.
|
static BlockMetadataHeader |
readHeader(java.io.DataInputStream in) |
This reads all the fields till the beginning of checksum.
|
static BlockMetadataHeader |
readHeader(java.io.FileInputStream fis) |
Reads header at the top of metadata file and returns the header.
|
static BlockMetadataHeader |
readHeader(java.io.RandomAccessFile raf) |
Read the header at the beginning of the given block meta file.
|
static void |
writeHeader(java.io.DataOutputStream out,
BlockMetadataHeader header) |
This writes all the fields till the beginning of checksum.
|
static void |
writeHeader(java.io.DataOutputStream out,
org.apache.hadoop.util.DataChecksum checksum) |
Writes all the fields till the beginning of checksum.
|
public static final short VERSION
@VisibleForTesting
public BlockMetadataHeader(short version,
org.apache.hadoop.util.DataChecksum checksum)
public short getVersion()
public org.apache.hadoop.util.DataChecksum getChecksum()
public static org.apache.hadoop.util.DataChecksum readDataChecksum(java.io.FileInputStream inputStream,
int bufSize,
java.io.File metaFile)
throws java.io.IOException
java.io.IOExceptionpublic static org.apache.hadoop.util.DataChecksum readDataChecksum(java.io.DataInputStream metaIn,
java.lang.Object name)
throws java.io.IOException
java.io.IOExceptionpublic static BlockMetadataHeader preadHeader(java.nio.channels.FileChannel fc) throws java.io.IOException
fc - The FileChannel to read.java.io.IOException - on error.public static BlockMetadataHeader readHeader(java.io.DataInputStream in) throws java.io.IOException
java.io.IOExceptionpublic static BlockMetadataHeader readHeader(java.io.FileInputStream fis) throws java.io.IOException
java.io.IOExceptionpublic static BlockMetadataHeader readHeader(java.io.RandomAccessFile raf) throws java.io.IOException
java.io.IOException@VisibleForTesting
public static void writeHeader(java.io.DataOutputStream out,
BlockMetadataHeader header)
throws java.io.IOException
out - DataOutputStreamjava.io.IOExceptionpublic static void writeHeader(java.io.DataOutputStream out,
org.apache.hadoop.util.DataChecksum checksum)
throws java.io.IOException
java.io.IOException - on errorpublic static int getHeaderSize()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.