@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
if (RowSet.getDefaultInstance().equals(rowSet)) { rowSet = RowSet.newBuilder().addRowRanges(RowRange.getDefaultInstance()).build(); rowSet.getRowKeysList().toArray(new ByteString[rowSet.getRowKeysCount()]); RowRange[] rowRanges = rowSet.getRowRangesList().toArray(new RowRange[rowSet.getRowRangesCount()]); RowSet.Builder segment = RowSet.newBuilder(); boolean isSegmentEmpty = true; results.add(segment.build()); isSegmentEmpty = true; segment = RowSet.newBuilder(); } else if (preserveNullSegments) { results.add(null);
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + TABLE_NAME_FIELD_NUMBER; hash = (53 * hash) + getTableName().hashCode(); hash = (37 * hash) + APP_PROFILE_ID_FIELD_NUMBER; hash = (53 * hash) + getAppProfileId().hashCode(); if (hasRows()) { hash = (37 * hash) + ROWS_FIELD_NUMBER; hash = (53 * hash) + getRows().hashCode(); } if (hasFilter()) { hash = (37 * hash) + FILTER_FIELD_NUMBER; hash = (53 * hash) + getFilter().hashCode(); } hash = (37 * hash) + ROWS_LIMIT_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRowsLimit()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.bigtable.v2.RowSet)) { return super.equals(obj); } com.google.bigtable.v2.RowSet other = (com.google.bigtable.v2.RowSet) obj; boolean result = true; result = result && getRowKeysList().equals(other.getRowKeysList()); result = result && getRowRangesList().equals(other.getRowRangesList()); 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(); if (getRowKeysCount() > 0) { hash = (37 * hash) + ROW_KEYS_FIELD_NUMBER; hash = (53 * hash) + getRowKeysList().hashCode(); } if (getRowRangesCount() > 0) { hash = (37 * hash) + ROW_RANGES_FIELD_NUMBER; hash = (53 * hash) + getRowRangesList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
return originalRows; RowSet.Builder rowSetBuilder = RowSet.newBuilder(); if (originalRows.getRowKeysCount() == 0 && originalRows.getRowRangesCount() == 0) { rowSetBuilder.addRowRanges( RowRange for (ByteString key : originalRows.getRowKeysList()) { if (!startKeyIsAlreadyRead(key)) { rowSetBuilder.addRowKeys(key); for (RowRange rowRange : originalRows.getRowRangesList()) { EndKeyCase endKeyCase = rowRange.getEndKeyCase();
@java.lang.Override public com.google.bigtable.v2.RowSet getDefaultInstanceForType() { return com.google.bigtable.v2.RowSet.getDefaultInstance(); }
public static boolean isGet(ReadRowsRequest request) { RowSet rowSet = request.getRows(); return rowSet != null && rowSet.getRowRangesCount() == 0 && rowSet.getRowKeysCount() == 1; } }
/** * Adds the key in the request to a batch read. The future will be resolved when the batch response * is received. * * @param request a {@link com.google.bigtable.v2.ReadRowsRequest} with a single row key. * @return a {@link com.google.common.util.concurrent.ListenableFuture} that will be populated * with the {@link FlatRow} that corresponds to the request */ public ListenableFuture<FlatRow> add(ReadRowsRequest request) { Preconditions.checkNotNull(request); Preconditions.checkArgument(request.getRows().getRowKeysCount() == 1); ByteString rowKey = request.getRows().getRowKeysList().get(0); Preconditions.checkArgument(!rowKey.equals(ByteString.EMPTY)); final RowFilter filter = request.getFilter(); Batch batch = batches.get(filter); if (batch == null) { batch = new Batch(filter); batches.put(filter, batch); } return batch.addKey(rowKey); }
public static BigtableExtendedScan stringToScan(String encoded) throws IOException { DataInputStream dis = new DataInputStream(new ByteArrayInputStream(Base64.getDecoder().decode(encoded))); int tableLength = dis.readInt(); byte[] table = new byte[tableLength]; dis.read(table, 0, tableLength); int available = dis.available(); byte[] rowsetbytes = new byte[available]; dis.readFully(rowsetbytes); RowSet rs = RowSet.parseFrom(rowsetbytes); BigtableExtendedScan scan = new BigtableExtendedScan(); rs.getRowRangesList().forEach(scan::addRange); scan.setAttribute(Scan.SCAN_ATTRIBUTES_TABLE_NAME, table); return scan; } }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; { int dataSize = 0; for (int i = 0; i < rowKeys_.size(); i++) { dataSize += com.google.protobuf.CodedOutputStream.computeBytesSizeNoTag(rowKeys_.get(i)); } size += dataSize; size += 1 * getRowKeysList().size(); } for (int i = 0; i < rowRanges_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, rowRanges_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.bigtable.v2.ReadRowsRequest)) { return super.equals(obj); } com.google.bigtable.v2.ReadRowsRequest other = (com.google.bigtable.v2.ReadRowsRequest) obj; boolean result = true; result = result && getTableName().equals(other.getTableName()); result = result && getAppProfileId().equals(other.getAppProfileId()); result = result && (hasRows() == other.hasRows()); if (hasRows()) { result = result && getRows().equals(other.getRows()); } result = result && (hasFilter() == other.hasFilter()); if (hasFilter()) { result = result && getFilter().equals(other.getFilter()); } result = result && (getRowsLimit() == other.getRowsLimit()); 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(); if (getRowKeysCount() > 0) { hash = (37 * hash) + ROW_KEYS_FIELD_NUMBER; hash = (53 * hash) + getRowKeysList().hashCode(); } if (getRowRangesCount() > 0) { hash = (37 * hash) + ROW_RANGES_FIELD_NUMBER; hash = (53 * hash) + getRowRangesList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@Override public String toString() { ReadRowsRequest request = builder.build(); return MoreObjects.toStringHelper(this) .add("tableId", tableId) .add("keys", request.getRows().getRowKeysList()) .add("ranges", request.getRows().getRowRangesList()) .add("filter", request.getFilter()) .toString(); } }
/** * * * <pre> * The row keys and/or ranges to read. If not specified, reads from all rows. * </pre> * * <code>.google.bigtable.v2.RowSet rows = 2;</code> */ public com.google.bigtable.v2.RowSet getRows() { return rows_ == null ? com.google.bigtable.v2.RowSet.getDefaultInstance() : rows_; } /**
public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; { int dataSize = 0; for (int i = 0; i < rowKeys_.size(); i++) { dataSize += com.google.protobuf.CodedOutputStream .computeBytesSizeNoTag(rowKeys_.get(i)); } size += dataSize; size += 1 * getRowKeysList().size(); } for (int i = 0; i < rowRanges_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, rowRanges_.get(i)); } memoizedSize = size; return size; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof RowSetUtil.Split) { RowSetUtil.Split that = (RowSetUtil.Split) o; return ((this.left == null) ? (that.getLeft() == null) : this.left.equals(that.getLeft())) && ((this.right == null) ? (that.getRight() == null) : this.right.equals(that.getRight())); } return false; }
/** * * * <pre> * The row keys and/or ranges to read. If not specified, reads from all rows. * </pre> * * <code>.google.bigtable.v2.RowSet rows = 2;</code> */ public Builder mergeRows(com.google.bigtable.v2.RowSet value) { if (rowsBuilder_ == null) { if (rows_ != null) { rows_ = com.google.bigtable.v2.RowSet.newBuilder(rows_).mergeFrom(value).buildPartial(); } else { rows_ = value; } onChanged(); } else { rowsBuilder_.mergeFrom(value); } return this; } /**
if (RowSet.getDefaultInstance().equals(rowSet)) { rowSet = RowSet.newBuilder().addRowRanges(RowRange.getDefaultInstance()).build(); rowSet.getRowKeysList().toArray(new ByteString[rowSet.getRowKeysCount()]); RowRange[] rowRanges = rowSet.getRowRangesList().toArray(new RowRange[rowSet.getRowRangesCount()]); RowSet.Builder segment = RowSet.newBuilder(); boolean isSegmentEmpty = true; results.add(segment.build()); isSegmentEmpty = true; segment = RowSet.newBuilder(); } else if (preserveNullSegments) { results.add(null);
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (getRowKeysCount() > 0) { hash = (37 * hash) + ROW_KEYS_FIELD_NUMBER; hash = (53 * hash) + getRowKeysList().hashCode(); } if (getRowRangesCount() > 0) { hash = (37 * hash) + ROW_RANGES_FIELD_NUMBER; hash = (53 * hash) + getRowRangesList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }