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

Introduce StorageConnector for Azure #14660

Merged
merged 31 commits into from
Aug 9, 2023

Conversation

LakshSingla
Copy link
Contributor

@LakshSingla LakshSingla commented Jul 25, 2023

Description

This PR adds the storage connector to interact with Azure's blob storage using the current Azure API used in Druid. This will allow Durable storage and MSQ's interactive APIs to work with Azure

This also refactors the currently available S3 connector so that the chunking downloads that is currently done by the S3 connector can be extended to other connectors. (note: This refactoring is ported from the PR #14611 since that is currently parked for work).

Testing plan

  1. Adding unit tests to the Azure connector
  2. Functionally testing that the Azure connector works as expected.
  3. Sanity testing that the S3 connector works as expected since it has been refactored
  4. Performance comparison between the Azure connector (new feature) and the S3 connector (current benchmark)

Release note

Azure connector has been introduced and MSQ's fault tolerance and durable storage can now be used with Microsoft Azure's blob storage. Also the results of newly introduced queries from deep storage can now store and fetch the results from the Azure's blob storage.


Key changed/added classes in this PR

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;

public abstract class ChunkingStorageConnector<T> implements StorageConnector
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please java doc this since this is the crux of this PR .

public ChunkingStorageConnectorParameters<T> build()
{
Preconditions.checkArgument(start >= 0, "'start' not provided or an incorrect value [%s] passed", start);
Preconditions.checkArgument(end >= 0, "'end' not provided or an incorrect value [%s] passed", end);
Copy link
Contributor

Choose a reason for hiding this comment

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

Would end < start return a good error message?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated a check with this as well in the PR!

{
private static final long DOWNLOAD_MAX_CHUNK_SIZE_BYTES = 100_000_000;

public ChunkingStorageConnector()
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need to be public?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted the change so that the individual connectors can control the chunk sizes. Used primarily for testing for now, though this can be extended to the real implementations as well.

@cryptoe cryptoe added the Area - MSQ For multi stage queries - https://github.com/apache/druid/issues/12262 label Aug 4, 2023
Copy link
Contributor

@adarshsanjeev adarshsanjeev left a comment

Choose a reason for hiding this comment

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

Looks good to me overall

params.getMaxRetry()
),
outFile,
new byte[8 * 1024],
Copy link
Contributor

Choose a reason for hiding this comment

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

I know this code was only moved, but could you add a comment on why these numbers are chosen?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure

Copy link
Contributor

@cryptoe cryptoe left a comment

Choose a reason for hiding this comment

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

Changes LGTM. The user facing docs are remaining.

@LakshSingla
Copy link
Contributor Author

Thanks, @adarshsanjeev @cryptoe for the reviews and @dhananjay1308 for testing the changes out on a cluster.
Testing for Azure has been ongoing for a day. Queries for durable storage on Azure are taking comparable times to durable storage on S3, and there don't seem to be any performance concerns for the new storage connector. Going ahead with the merge.

@LakshSingla LakshSingla merged commit 8f102f9 into apache:master Aug 9, 2023
@LakshSingla LakshSingla deleted the azure-storage-connector branch August 9, 2023 12:25
@LakshSingla LakshSingla added this to the 28.0 milestone Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area - Documentation Area - MSQ For multi stage queries - https://github.com/apache/druid/issues/12262 Release Notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants