@Override public void write(KeyValue cell) throws IOException { //make sure we are open checkFlushed(); //write the special marker so we can figure out which kind of kv is it int marker = IndexedWALEditCodec.REGULAR_KEY_VALUE_MARKER; if (cell instanceof IndexedKeyValue) { marker = KeyValueCodec.INDEX_TYPE_LENGTH_MARKER; } out.write(marker); //then serialize based on the marker if (marker == IndexedWALEditCodec.REGULAR_KEY_VALUE_MARKER) { this.compressedKvEncoder.write(cell); } else{ KeyValueCodec.write((DataOutput) out, cell); } } }
@Override public void write(Cell cell) throws IOException { //make sure we are open checkFlushed(); //write the special marker so we can figure out which kind of kv is it int marker = IndexedWALEditCodec.REGULAR_KEY_VALUE_MARKER; if (cell instanceof IndexedKeyValue) { marker = KeyValueCodec.INDEX_TYPE_LENGTH_MARKER; } out.write(marker); //then serialize based on the marker if (marker == IndexedWALEditCodec.REGULAR_KEY_VALUE_MARKER) { this.compressedKvEncoder.write(cell); } else{ KeyValueCodec.write(this.dataOutput, PhoenixKeyValueUtil.maybeCopyCell(cell)); } } }
@Override public void write(Cell cell) throws IOException { //make sure we are open checkFlushed(); //write the special marker so we can figure out which kind of kv is it int marker = IndexedWALEditCodec.REGULAR_KEY_VALUE_MARKER; if (cell instanceof IndexedKeyValue) { marker = KeyValueCodec.INDEX_TYPE_LENGTH_MARKER; } out.write(marker); //then serialize based on the marker if (marker == IndexedWALEditCodec.REGULAR_KEY_VALUE_MARKER) { this.compressedKvEncoder.write(cell); } else{ KeyValueCodec.write(this.dataOutput, PhoenixKeyValueUtil.maybeCopyCell(cell)); } } }
@Override public Encoder getEncoder(OutputStream os) { // compression isn't on, do the default thing if (this.compression == null) { return new IndexKeyValueEncoder(os); } // compression is on, return our one that will handle putting in the correct markers Encoder encoder = super.getEncoder(os); return new CompressedIndexKeyValueEncoder(os, encoder); }
@Override public Encoder getEncoder(OutputStream os) { // compression isn't on, do the default thing if (this.compression == null) { return new IndexKeyValueEncoder(os); } // compression is on, return our one that will handle putting in the correct markers Encoder encoder = super.getEncoder(os); return new CompressedIndexKeyValueEncoder(os, encoder); }
@Override public void write(Cell cell) throws IOException { //make sure we are open checkFlushed(); //write the special marker so we can figure out which kind of kv is it int marker = IndexedWALEditCodec.REGULAR_KEY_VALUE_MARKER; if (cell instanceof IndexedKeyValue) { marker = KeyValueCodec.INDEX_TYPE_LENGTH_MARKER; } out.write(marker); //then serialize based on the marker if (marker == IndexedWALEditCodec.REGULAR_KEY_VALUE_MARKER) { this.compressedKvEncoder.write(cell); } else{ KeyValueCodec.write(this.dataOutput, PhoenixKeyValueUtil.maybeCopyCell(cell)); } } }
@Override public Encoder getEncoder(OutputStream os) { // compression isn't on, do the default thing if (this.compression == null) { return new IndexKeyValueEncoder(os); } // compression is on, return our one that will handle putting in the correct markers Encoder encoder = super.getEncoder(os); return new CompressedIndexKeyValueEncoder(os, encoder); }
@Override public Encoder getEncoder(OutputStream os) { // compression isn't on, do the default thing if (this.compression == null) { return new IndexKeyValueEncoder(os); } // compression is on, return our one that will handle putting in the correct markers Encoder encoder = super.getEncoder(os); return new CompressedIndexKeyValueEncoder(os, encoder); }