.setFamily(LABELS_TABLE_FAMILY) .setQualifier(LABEL_QUALIFIER) .setTimestamp(p.getTimestamp()) .setType(Type.Put) .setValue(label)
public static Cell toCell(ExtendedCellBuilder cellBuilder, final CellProtos.Cell cell) { return cellBuilder.clear() .setRow(cell.getRow().toByteArray()) .setFamily(cell.getFamily().toByteArray()) .setQualifier(cell.getQualifier().toByteArray()) .setTimestamp(cell.getTimestamp()) .setType((byte) cell.getCellType().getNumber()) .setValue(cell.getValue().toByteArray()) .build(); }
/** * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0. Use {@link CellBuilder} * instead */ @Deprecated public static Cell createCell(final byte[] row, final byte[] family, final byte[] qualifier, final long timestamp, final byte type, final byte[] value) { return ExtendedCellBuilderFactory.create(CellBuilderType.DEEP_COPY) .setRow(row) .setFamily(family) .setQualifier(qualifier) .setTimestamp(timestamp) .setType(type) .setValue(value) .build(); }
.setFamily(LABELS_TABLE_FAMILY) .setQualifier(user) .setTimestamp(p.getTimestamp()) .setType(Cell.Type.Put) .setValue(DUMMY_VALUE)
/** * Creates a cell with deep copy of all passed bytes. * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0. Use {@link CellBuilder} * instead */ @Deprecated public static Cell createCell(final byte[] rowArray, final int rowOffset, final int rowLength, final byte[] familyArray, final int familyOffset, final int familyLength, final byte[] qualifierArray, final int qualifierOffset, final int qualifierLength) { // See createCell(final byte [] row, final byte [] value) for why we default Maximum type. return ExtendedCellBuilderFactory.create(CellBuilderType.DEEP_COPY) .setRow(rowArray, rowOffset, rowLength) .setFamily(familyArray, familyOffset, familyLength) .setQualifier(qualifierArray, qualifierOffset, qualifierLength) .setTimestamp(HConstants.LATEST_TIMESTAMP) .setType(KeyValue.Type.Maximum.getCode()) .setValue(HConstants.EMPTY_BYTE_ARRAY, 0, HConstants.EMPTY_BYTE_ARRAY.length) .build(); }
/** * Marked as audience Private as of 1.2.0. * Creating a Cell with tags and a memstoreTS/mvcc is an * internal implementation detail not for public use. * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0. Use * {@link ExtendedCellBuilder} instead */ @InterfaceAudience.Private @Deprecated public static Cell createCell(final byte[] row, final byte[] family, final byte[] qualifier, final long timestamp, final byte type, final byte[] value, byte[] tags, final long memstoreTS) { return ExtendedCellBuilderFactory.create(CellBuilderType.DEEP_COPY) .setRow(row) .setFamily(family) .setQualifier(qualifier) .setTimestamp(timestamp) .setType(type) .setValue(value) .setTags(tags) .setSequenceId(memstoreTS) .build(); }
.setFamily(WALEdit.METAFAMILY) .setQualifier(WALEdit.BULK_LOAD) .setTimestamp(cell.getTimestamp()) .setType(cell.getTypeByte()) .setValue(newBulkLoadDescriptor.toByteArray())
.setQualifier(reference.getQualifierArray(), reference.getQualifierOffset(), reference.getQualifierLength()) .setTimestamp(reference.getTimestamp()) .setType(reference.getTypeByte()) .setValue(HConstants.EMPTY_BYTE_ARRAY)
public static Cell toCell(ExtendedCellBuilder cellBuilder, byte[] row, TColumnValue columnValue) { return cellBuilder.clear() .setRow(row) .setFamily(columnValue.getFamily()) .setQualifier(columnValue.getQualifier()) .setTimestamp(columnValue.getTimestamp()) .setType(columnValue.getType()) .setValue(columnValue.getValue()) .setTags(columnValue.getTags()) .build(); }
private static Cell reckonDelta(final Cell delta, final Cell currentCell, final byte[] columnFamily, final long now, Mutation mutation, Function<Cell, byte[]> supplier) throws IOException { // Forward any tags found on the delta. List<Tag> tags = TagUtil.carryForwardTags(delta); tags = TagUtil.carryForwardTTLTag(tags, mutation.getTTL()); if (currentCell != null) { tags = TagUtil.carryForwardTags(tags, currentCell); byte[] newValue = supplier.apply(currentCell); return ExtendedCellBuilderFactory.create(CellBuilderType.SHALLOW_COPY) .setRow(mutation.getRow(), 0, mutation.getRow().length) .setFamily(columnFamily, 0, columnFamily.length) // copy the qualifier if the cell is located in shared memory. .setQualifier(CellUtil.cloneQualifier(delta)) .setTimestamp(Math.max(currentCell.getTimestamp() + 1, now)) .setType(KeyValue.Type.Put.getCode()) .setValue(newValue, 0, newValue.length) .setTags(TagUtil.fromList(tags)) .build(); } else { PrivateCellUtil.updateLatestStamp(delta, now); return CollectionUtils.isEmpty(tags) ? delta : PrivateCellUtil.createCell(delta, tags); } }
@Override protected Cell parseCell() throws IOException { byte [] row = readByteArray(this.in); byte [] family = readByteArray(in); byte [] qualifier = readByteArray(in); byte [] longArray = new byte[Bytes.SIZEOF_LONG]; IOUtils.readFully(this.in, longArray); long timestamp = Bytes.toLong(longArray); byte type = (byte) this.in.read(); byte[] value = readByteArray(in); // Read memstore version byte[] memstoreTSArray = new byte[Bytes.SIZEOF_LONG]; IOUtils.readFully(this.in, memstoreTSArray); long memstoreTS = Bytes.toLong(memstoreTSArray); return cellBuilder.clear() .setRow(row) .setFamily(family) .setQualifier(qualifier) .setTimestamp(timestamp) .setType(type) .setValue(value) .setSequenceId(memstoreTS) .build(); }
.setFamily(family) .setQualifier(qv.hasQualifier() ? qv.getQualifier().toByteArray() : null) .setTimestamp(ts) .setType(fromDeleteType(qv.getDeleteType()).getCode()) .setTags(allTagsBytes) .setFamily(family) .setQualifier(qv.hasQualifier() ? qv.getQualifier().toByteArray() : null) .setTimestamp(ts) .setType(Cell.Type.Put) .setValue(qv.hasValue() ? qv.getValue().toByteArray() : null) .setFamily(family) .setQualifier(qv.hasQualifier() ? qv.getQualifier().toByteArray() : null) .setTimestamp(ts) .setType(fromDeleteType(qv.getDeleteType()).getCode()) .build()); .setFamily(family) .setQualifier(qv.hasQualifier() ? qv.getQualifier().toByteArray() : null) .setTimestamp(ts) .setType(Type.Put) .setValue(qv.hasValue() ? qv.getValue().toByteArray() : null)
@Override protected Cell parseCell() throws IOException { byte[] row = readByteArray(this.in); byte[] family = readByteArray(in); byte[] qualifier = readByteArray(in); byte[] longArray = new byte[Bytes.SIZEOF_LONG]; IOUtils.readFully(this.in, longArray); long timestamp = Bytes.toLong(longArray); byte type = (byte) this.in.read(); byte[] value = readByteArray(in); byte[] tags = readByteArray(in); // Read memstore version byte[] memstoreTSArray = new byte[Bytes.SIZEOF_LONG]; IOUtils.readFully(this.in, memstoreTSArray); long memstoreTS = Bytes.toLong(memstoreTSArray); return cellBuilder.clear() .setRow(row) .setFamily(family) .setQualifier(qualifier) .setTimestamp(timestamp) .setType(type) .setValue(value) .setSequenceId(memstoreTS) .setTags(tags) .build(); }
public static Cell toCell(ExtendedCellBuilder cellBuilder, final CellProtos.Cell cell) { return cellBuilder.clear() .setRow(cell.getRow().toByteArray()) .setFamily(cell.getFamily().toByteArray()) .setQualifier(cell.getQualifier().toByteArray()) .setTimestamp(cell.getTimestamp()) .setType((byte) cell.getCellType().getNumber()) .setValue(cell.getValue().toByteArray()) .build(); }
.setFamily(family) .setQualifier(qv.hasQualifier() ? qv.getQualifier().toByteArray() : null) .setTimestamp(ts) .setType(fromDeleteType(qv.getDeleteType()).getCode()) .setTags(allTagsBytes) .setFamily(family) .setQualifier(qv.hasQualifier() ? qv.getQualifier().toByteArray() : null) .setTimestamp(ts) .setType(Cell.Type.Put) .setValue(qv.hasValue() ? qv.getValue().toByteArray() : null) .setFamily(family) .setQualifier(qv.hasQualifier() ? qv.getQualifier().toByteArray() : null) .setTimestamp(ts) .setType(fromDeleteType(qv.getDeleteType()).getCode()) .build()); .setFamily(family) .setQualifier(qv.hasQualifier() ? qv.getQualifier().toByteArray() : null) .setTimestamp(ts) .setType(Type.Put) .setValue(qv.hasValue() ? qv.getValue().toByteArray() : null)
private Cell newCellWithNotExistColumnFamily(Cell cell) { return ExtendedCellBuilderFactory.create(CellBuilderType.SHALLOW_COPY) .setRow(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength()) .setFamily(CF_NOT_EXIST_BYTES, 0, CF_NOT_EXIST_BYTES.length) .setQualifier(CellUtil.cloneQualifier(cell)).setTimestamp(cell.getTimestamp()) .setType(cell.getType().getCode()).setValue(CellUtil.cloneValue(cell)).build(); }
private Cell newCellWithDifferentColumnFamily(Cell cell) { return ExtendedCellBuilderFactory.create(CellBuilderType.SHALLOW_COPY) .setRow(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength()) .setFamily(CF2_BYTES, 0, CF2_BYTES.length).setQualifier(CellUtil.cloneQualifier(cell)) .setTimestamp(cell.getTimestamp()).setType(cell.getType().getCode()) .setValue(CellUtil.cloneValue(cell)).build(); }
.setFamily(family) .setQualifier(qualifier) .setTimestamp(qv.getTimestamp()) .setType(KeyValue.Type.Put.getCode()) .setValue(value)
public static Cell toCell(ExtendedCellBuilder cellBuilder, final CellProtos.Cell cell) { return cellBuilder.clear() .setRow(cell.getRow().toByteArray()) .setFamily(cell.getFamily().toByteArray()) .setQualifier(cell.getQualifier().toByteArray()) .setTimestamp(cell.getTimestamp()) .setType((byte) cell.getCellType().getNumber()) .setValue(cell.getValue().toByteArray()) .build(); }
public static Cell toCell(ExtendedCellBuilder cellBuilder, final CellProtos.Cell cell) { return cellBuilder.clear() .setRow(cell.getRow().toByteArray()) .setFamily(cell.getFamily().toByteArray()) .setQualifier(cell.getQualifier().toByteArray()) .setTimestamp(cell.getTimestamp()) .setType((byte) cell.getCellType().getNumber()) .setValue(cell.getValue().toByteArray()) .build(); }