@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 |
|---|---|
static Log |
LOG |
| Constructor and Description |
|---|
IPCUtil(Configuration conf) |
| Modifier and Type | Method and Description |
|---|---|
ByteBuffer |
buildCellBlock(Codec codec,
CompressionCodec compressor,
CellScanner cellScanner)
Puts CellScanner Cells into a cell block using passed in
codec and/or
compressor. |
ByteBuffer |
buildCellBlock(Codec codec,
CompressionCodec compressor,
CellScanner cellScanner,
BoundedByteBufferPool pool)
Puts CellScanner Cells into a cell block using passed in
codec and/or
compressor. |
CellScanner |
createCellScanner(Codec codec,
CompressionCodec compressor,
byte[] cellBlock) |
CellScanner |
createCellScanner(Codec codec,
CompressionCodec compressor,
byte[] cellBlock,
int offset,
int length) |
static ByteBuffer |
getDelimitedMessageAsByteBuffer(Message m) |
static int |
getTotalSizeWhenWrittenDelimited(Message... messages) |
static void |
readChunked(DataInput in,
byte[] dest,
int offset,
int len)
Read in chunks of 8K (HBASE-7239)
|
static int |
write(OutputStream dos,
Message header,
Message param,
ByteBuffer cellBlock)
Write out header, param, and cell block if there is one.
|
public ByteBuffer buildCellBlock(Codec codec, 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.IOExceptionpublic ByteBuffer buildCellBlock(Codec codec, 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.IOExceptionpublic CellScanner createCellScanner(Codec codec, CompressionCodec compressor, byte[] cellBlock) throws IOException
codec - cellBlock - cellBlockIOExceptionpublic CellScanner createCellScanner(Codec codec, CompressionCodec compressor, byte[] cellBlock, int offset, int length) throws IOException
codec - cellBlock - offset - length - cellBlockIOExceptionpublic static ByteBuffer getDelimitedMessageAsByteBuffer(Message m) throws IOException
m - Message to serialize delimited; i.e. w/ a vint of its size preceeding its
serialization.m is nullIOExceptionpublic static int write(OutputStream dos, Message header, Message param, ByteBuffer cellBlock) throws IOException
dos - header - param - cellBlock - IOExceptionpublic static void readChunked(DataInput in, byte[] dest, int offset, int len) throws IOException
in - dest - offset - len - IOExceptionpublic static int getTotalSizeWhenWrittenDelimited(Message... messages)