@Override public Map<String, String> extract(CheckConsistencyRequest request) { ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); params.put("name", String.valueOf(request.getName())); return params.build(); } })
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.bigtable.admin.v2.CheckConsistencyRequest)) { return super.equals(obj); } com.google.bigtable.admin.v2.CheckConsistencyRequest other = (com.google.bigtable.admin.v2.CheckConsistencyRequest) obj; boolean result = true; result = result && getName().equals(other.getName()); result = result && getConsistencyToken().equals(other.getConsistencyToken()); 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) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + CONSISTENCY_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getConsistencyToken().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * * * <pre> * The unique name of the Table for which to check replication consistency. * Values are of the form * `projects/<project>/instances/<instance>/tables/<table>`. * </pre> * * <code>string name = 1;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
public Builder mergeFrom(com.google.bigtable.admin.v2.CheckConsistencyRequest other) { if (other == com.google.bigtable.admin.v2.CheckConsistencyRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (!other.getConsistencyToken().isEmpty()) { consistencyToken_ = other.consistencyToken_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@Test @SuppressWarnings("all") public void checkConsistencyTest() { boolean consistent = true; CheckConsistencyResponse expectedResponse = CheckConsistencyResponse.newBuilder().setConsistent(consistent).build(); mockBigtableTableAdmin.addResponse(expectedResponse); TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); String consistencyToken = "consistencyToken-1090516718"; CheckConsistencyResponse actualResponse = client.checkConsistency(name, consistencyToken); Assert.assertEquals(expectedResponse, actualResponse); List<GeneratedMessageV3> actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); CheckConsistencyRequest actualRequest = (CheckConsistencyRequest) actualRequests.get(0); Assert.assertEquals(name, TableName.parse(actualRequest.getName())); Assert.assertEquals(consistencyToken, actualRequest.getConsistencyToken()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Override public Map<String, String> extract(CheckConsistencyRequest request) { ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); params.put("name", String.valueOf(request.getName())); return params.build(); } })
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.bigtable.admin.v2.CheckConsistencyRequest)) { return super.equals(obj); } com.google.bigtable.admin.v2.CheckConsistencyRequest other = (com.google.bigtable.admin.v2.CheckConsistencyRequest) obj; boolean result = true; result = result && getName().equals(other.getName()); result = result && getConsistencyToken().equals(other.getConsistencyToken()); 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) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + CONSISTENCY_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getConsistencyToken().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * * * <pre> * The unique name of the Table for which to check replication consistency. * Values are of the form * `projects/<project>/instances/<instance>/tables/<table>`. * </pre> * * <code>string name = 1;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
public Builder mergeFrom(com.google.bigtable.admin.v2.CheckConsistencyRequest other) { if (other == com.google.bigtable.admin.v2.CheckConsistencyRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (!other.getConsistencyToken().isEmpty()) { consistencyToken_ = other.consistencyToken_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
private boolean checkConsistency(BigtableTableName tableName, String token) { CheckConsistencyRequest request = CheckConsistencyRequest.newBuilder() .setName(tableName.toString()) .setConsistencyToken(token) .build(); return createUnaryListener(request, checkConsistencyRpc, request.getName()) .getBlockingResult() .getConsistent(); }