Skip to content

Upgrade AWS SDK to v2#14

Open
eagletmt wants to merge 1 commit into
cookpad:masterfrom
eagletmt:upgrade-aws-sdk-2
Open

Upgrade AWS SDK to v2#14
eagletmt wants to merge 1 commit into
cookpad:masterfrom
eagletmt:upgrade-aws-sdk-2

Conversation

@eagletmt
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Upgrades the project’s AWS integrations from AWS SDK for Java v1 to AWS SDK v2 across the stream, shared, batch, and merge modules, updating S3/SQS/SNS/Glue usage and related tests/build dependencies.

Changes:

  • Migrate S3/SQS/SNS/Glue client and model usage to AWS SDK v2 (builders, response types, getters).
  • Update S3 event notification parsing to the v2 s3-event-notifications library in the stream dispatcher.
  • Adjust tests and Gradle dependencies to align with AWS SDK v2 APIs.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
stream/src/test/java/com/cookpad/prism/stream/events/SqsEventDispatcherTest.java Updates SQS test mocks/models to AWS SDK v2 types.
stream/src/main/java/com/cookpad/prism/stream/filequeue/S3QueueDownloader.java Switches S3 downloader to S3Client + GetObjectRequest and URI input.
stream/src/main/java/com/cookpad/prism/stream/events/SqsEventDispatcher.java Migrates SQS receive/delete + S3 event parsing to AWS SDK v2.
stream/src/main/java/com/cookpad/prism/stream/events/FileQueueEventDispatcher.java Replaces AmazonS3URI parsing with URI parsing for queue entries.
stream/src/main/java/com/cookpad/prism/stream/Main.java Replaces v1 AWS clients with v2 client beans.
stream/src/main/java/com/cookpad/prism/stream/FileQueueEventDispatcherFactory.java Updates queue-file URI handling to URI.
stream/src/main/java/com/cookpad/prism/objectstore/StagingObjectStore.java Migrates S3 getObject usage to AWS SDK v2.
stream/build.gradle Adds AWS SDK v2 s3-event-notifications dependency.
shared/src/test/java/com/cookpad/prism/objectstore/PrismObjectStoreTest.java Updates S3 putObject test to AWS SDK v2 request/body.
shared/src/main/java/com/cookpad/prism/objectstore/PrismObjectStoreFactory.java Switches factory dependency from AmazonS3 to S3Client.
shared/src/main/java/com/cookpad/prism/objectstore/PrismObjectStore.java Migrates S3 get/put and tagging to AWS SDK v2 APIs.
shared/build.gradle Replaces AWS SDK v1 dependencies with AWS SDK v2 modules.
merge/src/main/java/com/cookpad/prism/merge/Main.java Replaces v1 S3 client bean with v2 S3Client.
batch/src/test/java/com/cookpad/prism/batch/catalog/CatalogTableTest.java Updates Glue model accessors to AWS SDK v2 style.
batch/src/main/java/com/cookpad/prism/batch/catalog/UpsertPartitionRequest.java Migrates Glue request construction to v2 builders.
batch/src/main/java/com/cookpad/prism/batch/catalog/CatalogTable.java Migrates Glue table/partition/database model building to v2 builders.
batch/src/main/java/com/cookpad/prism/batch/catalog/Catalog.java Migrates Glue client and pagination/result handling to AWS SDK v2.
batch/src/main/java/com/cookpad/prism/batch/UnlinkTableCmd.java Migrates Glue delete table request to AWS SDK v2 builder API.
batch/src/main/java/com/cookpad/prism/batch/Main.java Replaces v1 AWS clients with v2 S3/Glue client beans.
batch/src/main/java/com/cookpad/prism/batch/ListStagingObjectsCmd.java Migrates S3 listing and putObject to AWS SDK v2 APIs; uses URI for destination.
batch/src/main/java/com/cookpad/prism/batch/CmdRunner.java Updates dest S3 URI parsing to URI.
batch/build.gradle Replaces AWS SDK v1 Glue dependency with AWS SDK v2 Glue module.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 56 to 64
@Bean
public AmazonSQS sqs() {
return AmazonSQSClientBuilder.defaultClient();
public SqsClient sqs() {
return SqsClient.create();
}

@Bean
public AmazonS3 s3() {
return AmazonS3ClientBuilder.defaultClient();
public S3Client s3() {
return S3Client.create();
}
Comment on lines 33 to 41
@Bean
public AmazonS3 s3() {
return AmazonS3ClientBuilder.defaultClient();
public S3Client s3() {
return S3Client.create();
}

@Bean
public AWSGlue glue() {
return AWSGlueClientBuilder.defaultClient();
public GlueClient glue() {
return GlueClient.create();
}
@@ -39,8 +38,8 @@ public static void main(String[] args) {
}

@Bean
Comment on lines +32 to 37
void putLiveObjectFile_shouldCreateRequestWithCorrectTag() throws IOException {
// Arrange
LocalDate testDate = LocalDate.of(2025, 1, 1);
long objectId = 100;
File testFile = mock(File.class);
File testFile = Files.createTempFile("prism-test-", ".tmp").toFile();
String bucketName = "test-bucket";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants