File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/impl/streams Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -203,14 +203,18 @@ private void onReadFailure(IOException ioe) throws IOException {
203
203
}
204
204
205
205
private OpenStreamInformation buildOpenStreamInformation (ObjectReadParameters parameters ) {
206
- OpenStreamInformation openFileInformation = OpenStreamInformation .builder ().inputPolicy (mapS3AInputPolicyToAAL (parameters .getContext ()
207
- .getInputPolicy ()))
208
- .objectMetadata (ObjectMetadata .builder ()
209
- .contentLength (parameters .getObjectAttributes ().getLen ())
210
- .etag (parameters .getObjectAttributes ().getETag ()).build ())
211
- .build ();
212
-
213
- return openFileInformation ;
206
+ OpenStreamInformation .OpenStreamInformationBuilder openStreamInformationBuilder =
207
+ OpenStreamInformation .builder ()
208
+ .inputPolicy (mapS3AInputPolicyToAAL (parameters .getContext ()
209
+ .getInputPolicy ()));
210
+
211
+ if (parameters .getObjectAttributes ().getETag () != null ) {
212
+ openStreamInformationBuilder .objectMetadata (ObjectMetadata .builder ()
213
+ .contentLength (parameters .getObjectAttributes ().getLen ())
214
+ .etag (parameters .getObjectAttributes ().getETag ()).build ());
215
+ }
216
+
217
+ return openStreamInformationBuilder .build ();
214
218
}
215
219
216
220
/**
You can’t perform that action at this time.
0 commit comments