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);
}
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);
}
Aggregations