Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add oss storage type in blob sink #58

Closed
wants to merge 53 commits into from
Closed

Conversation

sumitaich1998
Copy link

No description provided.

@sumitaich1998 sumitaich1998 marked this pull request as draft December 3, 2024 12:03
@sumitaich1998 sumitaich1998 marked this pull request as ready for review December 4, 2024 16:50
@sumitaich1998 sumitaich1998 changed the title [Draft] feat: add oss storage type in blob sink feat: add oss storage type in blob sink Dec 4, 2024

public class ObjectStorageService implements BlobStorage {
private final OSS ossClient;
private final String bucketName;

Choose a reason for hiding this comment

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

Should we set the OSSConfig as property? This approach encapsulates all related configuration settings within a single object, making the code cleaner and easier to maintain.

Choose a reason for hiding this comment

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

i would also recommend this

}

protected OSS createOSSClient(String endpoint, String accessKeyId, String accessKeySecret) {
return new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);

Choose a reason for hiding this comment

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

Should we introduce the option to pass configurable socketTimeout, connectionTimeout, connectionRequestTimeout and requestTimeout? There is also an option to pass configurable retry strategy for the OSSClient

Choose a reason for hiding this comment

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

since we are exposing connection parameters in config, the builder should accommodate the values

}};

BlobStorage storage = BlobStorageFactory.createObjectStorage(BlobStorageType.OSS, config);
assertTrue(storage instanceof ObjectStorageService);

Choose a reason for hiding this comment

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

Do we have a way to assert whether the SOME_TYPE_OSS_DIRECTORY_PREFIX is passed correctly? Seems like the assertion is similar with the above test case and this test is redundant if the assertion is all the same.

Same questions with all the positive test cases below, should we also assert the configuration or is it enough just asserting the class of the created object?

put("OSS_TYPE", "SINK_OBJECT_STORAGE");
}};
OSSConfig ossConfig = ConfigFactory.create(OSSConfig.class, properties);
Assert.assertEquals("oss-cn-hangzhou.aliyuncs.com", ossConfig.getOSSEndpoint());

Choose a reason for hiding this comment

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

Can add static import for assertion mehods


- Example value: `1024`
- Type: `optional`
- Default value: `1024`

Choose a reason for hiding this comment

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

is this default value in line with Ali documentation and/or recommendation?

put("OSS_TYPE", "SINK_OBJECT_STORAGE");
}};
OSSConfig ossConfig = ConfigFactory.create(OSSConfig.class, properties);
Assert.assertNull(ossConfig.getOSSDirectoryPrefix());

Choose a reason for hiding this comment

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

is the default value for directory prefix empty string or null?

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.

3 participants