public RowIndexEncoderV1(DataOutputStream out, HFileBlockDefaultEncodingContext encodingCtx) { this.out = out; this.encoder = new NoneEncoder(out, encodingCtx); }
@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); }
@Override public int internalEncode(Cell cell, HFileBlockDefaultEncodingContext encodingContext, DataOutputStream out) throws IOException { CopyKeyEncodingState state = (CopyKeyEncodingState) encodingContext .getEncodingState(); NoneEncoder 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); NoneEncoder encoder = new NoneEncoder(out, encodingCtx); CopyKeyEncodingState state = new CopyKeyEncodingState(); 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 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); }
@Override public int internalEncode(Cell cell, HFileBlockDefaultEncodingContext encodingContext, DataOutputStream out) throws IOException { CopyKeyEncodingState state = (CopyKeyEncodingState) encodingContext .getEncodingState(); NoneEncoder encoder = state.encoder; return encoder.write(cell); }
public RowIndexEncoderV1(DataOutputStream out, HFileBlockDefaultEncodingContext encodingCtx) { this.out = out; this.encoder = new NoneEncoder(out, encodingCtx); }
@Override public int internalEncode(Cell cell, HFileBlockDefaultEncodingContext encodingContext, DataOutputStream out) throws IOException { CopyKeyEncodingState state = (CopyKeyEncodingState) encodingContext .getEncodingState(); NoneEncoder encoder = state.encoder; return encoder.write(cell); }
public RowIndexEncoderV1(DataOutputStream out, HFileBlockDefaultEncodingContext encodingCtx) { this.out = out; this.encoder = new NoneEncoder(out, encodingCtx); }
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 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); CopyKeyEncodingState state = new CopyKeyEncodingState(); 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 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); CopyKeyEncodingState state = new CopyKeyEncodingState(); state.encoder = encoder; blkEncodingCtx.setEncodingState(state); }