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

Hadoop 16438 #1290

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3351,6 +3351,17 @@
</description>
</property>

<property>
<name>adl.ssl.channel.mode</name>
<value></value>
<description>
When OpenSSL - SSL socket connections are created in OpenSSL mode.
When Default_JSSE - SSL socket connections are created in the default JSSE mode.
When Default (default) - SSL socket connections are attempted with OpenSSL
and will fallback to Default_JSSE mode if OpenSSL is not available at runtime.
</description>
</property>

<!-- Azure Data Lake File System Configurations Ends Here-->

<property>
Expand Down
2 changes: 1 addition & 1 deletion hadoop-tools/hadoop-azure-datalake/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<minimalJsonVersion>0.9.1</minimalJsonVersion>
<file.encoding>UTF-8</file.encoding>
<downloadSources>true</downloadSources>
<azure.data.lake.store.sdk.version>2.3.3</azure.data.lake.store.sdk.version>
<azure.data.lake.store.sdk.version>2.3.6</azure.data.lake.store.sdk.version>
</properties>
<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public final class AdlConfKeys {
"adl.feature.ownerandgroup.enableupn";
static final boolean ADL_ENABLEUPN_FOR_OWNERGROUP_DEFAULT = false;
public static final String ADL_HTTP_TIMEOUT = "adl.http.timeout";
public static final String ADL_SSL_CHANNEL_MODE = "adl.ssl.channel.mode";

public static void addDeprecatedKeys() {
Configuration.addDeprecations(new DeprecationDelta[]{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ public void initialize(URI storeUri, Configuration originalConf)
LOG.info("No valid ADL SDK timeout configured: using SDK default.");
}

String sslChannelMode = conf.get(ADL_SSL_CHANNEL_MODE,
"Default");
options.setSSLChannelMode(sslChannelMode);

adlClient.setOptions(options);

boolean trackLatency = conf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,13 @@ addressed by lowering the timeout used by the SDK. A lower timeout at the
storage layer may allow more retries to be attempted and actually increase
the likelihood of success before hitting the framework's timeout, as attempts
that may ultimately fail will fail faster.

## SSL Socket Channel Mode

ADL SDK will by default attempt to create secure socket connections over
OpenSSL as they provide significant performance improvements over Https. If
there are runtime issues, SDK will default connections over Default_JSSE. This
can be overridden with the hadoop property `adl.ssl.channel.mode`. Possible
values for this config are OpenSSL, Default_JSSE and Default (default).
Setting the config to OpenSSL or Default_JSSE will try the connection to
only that mode.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package org.apache.hadoop.fs.adl.live;

import com.microsoft.azure.datalake.store.SSLSocketFactoryEx.SSLChannelMode;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.adl.AdlFileSystem;
import org.junit.Assert;
Expand All @@ -29,6 +30,7 @@
import java.net.URISyntaxException;

import static org.apache.hadoop.fs.adl.AdlConfKeys.ADL_HTTP_TIMEOUT;
import static org.apache.hadoop.fs.adl.AdlConfKeys.ADL_SSL_CHANNEL_MODE;

/**
* Tests interactions with SDK and ensures configuration is having the desired
Expand All @@ -53,7 +55,6 @@ public void testDefaultTimeout() throws IOException {

// Skip this test if we can't get a real FS
Assume.assumeNotNull(fs);

effectiveTimeout = fs.getAdlClient().getDefaultTimeout();
Assert.assertFalse("A negative timeout is not supposed to take effect",
effectiveTimeout < 0);
Expand All @@ -74,4 +75,67 @@ public void testDefaultTimeout() throws IOException {

// The default value may vary by SDK, so that value is not tested here.
}

@Test
public void testSSLChannelMode() throws IOException {
AdlFileSystem fs = null;
Configuration conf = null;

conf = AdlStorageConfiguration.getConfiguration();
conf.set(ADL_SSL_CHANNEL_MODE, "OpenSSl");
try {
fs = (AdlFileSystem)
(AdlStorageConfiguration.createStorageConnector(conf));
} catch (URISyntaxException e) {
throw new IllegalStateException("ADL FileSystem initialization failed. "
+ "Please check test.fs.adl.name property.", e);
}

SSLChannelMode sslChannelMode = fs.getAdlClient().getSSLChannelMode();
Assert.assertTrue("Channel mode needs to be OpenSSL",
sslChannelMode == SSLChannelMode.OpenSSL);

conf = AdlStorageConfiguration.getConfiguration();
conf.set(ADL_SSL_CHANNEL_MODE, "Default_JSE");
try {
fs = (AdlFileSystem)
(AdlStorageConfiguration.createStorageConnector(conf));
} catch (URISyntaxException e) {
throw new IllegalStateException("Can not initialize ADL FileSystem. "
+ "Please check test.fs.adl.name property.", e);
}

sslChannelMode = fs.getAdlClient().getSSLChannelMode();
Assert.assertTrue("Channel mode needs to be Default_JSE",
sslChannelMode == SSLChannelMode.Default_JSE);

conf = AdlStorageConfiguration.getConfiguration();
conf.set(ADL_SSL_CHANNEL_MODE, "Default");
try {
fs = (AdlFileSystem)
(AdlStorageConfiguration.createStorageConnector(conf));
} catch (URISyntaxException e) {
throw new IllegalStateException("Can not initialize ADL FileSystem. "
+ "Please check test.fs.adl.name property.", e);
}

sslChannelMode = fs.getAdlClient().getSSLChannelMode();
Assert.assertTrue("Channel mode needs to be Default",
sslChannelMode == SSLChannelMode.Default);

conf = AdlStorageConfiguration.getConfiguration();
conf.set(ADL_SSL_CHANNEL_MODE, "Invalid");
try {
fs = (AdlFileSystem)
(AdlStorageConfiguration.createStorageConnector(conf));
} catch (URISyntaxException e) {
throw new IllegalStateException("Can not initialize ADL FileSystem. "
+ "Please check test.fs.adl.name property.", e);
}

sslChannelMode = fs.getAdlClient().getSSLChannelMode();
Assert.assertTrue("Channel mode needs to be Default when adl.ssl"
+ ".channel.mode config is missing or is invalid",
sslChannelMode == SSLChannelMode.Default);
}
}