Skip to content

Commit

Permalink
Run format
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Greco committed Oct 31, 2023
1 parent 52cb39e commit 9e8506e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,15 @@ public static void beforeClass() throws IOException {
DatasetInfo.newBuilder(/* datasetId = */ DATASET).setDescription(DESCRIPTION).build();
bigquery.create(datasetInfo);
LOG.info("Created test dataset: " + DATASET);
TableInfo tableInfo = TableInfo.newBuilder(
TableId.of(DATASET, TABLE),
StandardTableDefinition.of(
Schema.of(
Field.newBuilder("foo", LegacySQLTypeName.STRING)
.setMode(Field.Mode.NULLABLE)
.build())))
.build();
TableInfo tableInfo =
TableInfo.newBuilder(
TableId.of(DATASET, TABLE),
StandardTableDefinition.of(
Schema.of(
Field.newBuilder("foo", LegacySQLTypeName.STRING)
.setMode(Field.Mode.NULLABLE)
.build())))
.build();
bigquery.create(tableInfo);
}

Expand All @@ -100,12 +101,8 @@ public static void afterClass() {

@Test
public void testJsonStreamWriterCommittedStreamWithNonQuotaRetry()
throws IOException, InterruptedException,
DescriptorValidationException {
RetrySettings retrySettings =
RetrySettings.newBuilder()
.setMaxAttempts(5)
.build();
throws IOException, InterruptedException, DescriptorValidationException {
RetrySettings retrySettings = RetrySettings.newBuilder().setMaxAttempts(5).build();
String tableName = "CommittedRetry";
TableId tableId = TableId.of(DATASET, tableName);
Field col1 = Field.newBuilder("col1", StandardSQLTypeName.STRING).build();
Expand All @@ -123,8 +120,7 @@ public void testJsonStreamWriterCommittedStreamWithNonQuotaRetry()
.build());
int totalRequest = 901;
int rowBatch = 1;
ArrayList<ApiFuture<AppendRowsResponse>> allResponses =
new ArrayList<>(totalRequest);
ArrayList<ApiFuture<AppendRowsResponse>> allResponses = new ArrayList<>(totalRequest);
try (JsonStreamWriter jsonStreamWriter =
JsonStreamWriter.newBuilder(writeStream.getName(), writeStream.getTableSchema())
.setRetrySettings(retrySettings)
Expand Down Expand Up @@ -155,8 +151,7 @@ public void testJsonStreamWriterCommittedStreamWithNonQuotaRetry()

@Test
public void testJsonStreamWriterDefaultStreamWithNonQuotaRetry()
throws IOException, InterruptedException,
DescriptorValidationException {
throws IOException, InterruptedException, DescriptorValidationException {
RetrySettings retrySettings =
RetrySettings.newBuilder()
.setInitialRetryDelay(Duration.ofMillis(500))
Expand All @@ -176,19 +171,15 @@ public void testJsonStreamWriterDefaultStreamWithNonQuotaRetry()
TableInfo.newBuilder(
TableId.of(DATASET, tableName),
StandardTableDefinition.of(
Schema.of(
Field.newBuilder(
"test_str", StandardSQLTypeName.STRING)
.build())))
Schema.of(Field.newBuilder("test_str", StandardSQLTypeName.STRING).build())))
.build();

bigquery.create(tableInfo);
TableName parent = TableName.of(NON_QUOTA_RETRY_PROJECT_ID, DATASET, tableName);

int totalRequest = 901;
int rowBatch = 1;
ArrayList<ApiFuture<AppendRowsResponse>> allResponses =
new ArrayList<>(totalRequest);
ArrayList<ApiFuture<AppendRowsResponse>> allResponses = new ArrayList<>(totalRequest);
try (JsonStreamWriter jsonStreamWriter =
JsonStreamWriter.newBuilder(parent.toString(), tableSchema)
.setIgnoreUnknownFields(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@

/** Integration tests for BigQuery Write API. */
public class ITBigQueryWriteQuotaRetryTest {
private static final Logger LOG =
Logger.getLogger(ITBigQueryWriteQuotaRetryTest.class.getName());
private static final Logger LOG = Logger.getLogger(ITBigQueryWriteQuotaRetryTest.class.getName());
private static final String DATASET = RemoteBigQueryHelper.generateDatasetName();
private static final String TABLE = "testtable";
private static final String DESCRIPTION = "BigQuery Write Java manual client test dataset";
Expand All @@ -74,14 +73,15 @@ public static void beforeClass() throws IOException {
DatasetInfo.newBuilder(/* datasetId = */ DATASET).setDescription(DESCRIPTION).build();
bigquery.create(datasetInfo);
LOG.info("Created test dataset: " + DATASET);
TableInfo tableInfo = TableInfo.newBuilder(
TableId.of(DATASET, TABLE),
StandardTableDefinition.of(
Schema.of(
Field.newBuilder("foo", LegacySQLTypeName.STRING)
.setMode(Field.Mode.NULLABLE)
.build())))
.build();
TableInfo tableInfo =
TableInfo.newBuilder(
TableId.of(DATASET, TABLE),
StandardTableDefinition.of(
Schema.of(
Field.newBuilder("foo", LegacySQLTypeName.STRING)
.setMode(Field.Mode.NULLABLE)
.build())))
.build();
bigquery.create(tableInfo);
}

Expand All @@ -99,8 +99,7 @@ public static void afterClass() {

@Test
public void testJsonStreamWriterCommittedStreamWithNonQuotaRetry()
throws IOException, InterruptedException,
DescriptorValidationException {
throws IOException, InterruptedException, DescriptorValidationException {
RetrySettings retrySettings =
RetrySettings.newBuilder()
.setInitialRetryDelay(Duration.ofMillis(500))
Expand All @@ -125,8 +124,7 @@ public void testJsonStreamWriterCommittedStreamWithNonQuotaRetry()
.build());
int totalRequest = 901;
int rowBatch = 1;
ArrayList<ApiFuture<AppendRowsResponse>> allResponses =
new ArrayList<>(totalRequest);
ArrayList<ApiFuture<AppendRowsResponse>> allResponses = new ArrayList<>(totalRequest);
try (JsonStreamWriter jsonStreamWriter =
JsonStreamWriter.newBuilder(writeStream.getName(), writeStream.getTableSchema())
.setRetrySettings(retrySettings)
Expand Down Expand Up @@ -157,8 +155,7 @@ public void testJsonStreamWriterCommittedStreamWithNonQuotaRetry()

@Test
public void testJsonStreamWriterDefaultStreamWithNonQuotaRetry()
throws IOException, InterruptedException,
DescriptorValidationException {
throws IOException, InterruptedException, DescriptorValidationException {
RetrySettings retrySettings =
RetrySettings.newBuilder()
.setInitialRetryDelay(Duration.ofMillis(500))
Expand All @@ -178,19 +175,15 @@ public void testJsonStreamWriterDefaultStreamWithNonQuotaRetry()
TableInfo.newBuilder(
TableId.of(DATASET, tableName),
StandardTableDefinition.of(
Schema.of(
Field.newBuilder(
"test_str", StandardSQLTypeName.STRING)
.build())))
Schema.of(Field.newBuilder("test_str", StandardSQLTypeName.STRING).build())))
.build();

bigquery.create(tableInfo);
TableName parent = TableName.of(QUOTA_RETRY_PROJECT_ID, DATASET, tableName);

int totalRequest = 901;
int rowBatch = 1;
ArrayList<ApiFuture<AppendRowsResponse>> allResponses =
new ArrayList<>(totalRequest);
ArrayList<ApiFuture<AppendRowsResponse>> allResponses = new ArrayList<>(totalRequest);
try (JsonStreamWriter jsonStreamWriter =
JsonStreamWriter.newBuilder(parent.toString(), tableSchema)
.setIgnoreUnknownFields(true)
Expand Down

0 comments on commit 9e8506e

Please sign in to comment.