Search in sources :

Example 1 with NoneEncoder

use of org.apache.hadoop.hbase.io.encoding.NoneEncoder in project hbase by apache.

the class NoOpDataBlockEncoder method encode.

@Override
public int encode(Cell cell, HFileBlockEncodingContext encodingCtx, DataOutputStream out) throws IOException {
    NoneEncodingState state = (NoneEncodingState) encodingCtx.getEncodingState();
    NoneEncoder encoder = state.encoder;
    return encoder.write(cell);
}
Also used : NoneEncoder(org.apache.hadoop.hbase.io.encoding.NoneEncoder)

Example 2 with NoneEncoder

use of org.apache.hadoop.hbase.io.encoding.NoneEncoder in project hbase by apache.

the class NoOpDataBlockEncoder method startBlockEncoding.

@Override
public void startBlockEncoding(HFileBlockEncodingContext blkEncodingCtx, DataOutputStream out) throws IOException {
    if (blkEncodingCtx.getClass() != HFileBlockDefaultEncodingContext.class) {
        throw new IOException(this.getClass().getName() + " only accepts " + HFileBlockDefaultEncodingContext.class.getName() + " as the " + "encoding context.");
    }
    HFileBlockDefaultEncodingContext encodingCtx = (HFileBlockDefaultEncodingContext) blkEncodingCtx;
    encodingCtx.prepareEncoding(out);
    NoneEncoder encoder = new NoneEncoder(out, encodingCtx);
    NoneEncodingState state = new NoneEncodingState();
    state.encoder = encoder;
    blkEncodingCtx.setEncodingState(state);
}
Also used : HFileBlockDefaultEncodingContext(org.apache.hadoop.hbase.io.encoding.HFileBlockDefaultEncodingContext) IOException(java.io.IOException) NoneEncoder(org.apache.hadoop.hbase.io.encoding.NoneEncoder)

Aggregations

NoneEncoder (org.apache.hadoop.hbase.io.encoding.NoneEncoder)2 IOException (java.io.IOException)1 HFileBlockDefaultEncodingContext (org.apache.hadoop.hbase.io.encoding.HFileBlockDefaultEncodingContext)1