@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PARENT_FIELD_NUMBER; hash = (53 * hash) + getParent().hashCode(); hash = (37 * hash) + TABLE_ID_FIELD_NUMBER; hash = (53 * hash) + getTableId().hashCode(); if (hasTable()) { hash = (37 * hash) + TABLE_FIELD_NUMBER; hash = (53 * hash) + getTable().hashCode(); } if (getInitialSplitsCount() > 0) { hash = (37 * hash) + INITIAL_SPLITS_FIELD_NUMBER; hash = (53 * hash) + getInitialSplitsList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
public Builder mergeFrom(com.google.bigtable.admin.v2.CreateTableRequest other) { if (other == com.google.bigtable.admin.v2.CreateTableRequest.getDefaultInstance()) return this; if (!other.getParent().isEmpty()) { parent_ = other.parent_; onChanged(); if (!other.getTableId().isEmpty()) { tableId_ = other.tableId_; onChanged(); if (other.hasTable()) { mergeTable(other.getTable());
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.bigtable.admin.v2.CreateTableRequest)) { return super.equals(obj); } com.google.bigtable.admin.v2.CreateTableRequest other = (com.google.bigtable.admin.v2.CreateTableRequest) obj; boolean result = true; result = result && getParent().equals(other.getParent()); result = result && getTableId().equals(other.getTableId()); result = result && (hasTable() == other.hasTable()); if (hasTable()) { result = result && getTable().equals(other.getTable()); } result = result && getInitialSplitsList().equals(other.getInitialSplitsList()); result = result && unknownFields.equals(other.unknownFields); return result; }
/** * * * <pre> * The name by which the new table should be referred to within the parent * instance, e.g., `foobar` rather than `<parent>/tables/foobar`. * </pre> * * <code>string table_id = 2;</code> */ public Builder clearTableId() { tableId_ = getDefaultInstance().getTableId(); onChanged(); return this; } /**
/** * * * <pre> * The unique name of the instance in which to create the table. * Values are of the form `projects/<project>/instances/<instance>`. * </pre> * * <code>string parent = 1;</code> */ public Builder clearParent() { parent_ = getDefaultInstance().getParent(); onChanged(); return this; } /**
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getParentBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); } if (!getTableIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, tableId_); } if (table_ != null) { output.writeMessage(3, getTable()); } for (int i = 0; i < initialSplits_.size(); i++) { output.writeMessage(4, initialSplits_.get(i)); } unknownFields.writeTo(output); }
@Test @SuppressWarnings("all") public void createTableTest() { TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); Table expectedResponse = Table.newBuilder().setName(name.toString()).build(); mockBigtableTableAdmin.addResponse(expectedResponse); InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); String tableId = "tableId-895419604"; Table table = Table.newBuilder().build(); Table actualResponse = client.createTable(parent, tableId, table); Assert.assertEquals(expectedResponse, actualResponse); List<GeneratedMessageV3> actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); CreateTableRequest actualRequest = (CreateTableRequest) actualRequests.get(0); Assert.assertEquals(parent, InstanceName.parse(actualRequest.getParent())); Assert.assertEquals(tableId, actualRequest.getTableId()); Assert.assertEquals(table, actualRequest.getTable()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Override public Map<String, String> extract(CreateTableRequest request) { ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); params.put("parent", String.valueOf(request.getParent())); return params.build(); } })
@java.lang.Override public com.google.bigtable.admin.v2.CreateTableRequest getDefaultInstanceForType() { return com.google.bigtable.admin.v2.CreateTableRequest.getDefaultInstance(); }
/** * * * <pre> * The Table to create. * </pre> * * <code>.google.bigtable.admin.v2.Table table = 3;</code> */ public com.google.bigtable.admin.v2.TableOrBuilder getTableOrBuilder() { return getTable(); }
/** {@inheritDoc} */ @Override public Table createTable(CreateTableRequest request) { com.google.bigtable.admin.v2.CreateTableRequest requestProto = request.toProto(instanceName.getProjectId(), instanceName.getInstanceId()); adminClient.createTable(requestProto); return getTable(requestProto.getTableId()); }
@java.lang.Override public com.google.bigtable.admin.v2.CreateTableRequest buildPartial() { com.google.bigtable.admin.v2.CreateTableRequest result = new com.google.bigtable.admin.v2.CreateTableRequest(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; result.parent_ = parent_; result.tableId_ = tableId_; if (tableBuilder_ == null) { result.table_ = table_; } else { result.table_ = tableBuilder_.build(); } if (initialSplitsBuilder_ == null) { if (((bitField0_ & 0x00000008) == 0x00000008)) { initialSplits_ = java.util.Collections.unmodifiableList(initialSplits_); bitField0_ = (bitField0_ & ~0x00000008); } result.initialSplits_ = initialSplits_; } else { result.initialSplits_ = initialSplitsBuilder_.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.admin.v2.CreateTableRequest)) { return super.equals(obj); } com.google.bigtable.admin.v2.CreateTableRequest other = (com.google.bigtable.admin.v2.CreateTableRequest) obj; boolean result = true; result = result && getParent().equals(other.getParent()); result = result && getTableId().equals(other.getTableId()); result = result && (hasTable() == other.hasTable()); if (hasTable()) { result = result && getTable().equals(other.getTable()); } result = result && getInitialSplitsList().equals(other.getInitialSplitsList()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getParentBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); } if (!getTableIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, tableId_); } if (table_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getTable()); } for (int i = 0; i < initialSplits_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, initialSplits_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
/** * <pre> * The unique name of the instance in which to create the table. * Values are of the form projects/<project>/instances/<instance> * </pre> * * <code>string parent = 1;</code> */ public Builder clearParent() { parent_ = getDefaultInstance().getParent(); onChanged(); return this; } /**
/** * <pre> * The name by which the new table should be referred to within the parent * instance, e.g. "foobar" rather than "<parent>/tables/foobar". * </pre> * * <code>string table_id = 2;</code> */ public Builder clearTableId() { tableId_ = getDefaultInstance().getTableId(); onChanged(); return this; } /**
@Override public Map<String, String> extract(CreateTableRequest request) { ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); params.put("parent", String.valueOf(request.getParent())); return params.build(); } })
.setRequestMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( com.google.bigtable.admin.v2.CreateTableRequest.getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller(
/** * <pre> * The Table to create. * </pre> * * <code>.google.bigtable.admin.v2.Table table = 3;</code> */ public com.google.bigtable.admin.v2.TableOrBuilder getTableOrBuilder() { return getTable(); }