@Override public Map<String, String> extract(ReadRowsRequest request) { ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); params.put("table_name", String.valueOf(request.getTableName())); return params.build(); } })
/** * Wraps the protobuf {@link ReadRowsRequest}. * * <p>WARNING: Please note that the project id & instance id in the table name will be overwritten * by the configuration in the BigtableDataClient. */ public static Query fromProto(@Nonnull ReadRowsRequest request) { Preconditions.checkArgument(request != null, "ReadRowsRequest must not be null"); Query query = new Query(NameUtil.extractTableIdFromTableName(request.getTableName())); query.builder = request.toBuilder(); return query; }
/** * * * <pre> * The unique name of the table from which to read. * Values are of the form * `projects/<project>/instances/<instance>/tables/<table>`. * </pre> * * <code>string table_name = 1;</code> */ public Builder clearTableName() { tableName_ = getDefaultInstance().getTableName(); onChanged(); return this; } /**
@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.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; }
public Builder mergeFrom(com.google.bigtable.v2.ReadRowsRequest other) { if (other == com.google.bigtable.v2.ReadRowsRequest.getDefaultInstance()) return this; if (!other.getTableName().isEmpty()) { tableName_ = other.tableName_; onChanged(); } if (!other.getAppProfileId().isEmpty()) { appProfileId_ = other.appProfileId_; onChanged(); } if (other.hasRows()) { mergeRows(other.getRows()); } if (other.hasFilter()) { mergeFilter(other.getFilter()); } if (other.getRowsLimit() != 0L) { setRowsLimit(other.getRowsLimit()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@Override public Map<String, String> extract(ReadRowsRequest request) { ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); params.put("table_name", String.valueOf(request.getTableName())); return params.build(); } })
/** * Wraps the protobuf {@link ReadRowsRequest}. * * <p>WARNING: Please note that the project id & instance id in the table name will be overwritten * by the configuration in the BigtableDataClient. */ public static Query fromProto(@Nonnull ReadRowsRequest request) { Preconditions.checkArgument(request != null, "ReadRowsRequest must not be null"); Query query = new Query(NameUtil.extractTableIdFromTableName(request.getTableName())); query.builder = request.toBuilder(); return query; }
/** * <pre> * The unique name of the table from which to read. * Values are of the form * projects/&lt;project&gt;/instances/&lt;instance&gt;/tables/&lt;table&gt; * </pre> * * <code>string table_name = 1;</code> */ public Builder clearTableName() { tableName_ = getDefaultInstance().getTableName(); onChanged(); return this; } /**
/** * * * <pre> * The unique name of the table from which to read. * Values are of the form * `projects/<project>/instances/<instance>/tables/<table>`. * </pre> * * <code>string table_name = 1;</code> */ public Builder clearTableName() { tableName_ = getDefaultInstance().getTableName(); onChanged(); return this; } /**
/** {@inheritDoc} */ @Override public ListenableFuture<List<FlatRow>> readFlatRowsAsync(ReadRowsRequest request) { if (shouldOverrideAppProfile(request.getAppProfileId())) { request = request.toBuilder().setAppProfileId(clientDefaultAppProfileId).build(); } return Futures.transform( createStreamingListener(request, readRowsAsync, request.getTableName()).getAsyncResult(), FLAT_ROW_LIST_TRANSFORMER, MoreExecutors.directExecutor()); }
private RetryingReadRowsOperation createReadRowsRetryListener(ReadRowsRequest request, StreamObserver<FlatRow> observer) { return new RetryingReadRowsOperation( observer, retryOptions, request, readRowsAsync, getCallOptions(readRowsAsync.getMethodDescriptor(), request), retryExecutorService, createMetadata(request.getTableName()), CLOCK); }
/** {@inheritDoc} */ @Override public ListenableFuture<List<Row>> readRowsAsync(ReadRowsRequest request) { if (shouldOverrideAppProfile(request.getAppProfileId())) { request = request.toBuilder().setAppProfileId(clientDefaultAppProfileId).build(); } return Futures.transform( createStreamingListener(request, readRowsAsync, request.getTableName()).getAsyncResult(), ROW_LIST_TRANSFORMER, MoreExecutors.directExecutor()); }
@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(); 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 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; }
/** {@inheritDoc} */ @Override public List<FlatRow> readFlatRowsList(ReadRowsRequest request) { if (shouldOverrideAppProfile(request.getAppProfileId())) { request = request.toBuilder().setAppProfileId(clientDefaultAppProfileId).build(); } return FLAT_ROW_LIST_TRANSFORMER.apply( createStreamingListener(request, readRowsAsync, request.getTableName()).getBlockingResult()); }
@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; }
public Builder mergeFrom(com.google.bigtable.v2.ReadRowsRequest other) { if (other == com.google.bigtable.v2.ReadRowsRequest.getDefaultInstance()) return this; if (!other.getTableName().isEmpty()) { tableName_ = other.tableName_; onChanged(); } if (other.hasRows()) { mergeRows(other.getRows()); } if (other.hasFilter()) { mergeFilter(other.getFilter()); } if (other.getRowsLimit() != 0L) { setRowsLimit(other.getRowsLimit()); } onChanged(); return this; }
public Builder mergeFrom(com.google.bigtable.v2.ReadRowsRequest other) { if (other == com.google.bigtable.v2.ReadRowsRequest.getDefaultInstance()) return this; if (!other.getTableName().isEmpty()) { tableName_ = other.tableName_; onChanged(); } if (!other.getAppProfileId().isEmpty()) { appProfileId_ = other.appProfileId_; onChanged(); } if (other.hasRows()) { mergeRows(other.getRows()); } if (other.hasFilter()) { mergeFilter(other.getFilter()); } if (other.getRowsLimit() != 0L) { setRowsLimit(other.getRowsLimit()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
ReadRowsRequest buildUpdatedRequest() { ReadRowsRequest.Builder newRequest = ReadRowsRequest.newBuilder() .setRows(filterRows()) .setTableName(originalRequest.getTableName()) .setAppProfileId(originalRequest.getAppProfileId()); if (originalRequest.hasFilter()) { newRequest.setFilter(originalRequest.getFilter()); } // If the row limit is set, update it. long numRowsLimit = originalRequest.getRowsLimit(); if (numRowsLimit > 0) { // Updates the {@code numRowsLimit} by removing the number of rows already read. numRowsLimit -= rowCount; checkArgument(numRowsLimit > 0, "The remaining number of rows must be greater than 0."); newRequest.setRowsLimit(numRowsLimit); } return newRequest.build(); }