bilaharith commented on a change in pull request #1907: HADOOP-16854 Fix to 
prevent OutOfMemoryException and Make the threadpool and bytebuffer pool common 
across all AbfsOutputStream instances
URL: https://github.com/apache/hadoop/pull/1907#discussion_r403502335
 
 

 ##########
 File path: 
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AzureBlobFileSystemStore.java
 ##########
 @@ -416,33 +417,39 @@ public OutputStream createFile(final Path path, final 
boolean overwrite, final F
                                  final FsPermission umask) throws 
AzureBlobFileSystemException {
     try (AbfsPerfInfo perfInfo = startTracking("createFile", "createPath")) {
       boolean isNamespaceEnabled = getIsNamespaceEnabled();
-      LOG.debug("createFile filesystem: {} path: {} overwrite: {} permission: 
{} umask: {} isNamespaceEnabled: {}",
-              client.getFileSystem(),
-              path,
-              overwrite,
-              permission.toString(),
-              umask.toString(),
-              isNamespaceEnabled);
+      LOG.debug(
+          "createFile filesystem: {} path: {} overwrite: {} permission: {} 
umask: {} isNamespaceEnabled: {}",
+          client.getFileSystem(), path, overwrite, permission.toString(), 
umask.toString(),
+          isNamespaceEnabled);
 
-        boolean appendBlob = false;
-        if (isAppendBlobKey(path.toString())) {
-          appendBlob = true;
-        }
+      boolean appendBlob = false;
+      if (isAppendBlobKey(path.toString())) {
+        appendBlob = true;
+      }
 
-      client.createPath(AbfsHttpConstants.FORWARD_SLASH + 
getRelativePath(path), true, overwrite,
+      client.createPath(AbfsHttpConstants.FORWARD_SLASH + 
getRelativePath(path),
+          true, overwrite,
           isNamespaceEnabled ? getOctalNotation(permission) : null,
-          isNamespaceEnabled ? getOctalNotation(umask) : null,
-          appendBlob);
-
-      return new AbfsOutputStream(
-          client,
-          AbfsHttpConstants.FORWARD_SLASH + getRelativePath(path),
-          0,
-          abfsConfiguration.getWriteBufferSize(),
+          isNamespaceEnabled ? getOctalNotation(umask) : null, appendBlob);
+
+      if (abfsConfiguration.shouldUseOlderAbfsOutputStream()) {
+        return new AbfsOutputStreamOld(
+            client,
+            AbfsHttpConstants.FORWARD_SLASH + getRelativePath(path),
+            0,
+            abfsConfiguration.getWriteBufferSize(),
+            abfsConfiguration.isFlushEnabled(),
+            abfsConfiguration.isOutputStreamFlushDisabled(),
+            abfsConfiguration.isAppendWithFlushEnabled(),
+            appendBlob);
+      }
+      return new AbfsOutputStream(client,
 
 Review comment:
   Done

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to