@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.bigtable.v2.SampleRowKeysResponse)) { return super.equals(obj); } com.google.bigtable.v2.SampleRowKeysResponse other = (com.google.bigtable.v2.SampleRowKeysResponse) obj; boolean result = true; result = result && getRowKey().equals(other.getRowKey()); result = result && (getOffsetBytes() == other.getOffsetBytes()); result = result && unknownFields.equals(other.unknownFields); return result; }
private static List<KeyOffset> convert(List<SampleRowKeysResponse> rawResponse) { ImmutableList.Builder<KeyOffset> results = ImmutableList.builder(); for (SampleRowKeysResponse element : rawResponse) { results.add(KeyOffset.create(element.getRowKey(), element.getOffsetBytes())); } return results.build(); } }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + ROW_KEY_FIELD_NUMBER; hash = (53 * hash) + getRowKey().hashCode(); hash = (37 * hash) + OFFSET_BYTES_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getOffsetBytes()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * * * <pre> * Sorted streamed sequence of sample row keys in the table. The table might * have contents before the first row key in the list and after the last one, * but a key containing the empty string indicates "end of table" and will be * the last response given, if present. * Note that row keys in this list may not have ever been written to or read * from, and users should therefore not make any assumptions about the row key * structure that are specific to their use case. * </pre> * * <code>bytes row_key = 1;</code> */ public Builder clearRowKey() { rowKey_ = getDefaultInstance().getRowKey(); onChanged(); return this; }
public Builder mergeFrom(com.google.bigtable.v2.SampleRowKeysResponse other) { if (other == com.google.bigtable.v2.SampleRowKeysResponse.getDefaultInstance()) return this; if (other.getRowKey() != com.google.protobuf.ByteString.EMPTY) { setRowKey(other.getRowKey()); } if (other.getOffsetBytes() != 0L) { setOffsetBytes(other.getOffsetBytes()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.bigtable.v2.SampleRowKeysResponse)) { return super.equals(obj); } com.google.bigtable.v2.SampleRowKeysResponse other = (com.google.bigtable.v2.SampleRowKeysResponse) obj; boolean result = true; result = result && getRowKey().equals(other.getRowKey()); result = result && (getOffsetBytes() == other.getOffsetBytes()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.bigtable.v2.SampleRowKeysResponse)) { return super.equals(obj); } com.google.bigtable.v2.SampleRowKeysResponse other = (com.google.bigtable.v2.SampleRowKeysResponse) obj; boolean result = true; result = result && getRowKey() .equals(other.getRowKey()); result = result && (getOffsetBytes() == other.getOffsetBytes()); return result; }
private static List<KeyOffset> convert(List<SampleRowKeysResponse> rawResponse) { ImmutableList.Builder<KeyOffset> results = ImmutableList.builder(); for (SampleRowKeysResponse element : rawResponse) { results.add(KeyOffset.create(element.getRowKey(), element.getOffsetBytes())); } return results.build(); } }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + ROW_KEY_FIELD_NUMBER; hash = (53 * hash) + getRowKey().hashCode(); hash = (37 * hash) + OFFSET_BYTES_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getOffsetBytes()); 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) + ROW_KEY_FIELD_NUMBER; hash = (53 * hash) + getRowKey().hashCode(); hash = (37 * hash) + OFFSET_BYTES_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getOffsetBytes()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@Override public List<KeyOffset> apply(@Nonnull List<SampleRowKeysResponse> rowKeysList) { if(rowKeysList == null || rowKeysList.isEmpty()){ return Collections.EMPTY_LIST; } ImmutableList.Builder<KeyOffset> keyOffsetBuilder = ImmutableList.builderWithExpectedSize(rowKeysList.size()); for(SampleRowKeysResponse rowKeys : rowKeysList){ keyOffsetBuilder.add(KeyOffset.create(rowKeys.getRowKey(), rowKeys.getOffsetBytes())); } return keyOffsetBuilder.build(); } }, MoreExecutors.directExecutor());
/** * <pre> * Sorted streamed sequence of sample row keys in the table. The table might * have contents before the first row key in the list and after the last one, * but a key containing the empty string indicates "end of table" and will be * the last response given, if present. * Note that row keys in this list may not have ever been written to or read * from, and users should therefore not make any assumptions about the row key * structure that are specific to their use case. * </pre> * * <code>bytes row_key = 1;</code> */ public Builder clearRowKey() { rowKey_ = getDefaultInstance().getRowKey(); onChanged(); return this; }
/** * * * <pre> * Sorted streamed sequence of sample row keys in the table. The table might * have contents before the first row key in the list and after the last one, * but a key containing the empty string indicates "end of table" and will be * the last response given, if present. * Note that row keys in this list may not have ever been written to or read * from, and users should therefore not make any assumptions about the row key * structure that are specific to their use case. * </pre> * * <code>bytes row_key = 1;</code> */ public Builder clearRowKey() { rowKey_ = getDefaultInstance().getRowKey(); onChanged(); return this; }
/** * <p>adaptResponse.</p> * * @param responses a {@link java.util.List} object. * @return a {@link java.util.List} object. */ public List<HRegionLocation> adaptResponse(List<SampleRowKeysResponse> responses) { List<HRegionLocation> regions = new ArrayList<>(); // Starting by the first possible row, iterate over the sorted sampled row keys and create regions. byte[] startKey = HConstants.EMPTY_START_ROW; for (SampleRowKeysResponse response : responses) { byte[] endKey = response.getRowKey().toByteArray(); // Avoid empty regions. if (Bytes.equals(startKey, endKey)) { continue; } regions.add(createRegionLocation(startKey, endKey)); startKey = endKey; } // Create one last region if the last region doesn't reach the end or there are no regions. byte[] endKey = HConstants.EMPTY_END_ROW; if (regions.isEmpty() || !Bytes.equals(startKey, endKey)) { regions.add(createRegionLocation(startKey, endKey)); } return regions; }
public Builder mergeFrom(com.google.bigtable.v2.SampleRowKeysResponse other) { if (other == com.google.bigtable.v2.SampleRowKeysResponse.getDefaultInstance()) return this; if (other.getRowKey() != com.google.protobuf.ByteString.EMPTY) { setRowKey(other.getRowKey()); } if (other.getOffsetBytes() != 0L) { setOffsetBytes(other.getOffsetBytes()); } onChanged(); return this; }
/** * <p>adaptResponse.</p> * * @param responses a {@link java.util.List} object. * @return a {@link java.util.List} object. */ public List<HRegionLocation> adaptResponse(List<SampleRowKeysResponse> responses) { List<HRegionLocation> regions = new ArrayList<>(); // Starting by the first possible row, iterate over the sorted sampled row keys and create regions. byte[] startKey = HConstants.EMPTY_START_ROW; for (SampleRowKeysResponse response : responses) { byte[] endKey = response.getRowKey().toByteArray(); // Avoid empty regions. if (Bytes.equals(startKey, endKey)) { continue; } regions.add(createRegionLocation(startKey, endKey)); startKey = endKey; } // Create one last region if the last region doesn't reach the end or there are no regions. byte[] endKey = HConstants.EMPTY_END_ROW; if (regions.isEmpty() || !Bytes.equals(startKey, endKey)) { regions.add(createRegionLocation(startKey, endKey)); } return regions; }
public Builder mergeFrom(com.google.bigtable.v2.SampleRowKeysResponse other) { if (other == com.google.bigtable.v2.SampleRowKeysResponse.getDefaultInstance()) return this; if (other.getRowKey() != com.google.protobuf.ByteString.EMPTY) { setRowKey(other.getRowKey()); } if (other.getOffsetBytes() != 0L) { setOffsetBytes(other.getOffsetBytes()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
/** {@inheritDoc} */ @Override public List<KeyOffset> sampleRowKeys(String tableId) { String fullTableName = NameUtil .formatTableName(requestContext.getProjectId(), requestContext.getInstanceId(), tableId); SampleRowKeysRequest requestProto = SampleRowKeysRequest.newBuilder() .setTableName(fullTableName) .build(); List<SampleRowKeysResponse> responseProto = delegate.sampleRowKeys(requestProto); ImmutableList.Builder<KeyOffset> keyOffsetBuilder = ImmutableList.builderWithExpectedSize(responseProto.size()); for(SampleRowKeysResponse rowKeys : responseProto){ keyOffsetBuilder.add(KeyOffset.create(rowKeys.getRowKey(), rowKeys.getOffsetBytes())); } return keyOffsetBuilder.build(); }
ByteKey currentEndKey = makeByteKey(response.getRowKey()); long currentOffset = response.getOffsetBytes(); if (!currentStartKey.isEmpty() && currentStartKey.equals(currentEndKey)) {
ImmutableList.Builder<BigtableSource> splits = ImmutableList.builder(); for (SampleRowKeysResponse response : sampleRowKeys) { ByteKey responseEndKey = makeByteKey(response.getRowKey()); long responseOffset = response.getOffsetBytes(); checkState(