-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HADOOP-16948. Support single writer dirs. #1925
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
Changes from all commits
5a2ef89
86246dc
fe3dd13
1cd1a92
eeb4ba0
8e91f61
8eceabb
42f68c2
9f3d689
d67882f
f00c145
f001783
92e7343
eca41b4
822615e
9fc4f08
b6803cf
4fdfc08
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,7 @@ | |
| import org.apache.hadoop.fs.azurebfs.constants.AbfsHttpConstants; | ||
| import org.apache.hadoop.fs.azurebfs.constants.AuthConfigurations; | ||
| import org.apache.hadoop.fs.azurebfs.contracts.annotations.ConfigurationValidationAnnotations.IntegerConfigurationValidatorAnnotation; | ||
| import org.apache.hadoop.fs.azurebfs.contracts.annotations.ConfigurationValidationAnnotations.IntegerWithOutlierConfigurationValidatorAnnotation; | ||
| import org.apache.hadoop.fs.azurebfs.contracts.annotations.ConfigurationValidationAnnotations.LongConfigurationValidatorAnnotation; | ||
| import org.apache.hadoop.fs.azurebfs.contracts.annotations.ConfigurationValidationAnnotations.StringConfigurationValidatorAnnotation; | ||
| import org.apache.hadoop.fs.azurebfs.contracts.annotations.ConfigurationValidationAnnotations.Base64StringConfigurationValidatorAnnotation; | ||
|
|
@@ -208,6 +209,15 @@ public class AbfsConfiguration{ | |
| DefaultValue = DEFAULT_FS_AZURE_APPEND_BLOB_DIRECTORIES) | ||
| private String azureAppendBlobDirs; | ||
|
|
||
| @StringConfigurationValidatorAnnotation(ConfigurationKey = FS_AZURE_INFINITE_LEASE_KEY, | ||
| DefaultValue = DEFAULT_FS_AZURE_INFINITE_LEASE_DIRECTORIES) | ||
| private String azureInfiniteLeaseDirs; | ||
|
|
||
| @IntegerConfigurationValidatorAnnotation(ConfigurationKey = FS_AZURE_LEASE_THREADS, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need these? i.e. Lease threads
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it will still be useful to issue the acquire and release operations in a thread pool for now. Possibly this could be removed if all acquire and release operations are moved into create and flush-with-close in the future. |
||
| MinValue = MIN_LEASE_THREADS, | ||
| DefaultValue = DEFAULT_LEASE_THREADS) | ||
| private int numLeaseThreads; | ||
|
|
||
| @BooleanConfigurationValidatorAnnotation(ConfigurationKey = AZURE_CREATE_REMOTE_FILESYSTEM_DURING_INITIALIZATION, | ||
| DefaultValue = DEFAULT_AZURE_CREATE_REMOTE_FILESYSTEM_DURING_INITIALIZATION) | ||
| private boolean createRemoteFileSystemDuringInitialization; | ||
|
|
@@ -296,6 +306,8 @@ public AbfsConfiguration(final Configuration rawConfig, String accountName) | |
| field.setAccessible(true); | ||
| if (field.isAnnotationPresent(IntegerConfigurationValidatorAnnotation.class)) { | ||
| field.set(this, validateInt(field)); | ||
| } else if (field.isAnnotationPresent(IntegerWithOutlierConfigurationValidatorAnnotation.class)) { | ||
| field.set(this, validateIntWithOutlier(field)); | ||
| } else if (field.isAnnotationPresent(LongConfigurationValidatorAnnotation.class)) { | ||
| field.set(this, validateLong(field)); | ||
| } else if (field.isAnnotationPresent(StringConfigurationValidatorAnnotation.class)) { | ||
|
|
@@ -634,6 +646,14 @@ public String getAppendBlobDirs() { | |
| return this.azureAppendBlobDirs; | ||
| } | ||
|
|
||
| public String getAzureInfiniteLeaseDirs() { | ||
| return this.azureInfiniteLeaseDirs; | ||
| } | ||
|
|
||
| public int getNumLeaseThreads() { | ||
| return this.numLeaseThreads; | ||
| } | ||
|
|
||
| public boolean getCreateRemoteFileSystemDuringInitialization() { | ||
| // we do not support creating the filesystem when AuthType is SAS | ||
| return this.createRemoteFileSystemDuringInitialization | ||
|
|
@@ -843,6 +863,21 @@ int validateInt(Field field) throws IllegalAccessException, InvalidConfiguration | |
| validator.ThrowIfInvalid()).validate(value); | ||
| } | ||
|
|
||
| int validateIntWithOutlier(Field field) throws IllegalAccessException, InvalidConfigurationValueException { | ||
| IntegerWithOutlierConfigurationValidatorAnnotation validator = | ||
| field.getAnnotation(IntegerWithOutlierConfigurationValidatorAnnotation.class); | ||
| String value = get(validator.ConfigurationKey()); | ||
|
|
||
| // validate | ||
| return new IntegerConfigurationBasicValidator( | ||
| validator.OutlierValue(), | ||
| validator.MinValue(), | ||
| validator.MaxValue(), | ||
| validator.DefaultValue(), | ||
| validator.ConfigurationKey(), | ||
| validator.ThrowIfInvalid()).validate(value); | ||
| } | ||
|
|
||
| long validateLong(Field field) throws IllegalAccessException, InvalidConfigurationValueException { | ||
| LongConfigurationValidatorAnnotation validator = field.getAnnotation(LongConfigurationValidatorAnnotation.class); | ||
| String value = rawConfig.get(validator.ConfigurationKey()); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the feature for both namespace and flatnamespace enabled accounts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have run the unit test with HNS and flat namespace storage accounts, so I think it will work. I have not done extensive testing with HNS disabled, however.