Commit 40a8b87
committed
HDFS-13934. Multipart uploaders to be created through FileSystem/FileContext.
This is my proposal for an API for multipart uploads through the FS, rather than via service loading.
It builds on the work done in createFile() and openFile() for builders and futures.
* a builder API for configuring the uploader, including specifying the permissions of uploaded files.
* MultipartUploader is now interface; org.apache.hadoop.fs.impl.AbstractMultipartUploader is the base class for implementations to extend.
* all the operations in the interface now return FutureCompletable<>; implementations can perform the operations synchronously or asynchronously.
* there is a new common path capability for the hasPathCapabilities() probe.
FileSystemMultipartUploader and its builder moved to fs.impl; I needed a class org.apache.hadoop.fs.InternalOperations to get at rename/3 from the new package. It really is time to make the good rename method public.
S3AMultipartUploader moved to fs.s3a.impl, alongside its builder. The uploader does not get a reference to the base FS; it gets a StoreContext and WriteOperationHelper and has to work with them. All operations and now async and executed in the executor offered by the StoreContext.
Tests are all fixed up to cope with the changed API.
The builders can be created from the file system; we can also extend file context and the filter classes... Though I would not pass the operation through checksum FS as the uploads will not be checksummed.
One thing I am unsure about is viewFS: even though we can do with the remapping when the builder is created, the actual uploads need the full path in the store. That is unless, this and the WiP copy operation both take a path remapper in the builder which is then used to map from View FS paths to ones in their store. Suggestions here are welcome.
No changes into the specification; yet. Let's get feedback first.
Change-Id: Ib526fe6db8e9282c634181be231d4124ea6c78fc1 parent 5157118 commit 40a8b87
File tree
23 files changed
+818
-329
lines changed- hadoop-common-project/hadoop-common/src
- main
- java/org/apache/hadoop/fs
- impl
- resources/META-INF/services
- test/java/org/apache/hadoop/fs/contract
- hadoop-hdfs-project/hadoop-hdfs-client/src/main
- java/org/apache/hadoop/hdfs
- client
- web
- resources/META-INF/services
- hadoop-tools/hadoop-aws/src
- main
- java/org/apache/hadoop/fs/s3a
- impl
- resources/META-INF/services
- test/java/org/apache/hadoop/fs/s3a/impl
23 files changed
+818
-329
lines changedhadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/CommonPathCapabilities.java
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
134 | 142 | | |
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4644 | 4644 | | |
4645 | 4645 | | |
4646 | 4646 | | |
| 4647 | + | |
| 4648 | + | |
| 4649 | + | |
| 4650 | + | |
| 4651 | + | |
| 4652 | + | |
| 4653 | + | |
| 4654 | + | |
| 4655 | + | |
| 4656 | + | |
| 4657 | + | |
| 4658 | + | |
| 4659 | + | |
4647 | 4660 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
27 | 25 | | |
28 | 26 | | |
29 | | - | |
30 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
Lines changed: 11 additions & 65 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
| 44 | + | |
44 | 45 | | |
45 | | - | |
46 | | - | |
47 | | - | |
| 46 | + | |
48 | 47 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | 48 | | |
58 | 49 | | |
59 | 50 | | |
60 | 51 | | |
61 | 52 | | |
62 | 53 | | |
63 | 54 | | |
64 | | - | |
| 55 | + | |
| 56 | + | |
65 | 57 | | |
66 | 58 | | |
67 | 59 | | |
| |||
75 | 67 | | |
76 | 68 | | |
77 | 69 | | |
78 | | - | |
| 70 | + | |
| 71 | + | |
79 | 72 | | |
80 | 73 | | |
81 | 74 | | |
| |||
88 | 81 | | |
89 | 82 | | |
90 | 83 | | |
91 | | - | |
| 84 | + | |
92 | 85 | | |
93 | 86 | | |
94 | 87 | | |
| |||
98 | 91 | | |
99 | 92 | | |
100 | 93 | | |
| 94 | + | |
101 | 95 | | |
102 | | - | |
| 96 | + | |
| 97 | + | |
103 | 98 | | |
104 | 99 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | 100 | | |
0 commit comments