You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@reef.apache.org by mo...@apache.org on 2018/06/22 21:49:53 UTC
[reef] branch master updated: [REEF-2034] AdlsAccountName Expects
FQDN (#1471)
This is an automated email from the ASF dual-hosted git repository.
motus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/reef.git
The following commit(s) were added to refs/heads/master by this push:
new 52881d2 [REEF-2034] AdlsAccountName Expects FQDN (#1471)
52881d2 is described below
commit 52881d2ccbf166d9b8d93c724ddcccd301f82c24
Author: mandyshieh <ma...@users.noreply.github.com>
AuthorDate: Fri Jun 22 14:49:51 2018 -0700
[REEF-2034] AdlsAccountName Expects FQDN (#1471)
Rename the parameter `AdlsAccountName` to `AdlsAccountFqdn` for clarity and fix the docs. + other minor fixes
JIRA: [REEF-2034](https://issues.apache.org/jira/browse/REEF-2034)
Pull request:
This closes #1471
---
.../Org.Apache.REEF.IO.Tests/TestAzureDataLakeFileSystem.cs | 13 ++++---------
.../TestAzureDataLakeFileSystemE2E.cs | 6 +++---
.../FileSystem/AzureDataLake/AzureDataLakeFileSystem.cs | 2 +-
.../AzureDataLake/AzureDataLakeFileSystemConfiguration.cs | 4 ++--
.../AzureDataLakeFileSystemConfigurationProvider.cs | 4 ++--
.../FileSystem/AzureDataLake/AzureDataLakeStoreClient.cs | 6 +++---
.../FileSystem/AzureDataLake/IDataLakeStoreClient.cs | 4 ++--
...eStorageAccountName.cs => DataLakeStorageAccountFqdn.cs} | 2 +-
8 files changed, 18 insertions(+), 23 deletions(-)
diff --git a/lang/cs/Org.Apache.REEF.IO.Tests/TestAzureDataLakeFileSystem.cs b/lang/cs/Org.Apache.REEF.IO.Tests/TestAzureDataLakeFileSystem.cs
index 7199f9e..162af3c 100644
--- a/lang/cs/Org.Apache.REEF.IO.Tests/TestAzureDataLakeFileSystem.cs
+++ b/lang/cs/Org.Apache.REEF.IO.Tests/TestAzureDataLakeFileSystem.cs
@@ -30,7 +30,7 @@ namespace Org.Apache.REEF.IO.Tests
{
private Uri FakeBaseUri
{
- get { return new Uri("adl://" + new TestContext().AdlAccountFQDN); }
+ get { return new Uri("adl://" + new TestContext().AdlsAccountFqdn); }
}
private Uri FakeDirUri
@@ -236,18 +236,13 @@ namespace Org.Apache.REEF.IO.Tests
private sealed class TestContext
{
- public readonly string AdlAccountName = "adlaccount";
+ public readonly string AdlsAccountFqdn = "adlsAccount.azuredatalakestore.net";
public readonly AdlsClient MockAdlsClient = Microsoft.Azure.DataLake.Store.MockAdlsFileSystem.MockAdlsClient.GetMockClient();
- public string AdlAccountFQDN
- {
- get { return $"{AdlAccountName}.azuredatalakestore.net"; }
- }
-
public AzureDataLakeFileSystem GetAdlsFileSystem()
{
var conf = AzureDataLakeFileSystemConfiguration.ConfigurationModule
- .Set(AzureDataLakeFileSystemConfiguration.DataLakeStorageAccountName, AdlAccountFQDN)
+ .Set(AzureDataLakeFileSystemConfiguration.DataLakeStorageAccountFqdn, AdlsAccountFqdn)
.Set(AzureDataLakeFileSystemConfiguration.Tenant, "tenant")
.Set(AzureDataLakeFileSystemConfiguration.ClientId, "clientId")
.Set(AzureDataLakeFileSystemConfiguration.SecretKey, "secretKey")
@@ -256,7 +251,7 @@ namespace Org.Apache.REEF.IO.Tests
var testDataLakeStoreClient = Substitute.For<IDataLakeStoreClient>();
injector.BindVolatileInstance(testDataLakeStoreClient);
testDataLakeStoreClient.GetAdlsClient().ReturnsForAnyArgs(MockAdlsClient);
- testDataLakeStoreClient.AccountFQDN.Returns(AdlAccountFQDN);
+ testDataLakeStoreClient.AccountFqdn.Returns(AdlsAccountFqdn);
var fs = injector.GetInstance<AzureDataLakeFileSystem>();
return fs;
}
diff --git a/lang/cs/Org.Apache.REEF.IO.Tests/TestAzureDataLakeFileSystemE2E.cs b/lang/cs/Org.Apache.REEF.IO.Tests/TestAzureDataLakeFileSystemE2E.cs
index a0aaad0..131c941 100644
--- a/lang/cs/Org.Apache.REEF.IO.Tests/TestAzureDataLakeFileSystemE2E.cs
+++ b/lang/cs/Org.Apache.REEF.IO.Tests/TestAzureDataLakeFileSystemE2E.cs
@@ -49,7 +49,7 @@ namespace Org.Apache.REEF.IO.Tests
// use its authentication key as the SecretKey
// https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal#get-application-id-and-authentication-key
// Fill in before running test!
- const string AdlsAccountName = "#####.azuredatalakestore.net";
+ const string AdlsAccountFqdn = "#####.azuredatalakestore.net";
const string Tenant = "microsoft.onmicrosoft.com";
const string TokenAudience = @"https://datalake.azure.net/";
const string ClientId = "########-####-####-####-############"; // e.g. "c2897d56-5eef-4030-8b7a-46b5c0acd05c"
@@ -58,7 +58,7 @@ namespace Org.Apache.REEF.IO.Tests
_defaultFolderName = "reef-test-folder-" + Guid.NewGuid();
IConfiguration conf = AzureDataLakeFileSystemConfiguration.ConfigurationModule
- .Set(AzureDataLakeFileSystemConfiguration.DataLakeStorageAccountName, AdlsAccountName)
+ .Set(AzureDataLakeFileSystemConfiguration.DataLakeStorageAccountFqdn, AdlsAccountFqdn)
.Set(AzureDataLakeFileSystemConfiguration.Tenant, Tenant)
.Set(AzureDataLakeFileSystemConfiguration.ClientId, ClientId)
.Set(AzureDataLakeFileSystemConfiguration.SecretKey, SecretKey)
@@ -67,7 +67,7 @@ namespace Org.Apache.REEF.IO.Tests
_fileSystem = TangFactory.GetTang().NewInjector(conf).GetInstance<AzureDataLakeFileSystem>();
ServiceClientCredentials adlCreds = GetCredsSpiSecretKey(Tenant, new Uri(TokenAudience), ClientId, SecretKey);
- _adlsClient = AdlsClient.CreateClient(AdlsAccountName, adlCreds);
+ _adlsClient = AdlsClient.CreateClient(AdlsAccountFqdn, adlCreds);
}
public void Dispose()
diff --git a/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/AzureDataLakeFileSystem.cs b/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/AzureDataLakeFileSystem.cs
index f6ad141..d1ad20a 100644
--- a/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/AzureDataLakeFileSystem.cs
+++ b/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/AzureDataLakeFileSystem.cs
@@ -36,7 +36,7 @@ namespace Org.Apache.REEF.IO.FileSystem.AzureDataLake
private string UriPrefix
{
- get { return $"adl://{_client.AccountFQDN}"; }
+ get { return $"adl://{_client.AccountFqdn}"; }
}
[Inject]
diff --git a/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/AzureDataLakeFileSystemConfiguration.cs b/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/AzureDataLakeFileSystemConfiguration.cs
index 6c386f6..4a45c96 100644
--- a/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/AzureDataLakeFileSystemConfiguration.cs
+++ b/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/AzureDataLakeFileSystemConfiguration.cs
@@ -31,7 +31,7 @@ namespace Org.Apache.REEF.IO.FileSystem.AzureDataLake
/// <summary>
/// The account FQDN to be used to connect to the data lake store
/// </summary>
- public static readonly RequiredParameter<string> DataLakeStorageAccountName = new RequiredParameter<string>();
+ public static readonly RequiredParameter<string> DataLakeStorageAccountFqdn = new RequiredParameter<string>();
/// <summary>
/// The Tenant to be used to authenticate with Azure
@@ -61,7 +61,7 @@ namespace Org.Apache.REEF.IO.FileSystem.AzureDataLake
.BindSetEntry<DriverConfigurationProviders, AzureDataLakeFileSystemConfigurationProvider, IConfigurationProvider>(
GenericType<DriverConfigurationProviders>.Class, GenericType<AzureDataLakeFileSystemConfigurationProvider>.Class)
.BindImplementation(GenericType<IFileSystem>.Class, GenericType<AzureDataLakeFileSystem>.Class)
- .BindNamedParameter(GenericType<DataLakeStorageAccountName>.Class, DataLakeStorageAccountName)
+ .BindNamedParameter(GenericType<DataLakeStorageAccountFqdn>.Class, DataLakeStorageAccountFqdn)
.BindNamedParameter(GenericType<Tenant>.Class, Tenant)
.BindNamedParameter(GenericType<ClientId>.Class, ClientId)
.BindNamedParameter(GenericType<SecretKey>.Class, SecretKey)
diff --git a/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/AzureDataLakeFileSystemConfigurationProvider.cs b/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/AzureDataLakeFileSystemConfigurationProvider.cs
index 8e1564c..25c6a66 100644
--- a/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/AzureDataLakeFileSystemConfigurationProvider.cs
+++ b/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/AzureDataLakeFileSystemConfigurationProvider.cs
@@ -35,7 +35,7 @@ namespace Org.Apache.REEF.IO.FileSystem.AzureDataLake
[Inject]
private AzureDataLakeFileSystemConfigurationProvider(
- [Parameter(typeof(DataLakeStorageAccountName))] string adlsAccountName,
+ [Parameter(typeof(DataLakeStorageAccountFqdn))] string adlsAccountFqdn,
[Parameter(typeof(Tenant))] string tenant,
[Parameter(typeof(ClientId))] string clientId,
[Parameter(typeof(SecretKey))] string secretKey,
@@ -44,7 +44,7 @@ namespace Org.Apache.REEF.IO.FileSystem.AzureDataLake
_configuration = TangFactory.GetTang().NewConfigurationBuilder()
.BindImplementation(GenericType<IFileSystem>.Class, GenericType<AzureDataLakeFileSystem>.Class)
.BindImplementation(GenericType<IAdlsCredentials>.Class, GenericType<SecretKeyAdlsCredentials>.Class)
- .BindStringNamedParam<DataLakeStorageAccountName>(adlsAccountName)
+ .BindStringNamedParam<DataLakeStorageAccountFqdn>(adlsAccountFqdn)
.BindStringNamedParam<Tenant>(tenant)
.BindStringNamedParam<ClientId>(clientId)
.BindStringNamedParam<SecretKey>(secretKey)
diff --git a/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/AzureDataLakeStoreClient.cs b/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/AzureDataLakeStoreClient.cs
index 6367797..d853229 100644
--- a/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/AzureDataLakeStoreClient.cs
+++ b/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/AzureDataLakeStoreClient.cs
@@ -29,9 +29,9 @@ namespace Org.Apache.REEF.IO.FileSystem.AzureDataLake
private readonly AdlsClient _adlsClient;
[Inject]
- private AzureDataLakeStoreClient([Parameter(typeof(DataLakeStorageAccountName))] string adlsAccountName, IAdlsCredentials adlsCredentials)
+ private AzureDataLakeStoreClient([Parameter(typeof(DataLakeStorageAccountFqdn))] string adlsAccountFqdn, IAdlsCredentials adlsCredentials)
{
- _adlsClient = AdlsClient.CreateClient(adlsAccountName, adlsCredentials.Credentials);
+ _adlsClient = AdlsClient.CreateClient(adlsAccountFqdn, adlsCredentials.Credentials);
}
public AdlsClient GetAdlsClient()
@@ -39,6 +39,6 @@ namespace Org.Apache.REEF.IO.FileSystem.AzureDataLake
return _adlsClient;
}
- public string AccountFQDN => _adlsClient.AccountFQDN;
+ public string AccountFqdn => _adlsClient.AccountFQDN;
}
}
diff --git a/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/IDataLakeStoreClient.cs b/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/IDataLakeStoreClient.cs
index da694c3..14df103 100644
--- a/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/IDataLakeStoreClient.cs
+++ b/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/IDataLakeStoreClient.cs
@@ -29,8 +29,8 @@ namespace Org.Apache.REEF.IO.FileSystem.AzureDataLake
AdlsClient GetAdlsClient();
/// <summary>
- /// Returns the account name for the AdlsClient.
+ /// Returns the account FQDN for the AdlsClient.
/// </summary>
- string AccountFQDN { get; }
+ string AccountFqdn { get; }
}
}
diff --git a/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/Parameters/DataLakeStorageAccountName.cs b/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/Parameters/DataLakeStorageAccountFqdn.cs
similarity index 94%
rename from lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/Parameters/DataLakeStorageAccountName.cs
rename to lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/Parameters/DataLakeStorageAccountFqdn.cs
index 5d3f2ed..7ba0102 100644
--- a/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/Parameters/DataLakeStorageAccountName.cs
+++ b/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/Parameters/DataLakeStorageAccountFqdn.cs
@@ -23,7 +23,7 @@ namespace Org.Apache.REEF.IO.FileSystem.AzureDataLake.Parameters
/// The account FQDN to be used to connect to the data lake store
/// </summary>
[NamedParameter("The account FQDN to be used to connect to the data lake store")]
- internal sealed class DataLakeStorageAccountName : Name<string>
+ internal sealed class DataLakeStorageAccountFqdn : Name<string>
{
}
}