/** * Adds split at the specified key to the configuration * * @param key */ public CreateTableRequest addSplit(ByteString key) { Preconditions.checkNotNull(key); createTableRequest.addInitialSplitsBuilder().setKey(key); return this; }
@Test public void createTable() { com.google.bigtable.admin.v2.CreateTableRequest actual = CreateTableRequest.of("tableId") .addFamily("cf1") .addFamily("cf2", GCRules.GCRULES.maxVersions(1)) .addSplit(ByteString.copyFromUtf8("c")) .toProto(PROJECT_ID, INSTANCE_ID); com.google.bigtable.admin.v2.CreateTableRequest expected = com.google.bigtable.admin.v2.CreateTableRequest.newBuilder() .setTableId("tableId") .setParent(InstanceName.of("project", "instance").toString()) .addInitialSplits(Split.newBuilder().setKey(ByteString.copyFromUtf8("c"))) .setTable( Table.newBuilder() .putColumnFamilies( "cf1", com.google.bigtable.admin.v2.ColumnFamily.newBuilder().build()) .putColumnFamilies( "cf2", com.google.bigtable.admin.v2.ColumnFamily.newBuilder() .setGcRule(GCRules.GCRULES.maxVersions(1).toProto()) .build())) .build(); assertThat(actual).isEqualTo(expected); }
/** * Adds split at the specified key to the configuration * * @param key */ public CreateTableRequest addSplit(ByteString key) { Preconditions.checkNotNull(key); createTableRequest.addInitialSplitsBuilder().setKey(key); return this; }
public Builder mergeFrom(com.google.bigtable.admin.v2.CreateTableRequest.Split other) { if (other == com.google.bigtable.admin.v2.CreateTableRequest.Split.getDefaultInstance()) return this; if (other.getKey() != com.google.protobuf.ByteString.EMPTY) { setKey(other.getKey()); } onChanged(); return this; }
public Builder mergeFrom(com.google.bigtable.admin.v2.CreateTableRequest.Split other) { if (other == com.google.bigtable.admin.v2.CreateTableRequest.Split.getDefaultInstance()) return this; if (other.getKey() != com.google.protobuf.ByteString.EMPTY) { setKey(other.getKey()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
public Builder mergeFrom(com.google.bigtable.admin.v2.CreateTableRequest.Split other) { if (other == com.google.bigtable.admin.v2.CreateTableRequest.Split.getDefaultInstance()) return this; if (other.getKey() != com.google.protobuf.ByteString.EMPTY) { setKey(other.getKey()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }