/** * Allows cloning the tags in the cell to a new byte[] * @return the byte[] having the tags */ default byte[] cloneTags() { return PrivateCellUtil.cloneTags(this); }
/** * @deprecated As of HBase-2.0. Will be removed in HBase-3.0. * Use {@link RawCell#cloneTags()} */ @Deprecated public static byte[] cloneTags(Cell cell) { return PrivateCellUtil.cloneTags(cell); }
/** * Returns tag value in a new byte array. If server-side, use {@link Tag#getValueArray()} with * appropriate {@link Tag#getValueOffset()} and {@link Tag#getValueLength()} instead to save on * allocations. * @param cell * @return tag value in a new byte array. * @deprecated As of HBase-2.0. Will be removed in HBase-3.0 */ @Deprecated public static byte[] getTagArray(Cell cell) { return PrivateCellUtil.cloneTags(cell); }
@Override public byte[] cloneTags() { if (cell instanceof RawCell) { return ((RawCell) cell).cloneTags(); } return PrivateCellUtil.cloneTags(cell); }
col.setType(kv.getType().getCode()); if (kv.getTagsLength() > 0) { col.setTags(PrivateCellUtil.cloneTags(kv));
@Override public byte[] cloneTags() { if (cell instanceof RawCell) { return ((RawCell) cell).cloneTags(); } return PrivateCellUtil.cloneTags(cell); }
/** * Allows cloning the tags in the cell to a new byte[] * @return the byte[] having the tags */ default byte[] cloneTags() { return PrivateCellUtil.cloneTags(this); }
/** * Allows cloning the tags in the cell to a new byte[] * @return the byte[] having the tags */ default byte[] cloneTags() { return PrivateCellUtil.cloneTags(this); }
@Override public byte[] cloneTags() { if (cell instanceof RawCell) { return ((RawCell) cell).cloneTags(); } return PrivateCellUtil.cloneTags(cell); }
/** * Creates a {@link TResult} (Thrift) from a {@link Result} (HBase). * * @param in the <code>Result</code> to convert * * @return converted result, returns an empty result if the input is <code>null</code> */ public static TResult resultFromHBase(Result in) { Cell[] raw = in.rawCells(); TResult out = new TResult(); byte[] row = in.getRow(); if (row != null) { out.setRow(in.getRow()); } List<TColumnValue> columnValues = new ArrayList<>(raw.length); for (Cell kv : raw) { TColumnValue col = new TColumnValue(); col.setFamily(CellUtil.cloneFamily(kv)); col.setQualifier(CellUtil.cloneQualifier(kv)); col.setTimestamp(kv.getTimestamp()); col.setValue(CellUtil.cloneValue(kv)); if (kv.getTagsLength() > 0) { col.setTags(PrivateCellUtil.cloneTags(kv)); } columnValues.add(col); } out.setColumnValues(columnValues); return out; }
/** * Creates a {@link TResult} (Thrift) from a {@link Result} (HBase). * * @param in the <code>Result</code> to convert * * @return converted result, returns an empty result if the input is <code>null</code> */ public static TResult resultFromHBase(Result in) { Cell[] raw = in.rawCells(); TResult out = new TResult(); byte[] row = in.getRow(); if (row != null) { out.setRow(in.getRow()); } List<TColumnValue> columnValues = new ArrayList<>(raw.length); for (Cell kv : raw) { TColumnValue col = new TColumnValue(); col.setFamily(CellUtil.cloneFamily(kv)); col.setQualifier(CellUtil.cloneQualifier(kv)); col.setTimestamp(kv.getTimestamp()); col.setValue(CellUtil.cloneValue(kv)); if (kv.getTagsLength() > 0) { col.setTags(PrivateCellUtil.cloneTags(kv)); } columnValues.add(col); } out.setColumnValues(columnValues); return out; }