@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); RowIndexEncoderV1 encoder = new RowIndexEncoderV1(out, encodingCtx); RowIndexEncodingState state = new RowIndexEncodingState(); state.encoder = encoder; blkEncodingCtx.setEncodingState(state); }
public int write(Cell cell) throws IOException { // checkRow uses comparator to check we are writing in order. if (!checkRow(cell)) { if (startOffset < 0) { startOffset = out.size(); } rowsOffsetBAOS.writeInt(out.size() - startOffset); } lastCell = cell; return encoder.write(cell); }
@Override public void endBlockEncoding(HFileBlockEncodingContext encodingCtx, DataOutputStream out, byte[] uncompressedBytesWithHeader) throws IOException { RowIndexEncodingState state = (RowIndexEncodingState) encodingCtx .getEncodingState(); RowIndexEncoderV1 encoder = state.encoder; encoder.flush(); postEncoding(encodingCtx); }
@Override public int encode(Cell cell, HFileBlockEncodingContext encodingCtx, DataOutputStream out) throws IOException { RowIndexEncodingState state = (RowIndexEncodingState) encodingCtx .getEncodingState(); RowIndexEncoderV1 encoder = state.encoder; return encoder.write(cell); }
@Override public int encode(Cell cell, HFileBlockEncodingContext encodingCtx, DataOutputStream out) throws IOException { RowIndexEncodingState state = (RowIndexEncodingState) encodingCtx .getEncodingState(); RowIndexEncoderV1 encoder = state.encoder; return encoder.write(cell); }
public int write(Cell cell) throws IOException { // checkRow uses comparator to check we are writing in order. if (!checkRow(cell)) { if (startOffset < 0) { startOffset = out.size(); } rowsOffsetBAOS.writeInt(out.size() - startOffset); } lastCell = cell; return encoder.write(cell); }
@Override public void endBlockEncoding(HFileBlockEncodingContext encodingCtx, DataOutputStream out, byte[] uncompressedBytesWithHeader) throws IOException { RowIndexEncodingState state = (RowIndexEncodingState) encodingCtx .getEncodingState(); RowIndexEncoderV1 encoder = state.encoder; encoder.flush(); postEncoding(encodingCtx); }
@Override public int encode(Cell cell, HFileBlockEncodingContext encodingCtx, DataOutputStream out) throws IOException { RowIndexEncodingState state = (RowIndexEncodingState) encodingCtx .getEncodingState(); RowIndexEncoderV1 encoder = state.encoder; return encoder.write(cell); }
@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); RowIndexEncoderV1 encoder = new RowIndexEncoderV1(out, encodingCtx); RowIndexEncodingState state = new RowIndexEncodingState(); state.encoder = encoder; blkEncodingCtx.setEncodingState(state); }
public int write(Cell cell) throws IOException { // checkRow uses comparator to check we are writing in order. if (!checkRow(cell)) { if (startOffset < 0) { startOffset = out.size(); } rowsOffsetBAOS.writeInt(out.size() - startOffset); } lastCell = cell; return encoder.write(cell); }
@Override public void endBlockEncoding(HFileBlockEncodingContext encodingCtx, DataOutputStream out, byte[] uncompressedBytesWithHeader) throws IOException { RowIndexEncodingState state = (RowIndexEncodingState) encodingCtx .getEncodingState(); RowIndexEncoderV1 encoder = state.encoder; encoder.flush(); postEncoding(encodingCtx); }
@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); RowIndexEncoderV1 encoder = new RowIndexEncoderV1(out, encodingCtx); RowIndexEncodingState state = new RowIndexEncodingState(); state.encoder = encoder; blkEncodingCtx.setEncodingState(state); }