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

AbfsoutputStream refactor #118

Merged
merged 88 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from 63 commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
15fdd85
AbfsHandlers
anmolanmol1234 May 22, 2024
2e019a9
AbfsOutputStream changes
anmolanmol1234 May 27, 2024
6969b23
Synchronization issues
anmolanmol1234 May 28, 2024
1942e61
Small write
anmolanmol1234 May 28, 2024
2adae79
Javadocs update
anmolanmol1234 May 28, 2024
f653b07
Javadocs
anmolanmol1234 May 28, 2024
ea5b71e
Javadocs
anmolanmol1234 May 28, 2024
e9d93dd
appendblob
anmolanmol1234 May 29, 2024
095bc4b
merge conflict
anmolanmol1234 May 29, 2024
48e5b8f
length 0
anmolanmol1234 May 29, 2024
da83b8a
close AbfsBlock
anmolanmol1234 May 29, 2024
4d2dc86
add new error
anmolanmol1234 May 29, 2024
20002d5
Add ingress handler to tracing context
anmolanmol1234 May 30, 2024
54535fd
logging
anmolanmol1234 May 30, 2024
75fd3a1
Add AppendBlob support for FNS
anmolanmol1234 May 30, 2024
6dba239
close data block for append blob
anmolanmol1234 May 31, 2024
bbe2230
Add marker blob creation logic
anmolanmol1234 May 31, 2024
96b9f46
changes for create
anmolanmol1234 May 31, 2024
a84207a
extra line
anmolanmol1234 May 31, 2024
0e373c5
Append fixes
anmolanmol1234 Jun 4, 2024
450dc14
parent changes
anmolanmol1234 Jun 5, 2024
2520979
Back merge
anmolanmol1234 Jun 5, 2024
f0bac54
merge conflicts
anmolanmol1234 Jun 5, 2024
39790f6
Client orchestration
anmolanmol1234 Jun 5, 2024
2e3a9e4
test fix
anmolanmol1234 Jun 5, 2024
68ca484
test fixes
anmolanmol1234 Jun 5, 2024
eb1e655
test fix
anmolanmol1234 Jun 5, 2024
c39c389
Fix for switching handler
anmolanmol1234 Jun 5, 2024
f1318e6
final type
anmolanmol1234 Jun 5, 2024
b54cf97
tests
anmolanmol1234 Jun 6, 2024
0a09c50
tests
anmolanmol1234 Jun 6, 2024
700a534
adding test
anmolanmol1234 Jun 6, 2024
a1db4e9
Add lease test case
anmolanmol1234 Jun 6, 2024
41e4d03
fix test
anmolanmol1234 Jun 6, 2024
3d4584b
fix for all ingress types
anmolanmol1234 Jun 7, 2024
337830c
Merge branch 'azureBlobClient' of https://github.com/ABFSDriver/AbfsH…
anmolanmol1234 Jun 7, 2024
5afa789
Merge branch 'azureBlobClient' of https://github.com/ABFSDriver/AbfsH…
anmolanmol1234 Jun 7, 2024
98e2b29
add create tests
anmolanmol1234 Jun 7, 2024
27a70e6
add tests
anmolanmol1234 Jun 7, 2024
bdc3f66
Merge pull request #106 from ABFSDriver/azureBlobClient
anujmodi2021 Jun 10, 2024
530b2b3
Merge branch 'apache:trunk' into wasbDeprecation_Dev
anmolanmol1234 Jun 10, 2024
e702d1c
Merge branch 'wasbDeprecation_Dev' of https://github.com/ABFSDriver/A…
anmolanmol1234 Jun 10, 2024
499fc72
append blob fix
anmolanmol1234 Jun 10, 2024
66cb16d
fix
anmolanmol1234 Jun 11, 2024
f8a9553
fix for checksum
anmolanmol1234 Jun 11, 2024
16d8bb5
lease fix
anmolanmol1234 Jun 11, 2024
764691a
mocking resolution + getConnOutputStream to throw exception
saxenapranav Jun 11, 2024
6ae8457
casting not needed
anmolanmol1234 Jun 11, 2024
63f11ed
fix shared key test
anmolanmol1234 Jun 11, 2024
d0da028
fix test
anmolanmol1234 Jun 12, 2024
8d0ffca
fix stats
anmolanmol1234 Jun 12, 2024
04ddd14
fix create stats test
anmolanmol1234 Jun 12, 2024
ba8bd15
fix test for SAS
anmolanmol1234 Jun 12, 2024
ecc5f83
merge trunk
anmolanmol1234 Jun 13, 2024
d3f853e
merge conflicts
anmolanmol1234 Jun 13, 2024
68e4da2
CPK for HNS Blob
anmolanmol1234 Jun 13, 2024
a000d21
HNS cpk blob
anmolanmol1234 Jun 13, 2024
3d6eda0
fix test
anmolanmol1234 Jun 13, 2024
deab6f7
Fix SAS
anmolanmol1234 Jun 14, 2024
1cd0402
Merge branch 'CPKHNSIngressBlob' of https://github.com/ABFSDriver/Abf…
anmolanmol1234 Jun 14, 2024
f8483e8
review comments
anmolanmol1234 Jun 14, 2024
7e198c2
changes in test
anmolanmol1234 Jun 14, 2024
5ed9a5e
make changes
anmolanmol1234 Jun 14, 2024
dbd7ca4
review comments
anmolanmol1234 Jun 17, 2024
7948e97
small write change in context
anmolanmol1234 Jun 17, 2024
1f5af7a
remove unused method
anmolanmol1234 Jun 17, 2024
091fab8
merge conflicts
anmolanmol1234 Jun 18, 2024
2fff127
create flow fix
anmolanmol1234 Jun 18, 2024
a847923
fix recursion
anmolanmol1234 Jun 18, 2024
63c060b
fix call
anmolanmol1234 Jun 18, 2024
513aa52
fix test
anmolanmol1234 Jun 18, 2024
f1c6261
review comments
anmolanmol1234 Jun 18, 2024
7c24072
createBlock synchronized
anmolanmol1234 Jun 18, 2024
b6e3f77
missed file
anmolanmol1234 Jun 18, 2024
9f03a9b
review comments
anmolanmol1234 Jun 19, 2024
43e7da1
Merge branch 'azureBlobClient' of https://github.com/ABFSDriver/AbfsH…
anmolanmol1234 Jun 19, 2024
f0c233f
take care of switching only once
anmolanmol1234 Jun 19, 2024
327fb1f
remove small write check
anmolanmol1234 Jun 19, 2024
e4ce98c
Handle fallback effectively
anmolanmol1234 Jun 20, 2024
3b087dc
missed file
anmolanmol1234 Jun 20, 2024
ff8e959
change to getter
anmolanmol1234 Jun 21, 2024
f658a68
fallback for appendblob
anmolanmol1234 Jun 21, 2024
925fcf0
correct try catch
anmolanmol1234 Jun 21, 2024
887fa4d
commit for metrics test
anmolanmol1234 Jun 21, 2024
b41b3d9
review comments
anmolanmol1234 Jun 24, 2024
942ff29
changes for block manager
anmolanmol1234 Jun 24, 2024
4fce8b4
no param needed
anmolanmol1234 Jun 24, 2024
1414b60
revert no param
anmolanmol1234 Jun 24, 2024
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 @@ -732,6 +732,10 @@ public boolean isSmallWriteOptimizationEnabled() {
return this.enableSmallWriteOptimization;
}

public void setSmallWriteOptimization(final boolean enableSmallWriteOptimization) {
this.enableSmallWriteOptimization = enableSmallWriteOptimization;
}

public boolean readSmallFilesCompletely() {
return this.readSmallFilesCompletely;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

import org.apache.commons.lang3.StringUtils;
import org.apache.hadoop.classification.VisibleForTesting;
import org.apache.hadoop.fs.azurebfs.enums.Trilean;
snvijaya marked this conversation as resolved.
Show resolved Hide resolved
import org.apache.hadoop.fs.impl.BackReference;
import org.apache.hadoop.security.ProviderUtils;
import org.apache.hadoop.util.Preconditions;
Expand Down Expand Up @@ -222,9 +223,7 @@ public void initialize(URI uri, Configuration configuration)
}
}
}

abfsStore.validateConfiguredServiceType(getInitTracingContext());

/*
* Non-hierarchical-namespace account can not have a customer-provided-key(CPK).
* Fail initialization of filesystem if the configs are provided. CPK is of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.CharacterCodingException;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
import java.time.Instant;
Expand Down Expand Up @@ -146,6 +140,7 @@
import org.apache.hadoop.util.concurrent.HadoopExecutors;
import org.apache.http.client.utils.URIBuilder;

import static java.net.HttpURLConnection.HTTP_CONFLICT;
import static org.apache.hadoop.fs.CommonConfigurationKeysPublic.FS_DEFAULT_NAME_KEY;
import static org.apache.hadoop.fs.azurebfs.AbfsStatistic.METADATA_INCOMPLETE_RENAME_FAILURES;
import static org.apache.hadoop.fs.azurebfs.AbfsStatistic.RENAME_RECOVERY;
Expand All @@ -168,6 +163,7 @@
import static org.apache.hadoop.fs.azurebfs.constants.FileSystemUriSchemes.ABFS_BLOB_DOMAIN_NAME;
import static org.apache.hadoop.fs.azurebfs.constants.FileSystemUriSchemes.ABFS_DFS_DOMAIN_NAME;
import static org.apache.hadoop.fs.azurebfs.constants.HttpHeaderConfigurations.X_MS_ENCRYPTION_CONTEXT;
import static org.apache.hadoop.fs.azurebfs.services.AbfsErrors.PATH_EXISTS;

/**
* Provides the bridging logic between Hadoop's abstract filesystem and Azure Storage.
Expand Down Expand Up @@ -297,16 +293,16 @@ public AzureBlobFileSystemStore(
public void validateConfiguredServiceType(TracingContext tracingContext)
throws AzureBlobFileSystemException {
// Todo: [FnsOverBlob] - Remove this check, Failing FS Init with Blob Endpoint Until FNS over Blob is ready.
if (getConfiguredServiceType() == AbfsServiceType.BLOB) {
throw new InvalidConfigurationValueException(FS_DEFAULT_NAME_KEY);
}
if (getIsNamespaceEnabled(tracingContext) && getConfiguredServiceType() == AbfsServiceType.BLOB) {
// This could be because of either wrongly configured url or wrongly configured fns service type.
if (identifyAbfsServiceTypeFromUrl() == AbfsServiceType.BLOB) {
throw new InvalidConfigurationValueException(FS_DEFAULT_NAME_KEY, "Wrong Domain Suffix for HNS Account");
}
throw new InvalidConfigurationValueException(FS_AZURE_FNS_ACCOUNT_SERVICE_TYPE, "Wrong Service Type for HNS Accounts");
}
// if (getConfiguredServiceType() == AbfsServiceType.BLOB) {
// throw new InvalidConfigurationValueException(FS_DEFAULT_NAME_KEY);
// }
// if (getIsNamespaceEnabled(tracingContext) && getConfiguredServiceType() == AbfsServiceType.BLOB) {
// // This could be because of either wrongly configured url or wrongly configured fns service type.
// if (identifyAbfsServiceTypeFromUrl() == AbfsServiceType.BLOB) {
// throw new InvalidConfigurationValueException(FS_DEFAULT_NAME_KEY, "Wrong Domain Suffix for HNS Account");
// }
// throw new InvalidConfigurationValueException(FS_AZURE_FNS_ACCOUNT_SERVICE_TYPE, "Wrong Service Type for HNS Accounts");
// }
}

/**
Expand Down Expand Up @@ -636,9 +632,10 @@ public OutputStream createFile(final Path path,
final FsPermission permission, final FsPermission umask,
TracingContext tracingContext) throws IOException {
try (AbfsPerfInfo perfInfo = startTracking("createFile", "createPath")) {
AbfsClient createClient = getClient(abfsConfiguration.getIngressServiceType());
boolean isNamespaceEnabled = getIsNamespaceEnabled(tracingContext);
LOG.debug("createFile filesystem: {} path: {} overwrite: {} permission: {} umask: {} isNamespaceEnabled: {}",
client.getFileSystem(),
createClient.getFileSystem(),
path,
overwrite,
permission,
Expand All @@ -650,6 +647,11 @@ public OutputStream createFile(final Path path,
if (isAppendBlobKey(path.toString())) {
isAppendBlob = true;
}
if (!isNamespaceEnabled) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This code isn't merged with Anuj's hence initially written so ?
Expectation is that this will become AbfsClientHandler.getClient().method call and no direct checks for is instance of BlobClient or DFSClient per API operation.

Copy link
Collaborator

Choose a reason for hiding this comment

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

AbfsClientHandler can have a method to return ingress client.

Copy link
Collaborator Author

@anmolanmol1234 anmolanmol1234 Jun 17, 2024

Choose a reason for hiding this comment

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

Here we want to do the creation of directory markers only in case of FNS with client type as BlobClient. Since client can be of type Blob in case of HNS also with ingress type as blob, we have a check for !isNamespaceenabled. In case of FNS DFS also we don't want this business hence for this scenario instanceOf check is needed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Have updated the code in AbfsBlobClient class

if (createClient instanceof AbfsBlobClient && path.getParent() != null && !path.getParent().isRoot()) {
createDirectory(path.getParent(), permission, umask, tracingContext);
}
}

// if "fs.azure.enable.conditional.create.overwrite" is enabled and
// is a create request with overwrite=true, create will follow different
Expand All @@ -661,9 +663,9 @@ public OutputStream createFile(final Path path,
}

final ContextEncryptionAdapter contextEncryptionAdapter;
if (client.getEncryptionType() == EncryptionType.ENCRYPTION_CONTEXT) {
if (createClient.getEncryptionType() == EncryptionType.ENCRYPTION_CONTEXT) {
contextEncryptionAdapter = new ContextProviderEncryptionAdapter(
client.getEncryptionContextProvider(), getRelativePath(path));
createClient.getEncryptionContextProvider(), getRelativePath(path));
} else {
contextEncryptionAdapter = NoContextEncryptionAdapter.getInstance();
}
Expand All @@ -674,11 +676,12 @@ public OutputStream createFile(final Path path,
new Permissions(isNamespaceEnabled, permission, umask),
isAppendBlob,
contextEncryptionAdapter,
tracingContext
tracingContext,
createClient
);

} else {
op = client.createPath(relativePath, true,
op = createClient.createPath(relativePath, true,
overwrite,
new Permissions(isNamespaceEnabled, permission, umask),
isAppendBlob,
Expand All @@ -690,20 +693,33 @@ public OutputStream createFile(final Path path,
perfInfo.registerResult(op.getResult()).registerSuccess(true);

AbfsLease lease = maybeCreateLease(relativePath, tracingContext);

String eTag = op.getResult().getResponseHeader(HttpHeaderConfigurations.ETAG);
anujmodi2021 marked this conversation as resolved.
Show resolved Hide resolved
checkSmallWriteOptimization();
anmolanmol1234 marked this conversation as resolved.
Show resolved Hide resolved
return new AbfsOutputStream(
populateAbfsOutputStreamContext(
isAppendBlob,
lease,
client,
clientHandler,
statistics,
relativePath,
0,
eTag,
contextEncryptionAdapter,
tracingContext));
}
}

/**
* Checks and disables the small write optimization if the client is an instance of {@link AbfsBlobClient}
* and the small write optimization is enabled in the configuration.
*/
private void checkSmallWriteOptimization() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why check in store class ? Cant this happen in AbfsOutputStreamContext as a method ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added check in AbfsOuputStreamContext class

AbfsClient ingressClient = getClient(abfsConfiguration.getIngressServiceType());
if (ingressClient instanceof AbfsBlobClient && abfsConfiguration.isSmallWriteOptimizationEnabled()) {
abfsConfiguration.setSmallWriteOptimization(false);
}
}

/**
* Conditional create overwrite flow ensures that create overwrites is done
* only if there is match for eTag of existing file.
Expand All @@ -719,14 +735,14 @@ private AbfsRestOperation conditionalCreateOverwriteFile(final String relativePa
final Permissions permissions,
final boolean isAppendBlob,
final ContextEncryptionAdapter contextEncryptionAdapter,
final TracingContext tracingContext) throws IOException {
final TracingContext tracingContext, AbfsClient createClient) throws IOException {
anujmodi2021 marked this conversation as resolved.
Show resolved Hide resolved
AbfsRestOperation op;

try {
// Trigger a create with overwrite=false first so that eTag fetch can be
// avoided for cases when no pre-existing file is present (major portion
// of create file traffic falls into the case of no pre-existing file).
op = client.createPath(relativePath, true, false, permissions,
op = createClient.createPath(relativePath, true, false, permissions,
isAppendBlob, null, contextEncryptionAdapter, tracingContext);

} catch (AbfsRestOperationException e) {
Expand All @@ -751,7 +767,7 @@ private AbfsRestOperation conditionalCreateOverwriteFile(final String relativePa

try {
// overwrite only if eTag matches with the file properties fetched befpre
op = client.createPath(relativePath, true, true, permissions,
op = createClient.createPath(relativePath, true, true, permissions,
isAppendBlob, eTag, contextEncryptionAdapter, tracingContext);
} catch (AbfsRestOperationException ex) {
if (ex.getStatusCode() == HttpURLConnection.HTTP_PRECON_FAILED) {
Expand Down Expand Up @@ -779,7 +795,7 @@ private AbfsRestOperation conditionalCreateOverwriteFile(final String relativePa
*
* @param isAppendBlob is Append blob support enabled?
* @param lease instance of AbfsLease for this AbfsOutputStream.
* @param client AbfsClient.
* @param clientHandler AbfsClientHandler.
* @param statistics FileSystem statistics.
* @param path Path for AbfsOutputStream.
* @param position Position or offset of the file being opened, set to 0
Expand All @@ -791,10 +807,11 @@ private AbfsRestOperation conditionalCreateOverwriteFile(final String relativePa
private AbfsOutputStreamContext populateAbfsOutputStreamContext(
boolean isAppendBlob,
AbfsLease lease,
AbfsClient client,
AbfsClientHandler clientHandler,
FileSystem.Statistics statistics,
String path,
long position,
String eTag,
ContextEncryptionAdapter contextEncryptionAdapter,
TracingContext tracingContext) {
int bufferSize = abfsConfiguration.getWriteBufferSize();
Expand All @@ -815,24 +832,28 @@ private AbfsOutputStreamContext populateAbfsOutputStreamContext(
.withEncryptionAdapter(contextEncryptionAdapter)
.withBlockFactory(getBlockFactory())
.withBlockOutputActiveBlocks(blockOutputActiveBlocks)
.withClient(client)
.withClientHandler(clientHandler)
.withPosition(position)
.withFsStatistics(statistics)
.withPath(path)
.withExecutorService(new SemaphoredDelegatingExecutor(boundedThreadPool,
blockOutputActiveBlocks, true))
.withTracingContext(tracingContext)
.withAbfsBackRef(fsBackRef)
.withIngressServiceType(abfsConfiguration.getIngressServiceType())
anujmodi2021 marked this conversation as resolved.
Show resolved Hide resolved
.withDFSToBlobFallbackEnabled(abfsConfiguration.isDfsToBlobFallbackEnabled())
.withETag(eTag)
.build();
}

public void createDirectory(final Path path, final FsPermission permission,
final FsPermission umask, TracingContext tracingContext)
throws IOException {
try (AbfsPerfInfo perfInfo = startTracking("createDirectory", "createPath")) {
AbfsClient createClient = clientHandler.getClient(abfsConfiguration.getIngressServiceType());
boolean isNamespaceEnabled = getIsNamespaceEnabled(tracingContext);
LOG.debug("createDirectory filesystem: {} path: {} permission: {} umask: {} isNamespaceEnabled: {}",
client.getFileSystem(),
createClient.getFileSystem(),
path,
permission,
umask,
Expand All @@ -842,7 +863,12 @@ public void createDirectory(final Path path, final FsPermission permission,
!isNamespaceEnabled || abfsConfiguration.isEnabledMkdirOverwrite();
Permissions permissions = new Permissions(isNamespaceEnabled,
permission, umask);
final AbfsRestOperation op = client.createPath(getRelativePath(path),
if (!isNamespaceEnabled && createClient instanceof AbfsBlobClient) {
((AbfsBlobClient) createClient).createMarkerBlobs(path, overwrite, permissions, false,
null,
null, tracingContext);
}
final AbfsRestOperation op = createClient.createPath(getRelativePath(path),
false, overwrite, permissions, false, null, null, tracingContext);
perfInfo.registerResult(op.getResult()).registerSuccess(true);
}
Expand Down Expand Up @@ -978,6 +1004,7 @@ public OutputStream openFileForWrite(final Path path,
overwrite);

String relativePath = getRelativePath(path);
AbfsClient writeClient = getClient(abfsConfiguration.getIngressServiceType());

final AbfsRestOperation op = client
.getPathStatus(relativePath, false, tracingContext, null);
Expand All @@ -990,7 +1017,7 @@ public OutputStream openFileForWrite(final Path path,
throw new AbfsRestOperationException(
AzureServiceErrorCode.PATH_NOT_FOUND.getStatusCode(),
AzureServiceErrorCode.PATH_NOT_FOUND.getErrorCode(),
"openFileForRead must be used with files and not directories",
"openFileForWrite must be used with files and not directories",
null);
}

Expand All @@ -1004,8 +1031,9 @@ public OutputStream openFileForWrite(final Path path,
}

AbfsLease lease = maybeCreateLease(relativePath, tracingContext);
final String eTag = extractEtagHeader(op.getResult());
final ContextEncryptionAdapter contextEncryptionAdapter;
if (client.getEncryptionType() == EncryptionType.ENCRYPTION_CONTEXT) {
if (writeClient.getEncryptionType() == EncryptionType.ENCRYPTION_CONTEXT) {
final String encryptionContext = op.getResult()
.getResponseHeader(
HttpHeaderConfigurations.X_MS_ENCRYPTION_CONTEXT);
Expand All @@ -1014,20 +1042,21 @@ public OutputStream openFileForWrite(final Path path,
"File doesn't have encryptionContext.");
}
contextEncryptionAdapter = new ContextProviderEncryptionAdapter(
client.getEncryptionContextProvider(), getRelativePath(path),
writeClient.getEncryptionContextProvider(), getRelativePath(path),
encryptionContext.getBytes(StandardCharsets.UTF_8));
} else {
contextEncryptionAdapter = NoContextEncryptionAdapter.getInstance();
}

checkSmallWriteOptimization();
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we do it in the store init, no need to call this method again. What you feel.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added check in AbfsOutputStreamContext class

return new AbfsOutputStream(
populateAbfsOutputStreamContext(
isAppendBlob,
lease,
client,
clientHandler,
statistics,
relativePath,
offset,
eTag,
contextEncryptionAdapter,
tracingContext));
}
Expand Down Expand Up @@ -2156,6 +2185,11 @@ public AbfsClient getClient(AbfsServiceType serviceType) {
return this.clientHandler.getClient(serviceType);
}

@VisibleForTesting
public AbfsClientHandler getClientHandler() {
anmolanmol1234 marked this conversation as resolved.
Show resolved Hide resolved
return clientHandler;
}

@VisibleForTesting
void setClient(AbfsClient client) {
this.client = client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public final class AbfsHttpConstants {
public static final String BLOCK_BLOB_TYPE = "BlockBlob";
public static final String BLOCK_TYPE_COMMITTED = "committed";
public static final String TOKEN_VERSION = "2";
public static final String APPEND_BLOCK = "appendblock";

public static final String JAVA_VENDOR = "java.vendor";
public static final String JAVA_VERSION = "java.version";
Expand Down Expand Up @@ -149,7 +150,7 @@ public final class AbfsHttpConstants {
public enum ApiVersion {

DEC_12_2019("2019-12-12"),
APR_10_2021("2021-04-10"),
AUG_06_2021("2021-08-06"),
anujmodi2021 marked this conversation as resolved.
Show resolved Hide resolved
AUG_03_2023("2023-08-03");

private final String xMsApiVersion;
Expand Down Expand Up @@ -213,7 +214,11 @@ public static ApiVersion getCurrentVersion() {
public static final String XML_TAG_BLOB_ERROR_MESSAGE_END_XML = "</Message>";
public static final String XML_TAG_COMMITTED_BLOCKS = "CommittedBlocks";
public static final String XML_TAG_BLOCK_NAME = "Block";

public static final String XML_VERSION = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
public static final String BLOCK_LIST_START_TAG = "<BlockList>\n";
public static final String BLOCK_LIST_END_TAG = "</BlockList>\n";
public static final String LATEST_BLOCK_FORMAT = "<Latest>%s</Latest>\n";
public static final String PUT_BLOCK_LIST = "PutBlockList";
/**
* List of configurations that are related to Customer-Provided-Keys.
* <ol>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,7 @@ public final class FileSystemConfigurations {
public static final int HUNDRED = 100;
public static final long THOUSAND = 1000L;

public static final int BLOCK_ID_LENGTH = 60;
anujmodi2021 marked this conversation as resolved.
Show resolved Hide resolved

private FileSystemConfigurations() {}
}
Loading
Loading