@InterfaceAudience.Private public class IPCUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
IPCUtil.CellScannerButNoCodecException
Thrown if a cellscanner but no codec to encode it with.
|
Modifier and Type | Field and Description |
---|---|
private int |
cellBlockBuildingInitialBufferSize |
private int |
cellBlockDecompressionMultiplier
How much we think the decompressor will expand the original compressed content.
|
private org.apache.hadoop.conf.Configuration |
conf |
static org.apache.commons.logging.Log |
LOG |
Constructor and Description |
---|
IPCUtil(org.apache.hadoop.conf.Configuration conf) |
Modifier and Type | Method and Description |
---|---|
ByteBuffer |
buildCellBlock(Codec codec,
org.apache.hadoop.io.compress.CompressionCodec compressor,
CellScanner cellScanner)
Puts CellScanner Cells into a cell block using passed in
codec and/or
compressor . |
ByteBuffer |
buildCellBlock(Codec codec,
org.apache.hadoop.io.compress.CompressionCodec compressor,
CellScanner cellScanner,
BoundedByteBufferPool pool)
Puts CellScanner Cells into a cell block using passed in
codec and/or
compressor . |
CellScanner |
createCellScanner(Codec codec,
org.apache.hadoop.io.compress.CompressionCodec compressor,
byte[] cellBlock) |
CellScanner |
createCellScanner(Codec codec,
org.apache.hadoop.io.compress.CompressionCodec compressor,
byte[] cellBlock,
int offset,
int length) |
static ByteBuffer |
getDelimitedMessageAsByteBuffer(com.google.protobuf.Message m) |
static int |
getTotalSizeWhenWrittenDelimited(com.google.protobuf.Message... messages) |
static void |
readChunked(DataInput in,
byte[] dest,
int offset,
int len)
Read in chunks of 8K (HBASE-7239)
|
(package private) static IOException |
toIOE(Throwable t) |
static int |
write(OutputStream dos,
com.google.protobuf.Message header,
com.google.protobuf.Message param,
ByteBuffer cellBlock)
Write out header, param, and cell block if there is one.
|
private static int |
write(OutputStream dos,
com.google.protobuf.Message header,
com.google.protobuf.Message param,
ByteBuffer cellBlock,
int totalSize) |
public static final org.apache.commons.logging.Log LOG
private final int cellBlockDecompressionMultiplier
private final int cellBlockBuildingInitialBufferSize
private final org.apache.hadoop.conf.Configuration conf
public ByteBuffer buildCellBlock(Codec codec, org.apache.hadoop.io.compress.CompressionCodec compressor, CellScanner cellScanner) throws IOException
codec
and/or
compressor
.codec
- compressor
- cellScanner
- codec
and/or compressor
; the returned buffer has been
flipped and is ready for reading. Use limit to find total size.IOException
public ByteBuffer buildCellBlock(Codec codec, org.apache.hadoop.io.compress.CompressionCodec compressor, CellScanner cellScanner, BoundedByteBufferPool pool) throws IOException
codec
and/or
compressor
.codec
- compressor
- cellScanner
- pool
- Pool of ByteBuffers to make use of. Can be null and then we'll allocate
our own ByteBuffer.codec
and/or compressor
; the returned buffer has been
flipped and is ready for reading. Use limit to find total size. If pool
was not
null, then this returned ByteBuffer came from there and should be returned to the pool when
done.IOException
public CellScanner createCellScanner(Codec codec, org.apache.hadoop.io.compress.CompressionCodec compressor, byte[] cellBlock) throws IOException
codec
- cellBlock
- cellBlock
IOException
public CellScanner createCellScanner(Codec codec, org.apache.hadoop.io.compress.CompressionCodec compressor, byte[] cellBlock, int offset, int length) throws IOException
codec
- cellBlock
- offset
- length
- cellBlock
IOException
public static ByteBuffer getDelimitedMessageAsByteBuffer(com.google.protobuf.Message m) throws IOException
m
- Message to serialize delimited; i.e. w/ a vint of its size preceeding its
serialization.m
is nullIOException
public static int write(OutputStream dos, com.google.protobuf.Message header, com.google.protobuf.Message param, ByteBuffer cellBlock) throws IOException
dos
- header
- param
- cellBlock
- IOException
private static int write(OutputStream dos, com.google.protobuf.Message header, com.google.protobuf.Message param, ByteBuffer cellBlock, int totalSize) throws IOException
IOException
public static void readChunked(DataInput in, byte[] dest, int offset, int len) throws IOException
in
- dest
- offset
- len
- IOException
public static int getTotalSizeWhenWrittenDelimited(com.google.protobuf.Message... messages)
static IOException toIOE(Throwable t)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.