@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 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 . |
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)
|
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.
|
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 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
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)
Copyright © 2007-2015 The Apache Software Foundation. All Rights Reserved.