@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.bigtable.v2.Row)) { return super.equals(obj); } com.google.bigtable.v2.Row other = (com.google.bigtable.v2.Row) obj; boolean result = true; result = result && getKey().equals(other.getKey()); result = result && getFamiliesList().equals(other.getFamiliesList()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
@java.lang.Override public com.google.bigtable.v2.Row buildPartial() { com.google.bigtable.v2.Row result = new com.google.bigtable.v2.Row(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; result.key_ = key_; if (familiesBuilder_ == null) { if (((bitField0_ & 0x00000002) == 0x00000002)) { families_ = java.util.Collections.unmodifiableList(families_); bitField0_ = (bitField0_ & ~0x00000002); } result.families_ = families_; } else { result.families_ = familiesBuilder_.build(); } result.bitField0_ = to_bitField0_; onBuilt(); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + KEY_FIELD_NUMBER; hash = (53 * hash) + getKey().hashCode(); if (getFamiliesCount() > 0) { hash = (37 * hash) + FAMILIES_FIELD_NUMBER; hash = (53 * hash) + getFamiliesList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * * * <pre> * The unique key which identifies this row within its table. This is the same * key that's used to identify the row in, for example, a MutateRowRequest. * May contain any non-empty byte string up to 4KiB in length. * </pre> * * <code>bytes key = 1;</code> */ public Builder clearKey() { key_ = getDefaultInstance().getKey(); onChanged(); return this; }
@Override public boolean advance() throws IOException { boolean hasRecord = (reader.advance() && rangeTracker.tryReturnRecordAt( true, makeByteKey(reader.getCurrentRow().getKey()))) || rangeTracker.markDone(); if (hasRecord) { ++recordsReturned; } return hasRecord; }
/** Helper function to get a table's data. */ private List<KV<ByteString, ByteString>> getTableData(String tableName) throws IOException { // Add empty range to avoid TARGET_NOT_SET error RowRange range = RowRange.newBuilder() .setStartKeyClosed(ByteString.EMPTY) .setEndKeyOpen(ByteString.EMPTY) .build(); RowSet rowSet = RowSet.newBuilder().addRowRanges(range).build(); ReadRowsRequest.Builder readRowsRequestBuilder = ReadRowsRequest.newBuilder().setTableName(tableName).setRows(rowSet); ResultScanner<Row> scanner = session.getDataClient().readRows(readRowsRequestBuilder.build()); Row currentRow; List<KV<ByteString, ByteString>> tableData = new ArrayList<>(); while ((currentRow = scanner.next()) != null) { ByteString key = currentRow.getKey(); ByteString value = currentRow.getFamilies(0).getColumns(0).getCells(0).getValue(); tableData.add(KV.of(key, value)); } scanner.close(); return tableData; }
for (final Family family : row.getFamiliesList()) { if (Arrays.equals(family.getNameBytes().toByteArray(), columnFamilyBytes)) { for (final Column column : family.getColumnsList()) {
/** * * * <pre> * A Row containing the new contents of all cells modified by the request. * </pre> * * <code>.google.bigtable.v2.Row row = 1;</code> */ public com.google.bigtable.v2.Row getRow() { return row_ == null ? com.google.bigtable.v2.Row.getDefaultInstance() : row_; } /**
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.bigtable.v2.ReadModifyWriteRowResponse)) { return super.equals(obj); } com.google.bigtable.v2.ReadModifyWriteRowResponse other = (com.google.bigtable.v2.ReadModifyWriteRowResponse) obj; boolean result = true; result = result && (hasRow() == other.hasRow()); if (hasRow()) { result = result && getRow().equals(other.getRow()); } result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + KEY_FIELD_NUMBER; hash = (53 * hash) + getKey().hashCode(); if (getFamiliesCount() > 0) { hash = (37 * hash) + FAMILIES_FIELD_NUMBER; hash = (53 * hash) + getFamiliesList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
public Builder mergeFrom(com.google.bigtable.v2.Row other) { if (other == com.google.bigtable.v2.Row.getDefaultInstance()) return this; if (other.getKey() != com.google.protobuf.ByteString.EMPTY) { setKey(other.getKey());
private static List<Row> filterToRanges(List<Row> rows, final List<ByteKeyRange> ranges) { return Lists.newArrayList( rows.stream() .filter( input -> { verifyNotNull(input, "input"); for (ByteKeyRange range : ranges) { if (range.containsKey(makeByteKey(input.getKey()))) { return true; } } return false; }) .collect(Collectors.toList())); }
new HashMap<String, ByteIterator>(fields != null ? fields.size() : 10); for (final Family family : row.getFamiliesList()) { if (Arrays.equals(family.getNameBytes().toByteArray(), columnFamilyBytes)) { for (final Column column : family.getColumnsList()) {
@java.lang.Override public com.google.bigtable.v2.Row getDefaultInstanceForType() { return com.google.bigtable.v2.Row.getDefaultInstance(); }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.bigtable.v2.ReadModifyWriteRowResponse)) { return super.equals(obj); } com.google.bigtable.v2.ReadModifyWriteRowResponse other = (com.google.bigtable.v2.ReadModifyWriteRowResponse) obj; boolean result = true; result = result && (hasRow() == other.hasRow()); if (hasRow()) { result = result && getRow().equals(other.getRow()); } result = result && unknownFields.equals(other.unknownFields); return result; }
private Row convertResponse(ReadModifyWriteRowResponse response) { ImmutableList.Builder<RowCell> cells = ImmutableList.builder(); for (Family family : response.getRow().getFamiliesList()) { for (Column column : family.getColumnsList()) { for (Cell cell : column.getCellsList()) { cells.add( RowCell.create( family.getName(), column.getQualifier(), cell.getTimestampMicros(), cell.getLabelsList(), cell.getValue())); } } } return Row.create(response.getRow().getKey(), cells.build()); } }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + KEY_FIELD_NUMBER; hash = (53 * hash) + getKey().hashCode(); if (getFamiliesCount() > 0) { hash = (37 * hash) + FAMILIES_FIELD_NUMBER; hash = (53 * hash) + getFamiliesList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * <pre> * The unique key which identifies this row within its table. This is the same * key that's used to identify the row in, for example, a MutateRowRequest. * May contain any non-empty byte string up to 4KiB in length. * </pre> * * <code>bytes key = 1;</code> */ public Builder clearKey() { key_ = getDefaultInstance().getKey(); onChanged(); return this; }
@Override public boolean start() throws IOException { reader = service.createReader(getCurrentSource()); boolean hasRecord = (reader.start() && rangeTracker.tryReturnRecordAt( true, makeByteKey(reader.getCurrentRow().getKey()))) || rangeTracker.markDone(); if (hasRecord) { ++recordsReturned; } return hasRecord; }