Skip to content

Samza-1379: Create Azure Client#254

Closed
PawasChhokra wants to merge 5 commits intoapache:masterfrom
PawasChhokra:AzureStorageClient
Closed

Samza-1379: Create Azure Client#254
PawasChhokra wants to merge 5 commits intoapache:masterfrom
PawasChhokra:AzureStorageClient

Conversation

@PawasChhokra
Copy link
Contributor

@PawasChhokra PawasChhokra commented Aug 2, 2017

@navina
PR 1: AzureClient + AzureConfig (current PR)

Copy link
Contributor

@sborya sborya left a comment

Choose a reason for hiding this comment

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

can you also link the design document to the PR, that explains where this client is needed.

blobClient = account.createCloudBlobClient();
tableClient = account.createCloudTableClient();
} catch (IllegalArgumentException | URISyntaxException e) {
LOG.info("\nConnection string specifies an invalid URI.");
Copy link
Contributor

Choose a reason for hiding this comment

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

should be error.

Copy link
Contributor

Choose a reason for hiding this comment

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

It will be a more informative error message if you can include the incorrect value in the message. For example,
LOG.error("Connection string {} specifies an invalid URI", storageConnectionString);
Same suggestion for other error/warning messages.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

tableClient = account.createCloudTableClient();
} catch (IllegalArgumentException | URISyntaxException e) {
LOG.info("\nConnection string specifies an invalid URI.");
LOG.info("Please confirm the connection string is in the Azure connection string format.");
Copy link
Contributor

Choose a reason for hiding this comment

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

should be error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

LOG.info("Please confirm the connection string is in the Azure connection string format.");
throw new SamzaException(e);
} catch (InvalidKeyException e) {
LOG.info("\nConnection string specifies an invalid key.");
Copy link
Contributor

Choose a reason for hiding this comment

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

should be error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

throw new SamzaException(e);
} catch (InvalidKeyException e) {
LOG.info("\nConnection string specifies an invalid key.");
LOG.info("Please confirm the AccountName and AccountKey in the connection string are valid.");
Copy link
Contributor

Choose a reason for hiding this comment

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

should be error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

compile "com.microsoft.azure:azure-storage:5.3.1"
compile "com.fasterxml.jackson.core:jackson-core:2.8.8"
compile project(':samza-api')
compile project(":samza-core_$scalaVersion")
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we depend on samza-core?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the coordination Apis are in samza-core.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Samza core has the JobCoordinator, LeaderElector and a few other interfaces that I'm implementing for Azure.

compile project(':samza-api')
compile project(":samza-core_$scalaVersion")
compile "org.slf4j:slf4j-api:$slf4jVersion"
testCompile "junit:junit:$junitVersion"
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see any tests here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will add tests in the future.

build.gradle Outdated
}
}


Copy link
Contributor

Choose a reason for hiding this comment

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

please remove :)

Copy link
Contributor

@navina navina 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. Thanks for breaking down your changes to smaller PRs :)

One recommendation, given the scope and timeline of your work: Can you add a README.md document in samza-azure module that provide a link to your design doc and other setup related information ? It will be useful for everyone reviewing/using samza-azure.

We discussed that tests can be tabled for later PRs. Please get to it when you can.

Have some comments. Otherwise looks good. 👍

blobClient = account.createCloudBlobClient();
tableClient = account.createCloudTableClient();
} catch (IllegalArgumentException | URISyntaxException e) {
LOG.info("\nConnection string specifies an invalid URI.");
Copy link
Contributor

Choose a reason for hiding this comment

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

It will be a more informative error message if you can include the incorrect value in the message. For example,
LOG.error("Connection string {} specifies an invalid URI", storageConnectionString);
Same suggestion for other error/warning messages.

import org.apache.samza.config.MapConfig;


public class AzureConfig extends MapConfig {
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 update the Samza configuration page with a section for "Samza on Azure" and add config relevant to this component?
It helps to add the configs incrementally with your PRs because:

  1. You can make sure that you don't miss any configs in the end
  2. It will be useful for reviewers to understand your code better. For example, it's not obvious to me how AZURE_BLOB_NAME and AZURE_CONTAINER_NAME is used and when it should be overridden by the user.

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 the configuration page and added a README.md file.

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