-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HADOOP-18637:S3A to support upload of files greater than 2 GB using DiskBlocks #5481
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 12 commits
03a8c8b
768f41b
ddde1e6
542ffc2
773e03a
58a0453
5d3f9d9
a2d25f6
f381b88
ca725f9
ea0007f
1f56e2a
4e922b4
13fc2d5
1476424
f18c0cb
7207fdd
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 |
|---|---|---|
|
|
@@ -414,6 +414,11 @@ public class S3AFileSystem extends FileSystem implements StreamCapabilities, | |
| */ | ||
| private ArnResource accessPoint; | ||
|
|
||
| /** | ||
| * Is this S3A FS instance has multipart uploads enabled? | ||
|
||
| */ | ||
| private boolean isMultipartEnabled; | ||
|
|
||
| /** | ||
| * A cache of files that should be deleted when the FileSystem is closed | ||
| * or the JVM is exited. | ||
|
|
@@ -533,6 +538,8 @@ public void initialize(URI name, Configuration originalConf) | |
| this.prefetchBlockSize = (int) prefetchBlockSizeLong; | ||
| this.prefetchBlockCount = | ||
| intOption(conf, PREFETCH_BLOCK_COUNT_KEY, PREFETCH_BLOCK_DEFAULT_COUNT, 1); | ||
| this.isMultipartEnabled = conf.getBoolean(MULTIPART_UPLOADS_ENABLED, | ||
| MULTIPART_UPLOAD_ENABLED_DEFAULT); | ||
|
|
||
| initThreadPools(conf); | ||
|
|
||
|
|
@@ -595,7 +602,6 @@ public void initialize(URI name, Configuration originalConf) | |
| } | ||
| blockOutputBuffer = conf.getTrimmed(FAST_UPLOAD_BUFFER, | ||
| DEFAULT_FAST_UPLOAD_BUFFER); | ||
| partSize = ensureOutputParameterInRange(MULTIPART_SIZE, partSize); | ||
| blockFactory = S3ADataBlocks.createFactory(this, blockOutputBuffer); | ||
| blockOutputActiveBlocks = intOption(conf, | ||
| FAST_UPLOAD_ACTIVE_BLOCKS, DEFAULT_FAST_UPLOAD_ACTIVE_BLOCKS, 1); | ||
|
|
@@ -1831,6 +1837,11 @@ private FSDataOutputStream innerCreateFile( | |
| final PutObjectOptions putOptions = | ||
| new PutObjectOptions(keep, null, options.getHeaders()); | ||
|
|
||
| if(!checkDiskBuffer(getConf())){ | ||
|
||
| throw new IOException("Unable to create OutputStream with the given" | ||
| + "multipart upload and buffer configuration."); | ||
| } | ||
|
|
||
| final S3ABlockOutputStream.BlockOutputStreamBuilder builder = | ||
| S3ABlockOutputStream.builder() | ||
| .withKey(destKey) | ||
|
|
@@ -1854,7 +1865,8 @@ private FSDataOutputStream innerCreateFile( | |
| .withCSEEnabled(isCSEEnabled) | ||
| .withPutOptions(putOptions) | ||
| .withIOStatisticsAggregator( | ||
| IOStatisticsContext.getCurrentIOStatisticsContext().getAggregator()); | ||
| IOStatisticsContext.getCurrentIOStatisticsContext().getAggregator()) | ||
| .withMultipartEnabled(isMultipartEnabled); | ||
| return new FSDataOutputStream( | ||
| new S3ABlockOutputStream(builder), | ||
| null); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.