@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(); hash = (37 * hash) + ROW_KEY_FIELD_NUMBER; hash = (53 * hash) + getRowKey().hashCode(); if (getMutationsCount() > 0) { hash = (37 * hash) + MUTATIONS_FIELD_NUMBER; hash = (53 * hash) + getMutationsList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
public Builder mergeFrom(com.google.bigtable.v2.MutateRowRequest other) { if (other == com.google.bigtable.v2.MutateRowRequest.getDefaultInstance()) return this; if (!other.getTableName().isEmpty()) { tableName_ = other.tableName_; onChanged(); if (!other.getAppProfileId().isEmpty()) { appProfileId_ = other.appProfileId_; onChanged(); if (other.getRowKey() != com.google.protobuf.ByteString.EMPTY) { setRowKey(other.getRowKey());
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.bigtable.v2.MutateRowRequest)) { return super.equals(obj); } com.google.bigtable.v2.MutateRowRequest other = (com.google.bigtable.v2.MutateRowRequest) obj; boolean result = true; result = result && getTableName().equals(other.getTableName()); result = result && getAppProfileId().equals(other.getAppProfileId()); result = result && getRowKey().equals(other.getRowKey()); result = result && getMutationsList().equals(other.getMutationsList()); result = result && unknownFields.equals(other.unknownFields); return result; }
/** * * * <pre> * The key of the row to which the mutation should be applied. * </pre> * * <code>bytes row_key = 2;</code> */ public Builder clearRowKey() { rowKey_ = getDefaultInstance().getRowKey(); onChanged(); return this; }
@Test @SuppressWarnings("all") public void mutateRowTest() { MutateRowResponse expectedResponse = MutateRowResponse.newBuilder().build(); mockBigtable.addResponse(expectedResponse); TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); ByteString rowKey = ByteString.copyFromUtf8("122"); List<Mutation> mutations = new ArrayList<>(); MutateRowResponse actualResponse = client.mutateRow(tableName, rowKey, mutations); Assert.assertEquals(expectedResponse, actualResponse); List<GeneratedMessageV3> actualRequests = mockBigtable.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateRowRequest actualRequest = (MutateRowRequest) actualRequests.get(0); Assert.assertEquals(tableName, TableName.parse(actualRequest.getTableName())); Assert.assertEquals(rowKey, actualRequest.getRowKey()); Assert.assertEquals(mutations, actualRequest.getMutationsList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
if (request.getMutationsCount() == 0) { throw new IllegalArgumentException("No columns to insert"); byte[] rowkeyArray = request.getRowKey().toByteArray(); Put put = new Put(rowkeyArray); for (Mutation mutation : request.getMutationsList()) { if (mutation.getMutationCase() != MutationCase.SET_CELL) { throw new IllegalArgumentException(
public Builder mergeFrom(com.google.bigtable.v2.MutateRowRequest other) { if (other == com.google.bigtable.v2.MutateRowRequest.getDefaultInstance()) return this; if (!other.getTableName().isEmpty()) { tableName_ = other.tableName_; onChanged(); if (other.getRowKey() != com.google.protobuf.ByteString.EMPTY) { setRowKey(other.getRowKey());
private static MutateRowsRequest.Entry convert(MutateRowRequest request) { if (request == null) { return null; } else { return MutateRowsRequest.Entry.newBuilder().setRowKey(request.getRowKey()) .addAllMutations(request.getMutationsList()).build(); } }
/** {@inheritDoc} */ @Override public MutateRowResponse mutateRow(MutateRowRequest request) { if (shouldOverrideAppProfile(request.getAppProfileId())) { request = request.toBuilder().setAppProfileId(clientDefaultAppProfileId).build(); } return createUnaryListener(request, mutateRowRpc, request.getTableName()).getBlockingResult(); }
/** * * * <pre> * The unique name of the table to which the mutation should be applied. * 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; } /**
public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); }
@Test public void toProtoTestWithProvidedMutation() { Mutation mutation = Mutation.create().setCell("fake-family", "fake-qualifier", "fake-value"); RowMutation rowMutation = RowMutation.create("fake-table", "fake-key", mutation); MutateRowRequest actualRowMutation = rowMutation.toProto(REQUEST_CONTEXT); assertThat(actualRowMutation.getMutationsList()).isEqualTo(mutation.getMutations()); }
@Override public Map<String, String> extract(MutateRowRequest request) { ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); params.put("table_name", String.valueOf(request.getTableName())); return params.build(); } })
/** * * * <pre> * This value specifies routing for replication. If not specified, the * "default" application profile will be used. * </pre> * * <code>string app_profile_id = 4;</code> */ public Builder clearAppProfileId() { appProfileId_ = getDefaultInstance().getAppProfileId(); onChanged(); return this; } /**
@java.lang.Override public com.google.bigtable.v2.MutateRowRequest getDefaultInstanceForType() { return com.google.bigtable.v2.MutateRowRequest.getDefaultInstance(); }
@java.lang.Override public com.google.bigtable.v2.MutateRowRequest buildPartial() { com.google.bigtable.v2.MutateRowRequest result = new com.google.bigtable.v2.MutateRowRequest(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; result.tableName_ = tableName_; result.appProfileId_ = appProfileId_; result.rowKey_ = rowKey_; if (mutationsBuilder_ == null) { if (((bitField0_ & 0x00000008) == 0x00000008)) { mutations_ = java.util.Collections.unmodifiableList(mutations_); bitField0_ = (bitField0_ & ~0x00000008); } result.mutations_ = mutations_; } else { result.mutations_ = mutationsBuilder_.build(); } result.bitField0_ = to_bitField0_; onBuilt(); 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.MutateRowRequest)) { return super.equals(obj); } com.google.bigtable.v2.MutateRowRequest other = (com.google.bigtable.v2.MutateRowRequest) obj; boolean result = true; result = result && getTableName().equals(other.getTableName()); result = result && getAppProfileId().equals(other.getAppProfileId()); result = result && getRowKey().equals(other.getRowKey()); result = result && getMutationsList().equals(other.getMutationsList()); 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.MutateRowRequest)) { return super.equals(obj); } com.google.bigtable.v2.MutateRowRequest other = (com.google.bigtable.v2.MutateRowRequest) obj; boolean result = true; result = result && getTableName() .equals(other.getTableName()); result = result && getRowKey() .equals(other.getRowKey()); result = result && getMutationsList() .equals(other.getMutationsList()); return result; }
if (request.getMutationsCount() == 0) { throw new IllegalArgumentException("No columns to insert"); byte[] rowkeyArray = request.getRowKey().toByteArray(); Put put = new Put(rowkeyArray); for (Mutation mutation : request.getMutationsList()) { if (mutation.getMutationCase() != MutationCase.SET_CELL) { throw new IllegalArgumentException(