@@ -0,0 +1,2718 @@
+/*%0A * Copyright 2019 Google LLC%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     https://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage com.google.cloud.bigtable.data.v2.it;%0A%0Aimport static com.google.common.truth.Truth.assertThat;%0Aimport static com.google.common.truth.TruthJUnit.assume;%0A%0Aimport com.google.cloud.bigtable.data.v2.models.Query;%0Aimport com.google.cloud.bigtable.data.v2.models.Row;%0Aimport com.google.cloud.bigtable.data.v2.models.RowMutation;%0Aimport com.google.cloud.bigtable.test_helpers.env.DirectPathEnv;%0Aimport com.google.cloud.bigtable.test_helpers.env.TestEnvRule;%0Aimport com.google.protobuf.ByteString;%0Aimport java.util.Random;%0Aimport java.util.UUID;%0Aimport java.util.concurrent.TimeUnit;%0Aimport org.junit.ClassRule;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.junit.runners.JUnit4;%0A%0A@RunWith(JUnit4.class)%0Apublic class LargeRowIT %7B%0A  @ClassRule public static TestEnvRule testEnvRule = new TestEnvRule();%0A%0A  @Test%0A  public void testWriteRead() throws Exception %7B%0A    // TODO(igorbernstein2): remove this once direct path supports large messages%0A    assume().that(testEnvRule.env()).isNotInstanceOf(DirectPathEnv.class);%0A%0A    String rowKey = UUID.randomUUID().toString();%0A    String familyId = testEnvRule.env().getFamilyId();%0A%0A    byte%5B%5D largeValueBytes = new byte%5B100 * 1024 * 1024%5D;%0A    Random random = new Random();%0A    random.nextBytes(largeValueBytes);%0A    ByteString largeValue = ByteString.copyFrom(largeValueBytes);%0A%0A    // Create a 200 MB row%0A    for (int i = 0; i %3C 2; i++) %7B%0A      testEnvRule%0A          .env()%0A          .getDataClient()%0A          .mutateRowAsync(%0A              RowMutation.create(testEnvRule.env().getTableId(), rowKey)%0A                  .setCell(familyId, ByteString.copyFromUtf8(%22q%22 + i), largeValue))%0A          .get(10, TimeUnit.MINUTES);%0A    %7D%0A%0A    // Read it back%0A    Row row =%0A        testEnvRule%0A            .env()%0A            .getDataClient()%0A            .readRowsCallable()%0A            .first()%0A            .call(Query.create(testEnvRule.env().getTableId()).rowKey(rowKey));%0A%0A    assertThat(row.getCells()).hasSize(2);%0A    assertThat(row.getCells().get(0).getValue()).isEqualTo(largeValue);%0A    assertThat(row.getCells().get(1).getValue()).isEqualTo(largeValue);%0A  %7D%0A%7D%0A

Add an integration test for large rows (#6204)