Skip to content

Commit

Permalink
Format code (#9892)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuliren authored Jan 30, 2022
1 parent 479f0d7 commit a094142
Show file tree
Hide file tree
Showing 51 changed files with 94 additions and 132 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
public interface GcsWriterFactory {

DestinationFileWriter create(GcsDestinationConfig config,
AmazonS3 s3Client,
ConfiguredAirbyteStream configuredStream,
Timestamp uploadTimestamp)
AmazonS3 s3Client,
ConfiguredAirbyteStream configuredStream,
Timestamp uploadTimestamp)
throws Exception;

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ public class ProductionWriterFactory implements GcsWriterFactory {

@Override
public DestinationFileWriter create(final GcsDestinationConfig config,
final AmazonS3 s3Client,
final ConfiguredAirbyteStream configuredStream,
final Timestamp uploadTimestamp)
final AmazonS3 s3Client,
final ConfiguredAirbyteStream configuredStream,
final Timestamp uploadTimestamp)
throws Exception {
final S3Format format = config.getFormatConfig().getFormat();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,5 @@ public void write(JsonNode formattedData) throws IOException {
final GenericData.Record record = avroRecordFactory.getAvroRecord(formattedData);
dataFileWriter.append(record);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,5 @@ public S3Format getFileFormat() {
public void write(JsonNode formattedData) throws IOException {
csvPrinter.printRecord(csvSheetGenerator.getDataRow(formattedData));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import io.airbyte.integrations.destination.s3.writer.DestinationFileWriter;
import io.airbyte.protocol.models.AirbyteRecordMessage;
import io.airbyte.protocol.models.ConfiguredAirbyteStream;

import java.io.IOException;
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;
Expand Down Expand Up @@ -104,4 +103,5 @@ public S3Format getFileFormat() {
public void write(JsonNode formattedData) throws IOException {
printWriter.println(Jsons.serialize(formattedData));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,5 @@ public S3Format getFileFormat() {
public void write(JsonNode formattedData) throws IOException {
parquetWriter.write(avroRecordFactory.getAvroRecord(formattedData));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import java.util.UUID;

/**
* {@link DestinationWriter} is responsible for writing Airbyte stream data to an S3 location in a specific
* format.
* {@link DestinationWriter} is responsible for writing Airbyte stream data to an S3 location in a
* specific format.
*/
public interface DestinationWriter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public class ProductionWriterFactory implements S3WriterFactory {

@Override
public DestinationFileWriter create(final S3DestinationConfig config,
final AmazonS3 s3Client,
final ConfiguredAirbyteStream configuredStream,
final Timestamp uploadTimestamp)
final AmazonS3 s3Client,
final ConfiguredAirbyteStream configuredStream,
final Timestamp uploadTimestamp)
throws Exception {
final S3Format format = config.getFormatConfig().getFormat();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
public interface S3WriterFactory {

DestinationFileWriter create(S3DestinationConfig config,
AmazonS3 s3Client,
ConfiguredAirbyteStream configuredStream,
Timestamp uploadTimestamp)
AmazonS3 s3Client,
ConfiguredAirbyteStream configuredStream,
Timestamp uploadTimestamp)
throws Exception;

}
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ public AirbyteConnectionStatus check(final JsonNode config) {
final SnowflakeStagingSqlOperations snowflakeStagingSqlOperations = new SnowflakeStagingSqlOperations();
try (final JdbcDatabase database = getDatabase(config)) {
final String outputSchema = super.getNamingResolver().getIdentifier(config.get("schema").asText());
AirbyteSentry.runWithSpan("CreateAndDropTable", () ->
attemptSQLCreateAndDropTableOperations(outputSchema, database, nameTransformer, snowflakeStagingSqlOperations));
AirbyteSentry.runWithSpan("CreateAndDropStage", () ->
attemptSQLCreateAndDropStages(outputSchema, database, nameTransformer, snowflakeStagingSqlOperations));
AirbyteSentry.runWithSpan("CreateAndDropTable",
() -> attemptSQLCreateAndDropTableOperations(outputSchema, database, nameTransformer, snowflakeStagingSqlOperations));
AirbyteSentry.runWithSpan("CreateAndDropStage",
() -> attemptSQLCreateAndDropStages(outputSchema, database, nameTransformer, snowflakeStagingSqlOperations));
return new AirbyteConnectionStatus().withStatus(AirbyteConnectionStatus.Status.SUCCEEDED);
} catch (final Exception e) {
LOGGER.error("Exception while checking connection: ", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.sql.SQLException;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;

public class BigQuerySourceAcceptanceTest extends SourceAcceptanceTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
import io.airbyte.protocol.models.Field;
import io.airbyte.protocol.models.JsonSchemaPrimitive;
import io.airbyte.protocol.models.SyncMode;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import org.testcontainers.containers.ClickHouseContainer;

public abstract class AbstractSshClickHouseSourceAcceptanceTest extends SourceAcceptanceTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
import io.airbyte.protocol.models.Field;
import io.airbyte.protocol.models.JsonSchemaPrimitive;
import io.airbyte.protocol.models.SyncMode;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import org.testcontainers.containers.ClickHouseContainer;

public class ClickHouseSourceAcceptanceTest extends SourceAcceptanceTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
import io.airbyte.protocol.models.Field;
import io.airbyte.protocol.models.JsonSchemaPrimitive;
import io.airbyte.protocol.models.SyncMode;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import org.jooq.SQLDialect;

public class CockroachDbEncryptSourceAcceptanceTest extends SourceAcceptanceTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
import io.airbyte.protocol.models.Field;
import io.airbyte.protocol.models.JsonSchemaPrimitive;
import io.airbyte.protocol.models.SyncMode;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import org.jooq.SQLDialect;
import org.testcontainers.containers.CockroachContainer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.testcontainers.containers.Db2Container;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
import io.airbyte.protocol.models.Field;
import io.airbyte.protocol.models.JsonSchemaPrimitive;
import io.airbyte.protocol.models.SyncMode;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import org.testcontainers.containers.Db2Container;

public class Db2SourceAcceptanceTest extends SourceAcceptanceTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.testcontainers.containers.Db2Container;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
import io.airbyte.protocol.models.ConfiguredAirbyteCatalog;
import io.airbyte.protocol.models.ConnectorSpecification;
import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;

public class LegacyInfiniteFeedSourceAcceptanceTest extends SourceAcceptanceTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@
},
"repository": {
"type": "string",
"examples": ["airbytehq/airbyte airbytehq/another-repo", "airbytehq/*", "airbytehq/airbyte"],
"examples": [
"airbytehq/airbyte airbytehq/another-repo",
"airbytehq/*",
"airbytehq/airbyte"
],
"title": "GitHub Repositories",
"description": "Space-delimited list of GitHub organizations/repositories, e.g. `airbytehq/airbyte` for single repository, `airbytehq/*` for get all repositories from organization and `airbytehq/airbyte airbytehq/another-repo` for multiple repositories."
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"start_date": "2021-10-01T00:00:00Z",
"credentials": {
"credentials_title": "OAuth Credentials",
"client_id": "123456789_client_id_hubspot",
"client_secret": "123456789_client_secret_hubspot",
"refresh_token": "123456789_some_refresh_token"
}
"start_date": "2021-10-01T00:00:00Z",
"credentials": {
"credentials_title": "OAuth Credentials",
"client_id": "123456789_client_id_hubspot",
"client_secret": "123456789_client_secret_hubspot",
"refresh_token": "123456789_some_refresh_token"
}
}
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"type": ["null", "object"],
"properties": {
"value": {
"type": ["null", "string"]
},
"source-type": {
"type": ["null", "string"]
},
"source-id": {
"type": ["null", "string"]
},
"source-label": {
"type": ["null", "string"]
},
"updated-by-user-id" : {
"type": ["null", "integer"]
},
"timestamp": {
"type": ["null", "string"],
"format": "date-time"
},
"selected": {
"type": ["null", "boolean"]
},
"property": {
"type": ["null", "string"]
},
"vid": {
"type": ["null", "integer"]
}
"$schema": "http://json-schema.org/draft-07/schema",
"type": ["null", "object"],
"properties": {
"value": {
"type": ["null", "string"]
},
"source-type": {
"type": ["null", "string"]
},
"source-id": {
"type": ["null", "string"]
},
"source-label": {
"type": ["null", "string"]
},
"updated-by-user-id": {
"type": ["null", "integer"]
},
"timestamp": {
"type": ["null", "string"],
"format": "date-time"
},
"selected": {
"type": ["null", "boolean"]
},
"property": {
"type": ["null", "string"]
},
"vid": {
"type": ["null", "integer"]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
import io.airbyte.protocol.models.Field;
import io.airbyte.protocol.models.JsonSchemaPrimitive;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.testcontainers.containers.PostgreSQLContainer;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import io.airbyte.protocol.models.SyncMode;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import org.apache.kafka.clients.admin.AdminClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import io.airbyte.protocol.models.SyncMode;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import org.bson.BsonArray;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import io.airbyte.protocol.models.Field;
import io.airbyte.protocol.models.JsonSchemaPrimitive;
import io.airbyte.protocol.models.SyncMode;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
import io.airbyte.protocol.models.Field;
import io.airbyte.protocol.models.JsonSchemaPrimitive;
import java.sql.SQLException;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import org.apache.commons.lang3.RandomStringUtils;
import org.testcontainers.containers.MSSQLServerContainer;
import org.testcontainers.utility.DockerImageName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import io.airbyte.protocol.models.Field;
import io.airbyte.protocol.models.JsonSchemaPrimitive;
import io.airbyte.protocol.models.SyncMode;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import io.airbyte.protocol.models.Field;
import io.airbyte.protocol.models.JsonSchemaPrimitive;
import io.airbyte.protocol.models.SyncMode;
import java.util.Collections;
import java.util.List;
import org.testcontainers.containers.MSSQLServerContainer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
import io.airbyte.protocol.models.Field;
import io.airbyte.protocol.models.JsonSchemaPrimitive;
import java.sql.SQLException;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import org.testcontainers.containers.MSSQLServerContainer;

public class MssqlSourceAcceptanceTest extends SourceAcceptanceTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
import io.airbyte.protocol.models.Field;
import io.airbyte.protocol.models.JsonSchemaPrimitive;
import io.airbyte.protocol.models.SyncMode;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import org.jooq.SQLDialect;
import org.testcontainers.containers.MySQLContainer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
import io.airbyte.protocol.models.JsonSchemaPrimitive;
import io.airbyte.protocol.models.SyncMode;
import java.nio.file.Path;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;

public abstract class AbstractSshMySqlSourceAcceptanceTest extends SourceAcceptanceTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import io.airbyte.protocol.models.Field;
import io.airbyte.protocol.models.JsonSchemaPrimitive;
import io.airbyte.protocol.models.SyncMode;
import java.util.Collections;
import java.util.List;
import org.jooq.SQLDialect;
import org.testcontainers.containers.MySQLContainer;
Expand Down
Loading

0 comments on commit a094142

Please sign in to comment.