java.lang.Iterable<BlockListAsLongs.BlockReportReplica>@Private @Evolving public abstract class BlockListAsLongs extends java.lang.Object implements java.lang.Iterable<BlockListAsLongs.BlockReportReplica>
| Modifier and Type | Class | Description |
|---|---|---|
static class |
BlockListAsLongs.BlockReportReplica |
|
static class |
BlockListAsLongs.Builder |
| Modifier and Type | Field | Description |
|---|---|---|
static BlockListAsLongs |
EMPTY |
| Constructor | Description |
|---|---|
BlockListAsLongs() |
| Modifier and Type | Method | Description |
|---|---|---|
static BlockListAsLongs.Builder |
builder() |
|
static BlockListAsLongs.Builder |
builder(int maxDataLength) |
|
static BlockListAsLongs |
decodeBuffer(int numBlocks,
org.apache.hadoop.thirdparty.protobuf.ByteString blocksBuf,
int maxDataLength) |
Prepare an instance to in-place decode the given ByteString buffer.
|
static BlockListAsLongs |
decodeBuffers(int numBlocks,
java.util.List<org.apache.hadoop.thirdparty.protobuf.ByteString> blocksBufs) |
Prepare an instance to in-place decode the given ByteString buffers.
|
static BlockListAsLongs |
decodeBuffers(int numBlocks,
java.util.List<org.apache.hadoop.thirdparty.protobuf.ByteString> blocksBufs,
int maxDataLength) |
Prepare an instance to in-place decode the given ByteString buffers.
|
static BlockListAsLongs |
decodeLongs(java.util.List<java.lang.Long> blocksList) |
Prepare an instance to in-place decode the given list of Longs.
|
static BlockListAsLongs |
decodeLongs(java.util.List<java.lang.Long> blocksList,
int maxDataLength) |
Prepare an instance to in-place decode the given list of Longs.
|
static BlockListAsLongs |
encode(java.util.Collection<? extends Replica> replicas) |
Prepare an instance to encode the collection of replicas into an
efficient ByteString.
|
abstract long[] |
getBlockListAsLongs() |
Convert block report to old-style list of longs.
|
abstract org.apache.hadoop.thirdparty.protobuf.ByteString |
getBlocksBuffer() |
Very efficient encoding of the block report into a ByteString to avoid
the overhead of protobuf repeating fields.
|
java.util.List<org.apache.hadoop.thirdparty.protobuf.ByteString> |
getBlocksBuffers() |
List of ByteStrings that encode this block report
|
abstract int |
getNumberOfBlocks() |
The number of blocks
|
abstract java.util.Iterator<BlockListAsLongs.BlockReportReplica> |
iterator() |
Returns a singleton iterator over blocks in the block report.
|
static BlockListAsLongs |
readFrom(java.io.InputStream is,
int maxDataLength) |
|
void |
writeTo(java.io.OutputStream os) |
public static BlockListAsLongs EMPTY
public static BlockListAsLongs decodeBuffer(int numBlocks, org.apache.hadoop.thirdparty.protobuf.ByteString blocksBuf, int maxDataLength)
numBlocks - - blocks in the bufferblocksBuf - - ByteString encoded varintsmaxDataLength - - maximum allowable data size in protobuf message@VisibleForTesting public static BlockListAsLongs decodeBuffers(int numBlocks, java.util.List<org.apache.hadoop.thirdparty.protobuf.ByteString> blocksBufs)
numBlocks - - blocks in the buffersblocksBufs - - list of ByteString encoded varintspublic static BlockListAsLongs decodeBuffers(int numBlocks, java.util.List<org.apache.hadoop.thirdparty.protobuf.ByteString> blocksBufs, int maxDataLength)
numBlocks - - blocks in the buffersblocksBufs - - list of ByteString encoded varintsmaxDataLength - - maximum allowable data size in protobuf messagepublic static BlockListAsLongs decodeLongs(java.util.List<java.lang.Long> blocksList)
blocksList - - list of longspublic static BlockListAsLongs decodeLongs(java.util.List<java.lang.Long> blocksList, int maxDataLength)
blocksList - - list of longsmaxDataLength - - maximum allowable data size in protobuf message@VisibleForTesting public static BlockListAsLongs encode(java.util.Collection<? extends Replica> replicas)
replicas - - replicas to encodepublic static BlockListAsLongs readFrom(java.io.InputStream is, int maxDataLength) throws java.io.IOException
java.io.IOExceptionpublic void writeTo(java.io.OutputStream os)
throws java.io.IOException
java.io.IOException@VisibleForTesting public static BlockListAsLongs.Builder builder()
public static BlockListAsLongs.Builder builder(int maxDataLength)
public abstract int getNumberOfBlocks()
public abstract org.apache.hadoop.thirdparty.protobuf.ByteString getBlocksBuffer()
public java.util.List<org.apache.hadoop.thirdparty.protobuf.ByteString> getBlocksBuffers()
public abstract long[] getBlockListAsLongs()
public abstract java.util.Iterator<BlockListAsLongs.BlockReportReplica> iterator()
iterator in interface java.lang.Iterable<BlockListAsLongs.BlockReportReplica>Copyright © 2008–2025 Apache Software Foundation. All rights reserved.